// init loads the existing templates for use by routing code.
774527
func init() {
	// In order for the endpoint tests to run this needs to be
	// physically located. Trying to avoid configuration for now.
	tmplPath := os.Getenv("GOPATH") + "/src/github.com/goinggo/concurrentwebservice"
	loadTemplate("layout", tmplPath+"/views/basic-layout.html")
	loadTemplate("index", tmplPath+"/views/index.html")
	loadTemplate("results", tmplPath+"/views/results.html")
}
642142
func (t *Table) init() error {
	if t.initialized {
		return nil
	}

	if err := t.initBuild(); err != nil {
		return err
	}

	// initialize all the nested fields
	for i := range t.Fields {
		if err := t.Fields[i].init(); err != nil {
			return Errorf(err, "initializing field %s", t.Fields[i].Name)
		}
	}

	t.initialized = true
	return nil
}
32119
func (r *ChainResponse) Init(context smolder.APIContext) {
	r.Parent = r
	r.Context = context

	r.chains = make(map[string]*bees.Chain)
}
137749
func (h *loaderHandler) Init() error {
	var m = make(map[string]interface{})
	if err := h.loader.Load(&m); err != nil {
		return err
	}
	h.handler = MapUse(m)
	return h.handler.Init()
}
52842
func (b *Bootstrap) Init() error {
	if b.inited {
		return fmt.Errorf("Bootstrap can not be inited twice")
	}
	b.inited = true
	for _, module := range b.modules {
		if err := module.RegisterDependencies(b.gapp); err != nil {
			return err
		}
	}
	for _, module := range b.modules {
		if err := module.InitDependencies(b.gapp); err != nil {
			return err
		}
	}
	// clean unused dependencies
	b.gapp = nil
	return nil
}
1103191
func (m *Module) Init(c *service.Config) {
	c.Setup = func() error {
		m.Router.HTTPRouter.NotFound = m
		m.staticBasePath = defaultStaticBasePath
		m.staticDirs = defaultStaticDirs
		m.handle404 = m.DefaultHandle404
		m.handle500 = m.DefaultHandle500
		return nil
	}
	c.Start = func() {
		m.Router.Root.Handle(m.staticBasePath, m)
	}
}
1337490
func (m *MultiLRUCache) Init(buckets, bucket_capacity uint) {
	m.buckets = buckets
	m.cache = make([]*LRUCache, buckets)
	for i := uint(0); i < buckets; i++ {
		m.cache[i] = NewLRUCache(bucket_capacity)
	}
}
200953
func init() {
	// ArchCI web pages.
	beego.Router("/", &controllers.MainController{})
	beego.Router("/builds", &controllers.MainController{})
	beego.Router("/builds/:buildId", &controllers.MainController{})
	beego.Router("/projects", &controllers.MainController{})
	beego.Router("/projects/:projectId", &controllers.MainController{})
	beego.Router("/workers", &controllers.MainController{})
	beego.Router("/account", &controllers.MainController{})

	// Login api.
	beego.Router("/v1/login/github", &controllers.ApiController{}, "get:LoginGithub")
	beego.Router("/v1/login/github/callback", &controllers.ApiController{}, "get:LoginGithubCallback")

	// Builds api.
	beego.Router("/v1/builds/new", &controllers.ApiController{}, "post:NewBuild")
	beego.Router("/v1/builds/all", &controllers.ApiController{}, "get:GetBuildsAll")
	beego.Router("/v1/builds/all/project/:projectName", &controllers.ApiController{}, "get:GetBuildsWithProjectName")
	beego.Router("/v1/builds/:buildId", &controllers.ApiController{}, "get:GetBuild")
	beego.Router("/v1/builds/active", &controllers.ApiController{}, "get:GetActiveBuilds")
	beego.Router("/v1/builds/search", &controllers.ApiController{}, "get:GetSearchBuilds")
	beego.Router("/v1/builds/:buildId/logs/:index", &controllers.ApiController{}, "get:GetBuildLogsIndex")
	beego.Router("/v1/builds/:buildId/logs/all", &controllers.ApiController{}, "get:GetBuildLogsAll")

	// Projects api.
	beego.Router("/v1/projects/new", &controllers.ApiController{}, "post:NewProject")
	beego.Router("/v1/projects/all", &controllers.ApiController{}, "get:GetProjectsAll")
	beego.Router("/v1/projects/:projectId", &controllers.ApiController{}, "get:GetProject")
	beego.Router("/v1/projects/:projectId", &controllers.ApiController{}, "delete:DeleteProjectAndBuilds")

	// Workers api.
	beego.Router("/v1/workers/all", &controllers.ApiController{}, "get:GetWorkersAll")
	// TODO(tobe): this is not really RESTful
	beego.Router("/v1/workers/all/status/:status", &controllers.ApiController{}, "get:GetWorkersAllStatus")

	// account api.
	beego.Router("/v1/account/info", &controllers.ApiController{}, "get:GetAccountInfo")
	beego.Router("/v1/account/projects", &controllers.ApiController{}, "get:GetAccountProjects")
	beego.Router("/v1/account/token", &controllers.ApiController{}, "get:GetAccountToken")
	beego.Router("/v1/account/organizations", &controllers.ApiController{}, "get:GetAccountOrganizations")

	// Hooks api.
	beego.Router("/v1/hook/github/push", &controllers.ApiController{}, "post:TriggerGithubPushHook")
	beego.Router("/v1/hook/gitlab/push", &controllers.ApiController{}, "post:TriggerGitlabPushHook")

	// Badge api.
	beego.Router("/v1/badge/:projectId", &controllers.ApiController{}, "get:GetProjectBadge")
	beego.Router("/v1/badge/:projectId/url", &controllers.ApiController{}, "get:GetProjectBadgeUrl")
	beego.Router("/v1/badge/:projectId/markdown", &controllers.ApiController{}, "get:GetProjectBadgeMarkdown")
}
799703
func (p LogicalUnionScan) Init(ctx sessionctx.Context) *LogicalUnionScan {
	p.baseLogicalPlan = newBaseLogicalPlan(ctx, TypeUnionScan, &p)
	return &p
}
714402
func (s *globalTaskService) Init(ctx types.Context, config gofig.Config) error {
	s.tasks = map[int]*task{}
	s.config = config

	s.resultSchemaValidationEnabled = config.GetBool(
		types.ConfigSchemaResponseValidationEnabled)
	ctx.WithField("enabled", s.resultSchemaValidationEnabled).Debug(
		"configured result schema validation")

	return nil
}
956397
func (c *ConnWriter) Init(config map[string]interface{}) error {
	conf, err := json.Marshal(config)
	if err != nil {
		return err
	}
	return json.Unmarshal(conf, c)
}
833485
func (d *FakeStateDriver) Init(instInfo *core.InstanceInfo) error {
	d.TestState = make(map[string]valueData)

	return nil
}
1086690
func init() {
	AddInitEventHandler(func(typeOf Event, value interface{}) (responseOf EventResponse) {
		if typeOf == REVEL_BEFORE_MODULES_LOADED {
			RegisterTemplateLoader(GO_TEMPLATE, func(loader *TemplateLoader) (TemplateEngine, error) {
				// Set the template delimiters for the project if present, then split into left
				// and right delimiters around a space character

				TemplateDelims := Config.StringDefault("template.go.delimiters", "")
				var splitDelims []string
				if TemplateDelims != "" {
					splitDelims = strings.Split(TemplateDelims, " ")
					if len(splitDelims) != 2 {
						log.Fatalln("app.conf: Incorrect format for template.delimiters")
					}
				}

				return &GoEngine{
					loader:          loader,
					templateSet:     template.New("__root__").Funcs(TemplateFuncs),
					templatesByName: map[string]*GoTemplate{},
					splitDelims:     splitDelims,
				}, nil
			})
		}
		return
	})
}
412943
func init() {
	var err error
	fm := template.FuncMap{
		"tabs":     Tabs,
		"slice":    toSlice,
		"oneof":    oneof,
		"constant": constant,
		"goifyAtt": GoifyAtt,
		"add":      Add,
	}
	if enumValT, err = template.New("enum").Funcs(fm).Parse(enumValTmpl); err != nil {
		panic(err)
	}
	if formatValT, err = template.New("format").Funcs(fm).Parse(formatValTmpl); err != nil {
		panic(err)
	}
	if patternValT, err = template.New("pattern").Funcs(fm).Parse(patternValTmpl); err != nil {
		panic(err)
	}
	if minMaxValT, err = template.New("minMax").Funcs(fm).Parse(minMaxValTmpl); err != nil {
		panic(err)
	}
	if lengthValT, err = template.New("length").Funcs(fm).Parse(lengthValTmpl); err != nil {
		panic(err)
	}
	if requiredValT, err = template.New("required").Funcs(fm).Parse(requiredValTmpl); err != nil {
		panic(err)
	}
}
1074999
func (m *Module) Init(c *service.Config) {
	c.Setup = func() error {
		m.BaseAuthenticator = m
		return nil
	}
}
548950
func (c *showControllerCommand) Init(args []string) (err error) {
	c.controllerNames = args
	return nil
}
327267
func (pTypeDef *MapTest) Init() *MapTest {
	if pTypeDef.Locations == nil {
		pTypeDef.Locations = make(map[string]int32)
	}
	return pTypeDef
}