// Add appends a handler to ServReplay's handler list.
// It returns itself to allow chaining.
975728
func (h *ServeReplay) Add(handler http.Handler) *ServeReplay {
	h.Handlers = append(h.Handlers, handler)
	return h
}
494463
func (b *Builder) Add(args ...string) error {
	for _, a := range args {
		if err := b.add(a); err != nil {
			return errwrap.Wrapf(fmt.Sprintf("invalid key/value pair %q: {{err}}", a), err)
		}
	}

	return nil
}
176189
func (h *Handler) Add(c Checker) {
	h.checkers = append(h.checkers, c)
}
1118893
func (hl *HandlerList) Append(h Handler) {
	hl.list = append(hl.list, h)
}
751013
func (s *Stack) Add(m ...Middleware) {
	for _, mdw := range m {
		s.Stack = s.Stack.Append(alice.Constructor(mdw))
	}
}
325477
func (hm *handlerManager) AddInvokeHandler(handler ...InvokeHandler) {
	if len(handler) == 0 {
		return
	}
	hm.invokeHandlers = append(hm.invokeHandlers, handler...)
	next := hm.defaultInvokeHandler
	for i := len(hm.invokeHandlers) - 1; i >= 0; i-- {
		next = getNextInvokeHandler(next, hm.invokeHandlers[i])
	}
	hm.invokeHandler = next
}
889825
func (b *multiErrBuilder) Add(err error) {
	if err != nil {
		b.errs = append(b.errs, err)
	}
}
1354785
func (ll *ListLogHandler) Add(h LogHandler) {
	if h != nil {
		ll.handlers = append(ll.handlers, h)
	}
}
203295
func (p *httpStreamPair) add(stream httpstream.Stream) (bool, error) {
	p.lock.Lock()
	defer p.lock.Unlock()

	switch stream.Headers().Get(StreamType) {
	case StreamTypeError:
		if p.errorStream != nil {
			return false, trace.BadParameter("error stream already assigned")
		}
		p.errorStream = stream
	case StreamTypeData:
		if p.dataStream != nil {
			return false, trace.BadParameter("data stream already assigned")
		}
		p.dataStream = stream
	}

	complete := p.errorStream != nil && p.dataStream != nil
	if complete {
		close(p.complete)
	}
	return complete, nil
}
1001718
func (app *App) AddHandler(spec Spec) error {
	var handler http.HandlerFunc

	// make a handler depending on the function provided in the spec
	if spec.RawHandler != nil {
		handler = spec.RawHandler
	} else if spec.Handler != nil {
		handler = MakeHandler(app, spec.Handler, spec)
	} else if spec.HandlerWithBody != nil {
		handler = MakeHandlerWithBody(app, spec.HandlerWithBody, spec)
	} else {
		return fmt.Errorf("the spec does not provide a handler function: %v", spec)
	}

	for _, path := range spec.Paths {
		route := app.router.HandleFunc(path, handler).Methods(spec.Methods...)
		if len(spec.Headers) != 0 {
			route.Headers(spec.Headers...)
		}
		if app.vulcandReg != nil {
			app.registerFrontend(spec.Methods, path, spec.Scope, spec.Middlewares)
		}
	}

	return nil
}
1142804
func (h Handler) Append(cmd common.SetRequest) error {
	_, err := h.doRequest(cmd, common.RequestAppend)
	return err
}
1023334
func AddCommand(pattern string, handler handler) {
    commands = append(commands, Command{Pattern: regexp.MustCompile(pattern), Handler: handler})
}
245749
func (r *Router) Add(method string, path string, handler HandlerFunc) {
	_logger.debug("===Add")
	if len(path) == 0 {
		panic("router: path couldn't be empty")
	}
	if path[0] != '/' {
		panic("router: path was invalid")
	}
	if len(path) > 1 {
		path = path[1:]
	}
	_logger.debug("path:" + path)

	currentNode := r.tree.rootNode
	if path == "/" {
		currentNode.addHandler(method, handler)
		return
	}

	pathArray := strings.Split(path, "/")
	count := len(pathArray)
	pathParams := []string{}

	for index, element := range pathArray {
		if len(element) == 0 {
			continue
		}

		var childNode *node
		firstSymbol := element[0]
		if firstSymbol == ':' {
			// this is parameter node
			pName := element[1:]
			_logger.debug("parameter_node_pname:" + pName)
			childNode = currentNode.findChildByKind(pkind)
			if childNode == nil {
				childNode = newNode(pName, pkind)
				currentNode.addChild(childNode)
			}

			isFound := false
			for _, p := range childNode.pNames {
				if p == pName {
					isFound = true
				}
			}

			if isFound == false {
				childNode.pNames = append(childNode.pNames, pName)
				_logger.debug("add_parameter_name:" + pName)
			}

			pathParams = append(pathParams, pName)

		} else if firstSymbol == '*' {
			// this is match any node.  We should allow one match any node only.
			pName := element[1:]
			_logger.debug("match_node_pname:" + pName)
			childNode = currentNode.findChildByKind(akind)
			if childNode == nil {
				childNode = newNode(pName, akind)
				currentNode.addChild(childNode)
				childNode.pNames = append(childNode.pNames, pName)
			}

			pathParams = append(pathParams, pName)

		} else {
			// this is static node
			childNode = currentNode.findChildByName(element)
			if childNode == nil {
				childNode = newNode(element, skind)
				currentNode.addChild(childNode)
			}
		}

		// last node in the path
		if count == index+1 {
			childNode.params = pathParams
			childNode.addHandler(method, handler)
		}

		currentNode = childNode
	}

}
382715
func (k *Kite) addHandle(method string, handler Handler) *Method {
	authenticate := true
	if k.Config.DisableAuthentication {
		authenticate = false
	}

	m := &Method{
		name:         method,
		handler:      handler,
		authenticate: authenticate,
		handling:     k.MethodHandling,
	}

	k.handlers[method] = m
	return m
}
396736
func (w Webhooks) Add(name, method, format, url string) {
	w[name+".Method"] = method
	w[name+".Format"] = format
	w[name+".Url"] = url
}
803327
func (r *Route) add(method string, handlers []Handler) *Route {
	hh := combineHandlers(r.group.handlers, handlers)
	r.group.router.add(method, r.path, hh)
	return r
}
489191
func (r *Registry) AddHandler(h RegisterObject) {
	r.m.Lock()
	r.handlers[h.Reference()] = h
	r.m.Unlock()
}