// DefaultTagHandler describes default tag handler
168995
func DefaultTagHandler(ctx *tagContext) error {
	if len(ctx.params) > 0 {
		ctx.col.Default = ctx.params[0]
	} else {
		ctx.col.Default = ctx.nextTag
		ctx.ignoreNext = true
	}
	return nil
}
1107799
func (s *CountService) DefaultOperator(defaultOperator string) *CountService {
	s.defaultOperator = defaultOperator
	return s
}
684761
func (o *ClientOptions) SetDefaultPublishHandler(defaultHandler MessageHandler) *ClientOptions {
	o.DefaultPublishHander = defaultHandler
	return o
}
477456
func defaultHookContainerName(hook *v1.LifecycleHook, containerName string) {
	if hook == nil {
		return
	}
	for i := range hook.TagImages {
		if len(hook.TagImages[i].ContainerName) == 0 {
			hook.TagImages[i].ContainerName = containerName
		}
	}
	if hook.ExecNewPod != nil {
		if len(hook.ExecNewPod.ContainerName) == 0 {
			hook.ExecNewPod.ContainerName = containerName
		}
	}
}
654554
func (cMgr *ConfigurationManager) handlePtr(rValue reflect.Value, tagName string) error {
	if rValue.IsNil() {
		ptrValue := reflect.New(rValue.Type().Elem())
		err := cMgr.unmarshal(ptrValue, getTagKey(tagName, doNotConsiderTag))
		if err != nil {
			return err
		}

		if rValue.CanSet() {
			rValue.Set(ptrValue)
		}
		return nil
	} else if rValue.Elem().Kind() == reflect.Ptr {
		ptrValue := rValue.Elem()
		err := cMgr.handlePtr(ptrValue, getTagKey(tagName, doNotConsiderTag))
		if err != nil {
			return err
		}
	}

	ptrValue := rValue.Elem()
	err := cMgr.unmarshal(ptrValue, getTagKey(tagName, doNotConsiderTag))
	if err != nil {
		return err
	}

	return nil
}
37111
func SyslogHandler(priority syslog.Priority, tag string, fmtr Format) (Handler, error) {
	wr, err := syslog.New(priority, tag)
	return sharedSyslog(fmtr, wr, err)
}
587754
func (s *Swagui) Handler(defaultDefinition string) http.Handler {
	return s.p.Handler(s.nf, defaultDefinition)
}
1136663
func OnlyFromDBTagHandler(ctx *tagContext) error {
	ctx.col.MapType = core.ONLYFROMDB
	return nil
}
523546
func CustomWrapHandler(config *Config, h *webdav.Handler) gin.HandlerFunc {
	//create a template with name
	t := template.New("swagger_index.html")
	index, _ := t.Parse(swagger_index_templ)

	var rexp = regexp.MustCompile(`(.*)(index\.html|doc\.json|favicon-16x16\.png|favicon-32x32\.png|/oauth2-redirect\.html|swagger-ui\.css|swagger-ui\.css\.map|swagger-ui\.js|swagger-ui\.js\.map|swagger-ui-bundle\.js|swagger-ui-bundle\.js\.map|swagger-ui-standalone-preset\.js|swagger-ui-standalone-preset\.js\.map)[\?|.]*`)

	return func(c *gin.Context) {

		type swaggerUIBundle struct {
			URL string
		}

		var matches []string
		if matches = rexp.FindStringSubmatch(c.Request.RequestURI); len(matches) != 3 {
			c.Status(404)
			c.Writer.Write([]byte("404 page not found"))
			return
		}
		path := matches[2]
		prefix := matches[1]
		h.Prefix = prefix

		if strings.HasSuffix(path, ".html") {
			c.Header("Content-Type", "text/html; charset=utf-8")
		} else if strings.HasSuffix(path, ".css") {
			c.Header("Content-Type", "text/css; charset=utf-8")
		} else if strings.HasSuffix(path, ".js") {
			c.Header("Content-Type", "application/javascript")
		} else if strings.HasSuffix(path, ".json") {
			c.Header("Content-Type", "application/json")
		}

		switch path {
		case "index.html":
			index.Execute(c.Writer, &swaggerUIBundle{
				URL: config.URL,
			})
		case "doc.json":
			doc, err := swag.ReadDoc()
			if err != nil {
				panic(err)
			}
			c.Writer.Write([]byte(doc))
			return
		default:
			h.ServeHTTP(c.Writer, c.Request)
		}
	}
}
165002
func (m *Module) DefaultHandle500(rw http.ResponseWriter, req *http.Request, err error) {
	m.Logger.Errorf("%s: %s", req.URL, err)
	http.Error(rw, "internal server error", http.StatusInternalServerError)
}
107606
func DefaultResponder(w http.ResponseWriter, r *http.Request, v interface{}) {
	if v != nil {
		switch reflect.TypeOf(v).Kind() {
		case reflect.Chan:
			switch GetAcceptedContentType(r) {
			case ContentTypeEventStream:
				channelEventStream(w, r, v)
				return
			default:
				v = channelIntoSlice(w, r, v)
			}
		}
	}

	// Format response based on request Accept header.
	switch GetAcceptedContentType(r) {
	case ContentTypeJSON:
		JSON(w, r, v)
	case ContentTypeXML:
		XML(w, r, v)
	default:
		JSON(w, r, v)
	}
}
906060
func (so *SpanObserver) OnSetTag(key string, value interface{}) {
	so.mux.Lock()
	so.handleTagInLock(key, value)
	so.mux.Unlock()
}
1302221
func defaultUnauthorizedHandler(w http.ResponseWriter, r *http.Request) {
	http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
}
531790
func DefaultQueryHandler(rows *sql.Rows) (bool, error) {
	defer rows.Close()

	numRows := 0
	for rows.Next() {
		numRows++
	}

	return numRows == 1, nil
}
1321129
func tagURLForParser(doc *p2.Parser, start *p2.Token, arguments *p2.Parser) (p2.INodeTag, *p2.Error) {
	evals := []p2.IEvaluator{}
	for arguments.Remaining() > 0 {
		expr, err := arguments.ParseExpression()
		evals = append(evals, expr)
		if err != nil {
			return nil, err
		}
	}

	if len(evals) <= 0 {
		return nil, arguments.Error("URL takes one argument for the controller and any number of optional value.", nil)
	}
	return &INodeImplied{Exec: func(ctx *p2.ExecutionContext, w p2.TemplateWriter) *p2.Error {

		v := &tagURLForNode{evals}
		return v.Execute(ctx, w)
	}}, nil
}
254980
func CacheTagHandler(ctx *tagContext) error {
	if !ctx.hasCacheTag {
		ctx.hasCacheTag = true
	}
	return nil
}
690263
func DefaultTokenHelper() (token.TokenHelper, error) {
	config, err := LoadConfig("")
	if err != nil {
		return nil, err
	}

	path := config.TokenHelper
	if path == "" {
		return &token.InternalTokenHelper{}, nil
	}

	path, err = token.ExternalTokenHelperPath(path)
	if err != nil {
		return nil, err
	}
	return &token.ExternalTokenHelper{BinaryPath: path}, nil
}