// init is used to setup the client resolver state
963076
func (c *clientACLResolver) init() error {
	// Create the ACL object cache
	var err error
	c.aclCache, err = lru.New2Q(aclCacheSize)
	if err != nil {
		return err
	}
	c.policyCache, err = lru.New2Q(policyCacheSize)
	if err != nil {
		return err
	}
	c.tokenCache, err = lru.New2Q(tokenCacheSize)
	if err != nil {
		return err
	}
	return nil
}
53109
func (c *Config) Init() error {
	c.Keymap = make(map[string]string)
	c.InitialMatcher = IgnoreCaseMatch
	c.Style.Init()
	c.Prompt = "QUERY>"
	c.Layout = LayoutTypeTopDown
	return nil
}
866828
func (mr *MockRPCClientMockRecorder) Init() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockRPCClient)(nil).Init))
}
726733
func (t *tenantServiceImpl) Init(ctx context.Context) error {
	c, err := t.createClientWithContextSigner(ctx)
	if err != nil {
		return err
	}

	// Ignore response for now
	response, err := c.SetupTenant(goasupport.ForwardContextRequestID(ctx), tenant.SetupTenantPath())
	if err == nil {
		defer rest.CloseResponse(response)
	}

	return err
}
746963
func Init(handler cfg.Handler) error {
	std = New(handler)
	return std.Init()
}
840460
func (m *Module) Init(c *service.Config) {
	c.Setup = func() error {
		m.HTTPRouter = httprouter.New()
		m.ErrorHandler = func(rw http.ResponseWriter, req *http.Request, err error) {
			_ = m.HandleError(rw, req, err)
		}
		m.ErrorPage = func(rw http.ResponseWriter, req *http.Request, status int) {
			http.Error(rw, fmt.Sprint(status), status)
		}

		// root handler
		m.Root = http.NewServeMux()
		m.Root.Handle("/", m.HTTPRouter)
		m.Middleware = middleware.NewServer(m.Root.ServeHTTP)
		m.Config.ReadConfig(&m.config)
		return nil
	}

	c.Start = func() {
		laddr := m.laddr()
		m.Logger.Infof("listening on %s", laddr)
		m.server = &http.Server{Addr: laddr, Handler: m.Middleware}
		go m.server.ListenAndServe()
	}

	c.Stop = func() {
		m.Shutdown(context.Background())
	}
}
871220
func (e *DefaultEndorsement) Init(dependencies ...Dependency) error {
	for _, dep := range dependencies {
		sIDFetcher, isSigningIdentityFetcher := dep.(SigningIdentityFetcher)
		if !isSigningIdentityFetcher {
			continue
		}
		e.SigningIdentityFetcher = sIDFetcher
		return nil
	}
	return errors.New("could not find SigningIdentityFetcher in dependencies")
}
1011976
func (p *MyPlugin) Init() error {
	p.Log.Debug("Registering handler..")

	p.REST.RegisterHTTPHandler("/greeting", p.fooHandler, "POST")

	return nil
}
1267907
func (p *Plugin) Init() error {
	// write initial status data into ETCD
	p.agentStat = &status.AgentStatus{
		State:        status.OperationalState_INIT,
		BuildVersion: agent.BuildVersion,
		BuildDate:    agent.BuildDate,
		CommitHash:   agent.CommitHash,
		StartTime:    time.Now().Unix(),
		LastChange:   time.Now().Unix(),
	}

	// initial empty interface status
	p.interfaceStat = &status.InterfaceStats{}

	// init pluginStat map
	p.pluginStat = make(map[string]*status.PluginStatus)

	// init map with plugin state probes
	p.pluginProbe = make(map[string]PluginStateProbe)

	// prepare context for all go routines
	p.ctx, p.cancel = context.WithCancel(context.Background())

	return nil
}
202216
func (s *Server) Init() {
	s.mux = http.NewServeMux()

	// Register local handlers
	s.RegisterHandler(s, diagPaths2Func)
}
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)
}
1031200
func Init(storeDriver string, storeURLs []string) error {
	var err error

	// Create an objdb client
	ObjdbClient, err = objdb.InitClient(storeDriver, storeURLs)

	return err
}
447619
func (f *fen) Init() (err error) {
	f.p, err = f.cf.portCreate()
	return
}
663725
func init() {
	DefaultCallback.Query().Register("gorm:query", queryCallback)
	DefaultCallback.Query().Register("gorm:preload", preloadCallback)
	DefaultCallback.Query().Register("gorm:after_query", afterQueryCallback)
}
777489
func (p *ExamplePlugin) Init() error {
	p.Log.Info("Registering greeter")

	helloworld.RegisterGreeterServer(p.GRPC.GetServer(), &GreeterService{})

	return nil
}
219623
func (c *clientIdentityImpl) init() error {
	signingID, err := c.getIdentity()
	if err != nil {
		return err
	}
	c.mspID = signingID.GetMspid()
	idbytes := signingID.GetIdBytes()
	block, _ := pem.Decode(idbytes)
	if block == nil {
		err := c.getAttributesFromIdemix()
		if err != nil {
			return errors.WithMessage(err, "identity bytes are neither X509 PEM format nor an idemix credential")
		}
		return nil
	}
	cert, err := x509.ParseCertificate(block.Bytes)
	if err != nil {
		return errors.WithMessage(err, "failed to parse certificate")
	}
	c.cert = cert
	attrs, err := attrmgr.New().GetAttributesFromCert(cert)
	if err != nil {
		return errors.WithMessage(err, "failed to get attributes from the transaction invoker's certificate")
	}
	c.attrs = attrs
	return nil
}
320980
func (fw *FirewallSSO) init(ctx context.Context) error {
	for _, net := range fw.Networks {
		err := net.init(ctx)
		if err != nil {
			return err
		}
	}
	return nil
}