当前位置: 首页>>代码示例>>Golang>>正文


Golang rpcwrap.RegisterAuthenticated函数代码示例

本文整理汇总了Golang中github.com/youtube/vitess/go/rpcwrap.RegisterAuthenticated函数的典型用法代码示例。如果您正苦于以下问题:Golang RegisterAuthenticated函数的具体用法?Golang RegisterAuthenticated怎么用?Golang RegisterAuthenticated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RegisterAuthenticated函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: main

func main() {
	dbConfigsFile, dbCredentialsFile := dbconfigs.RegisterCommonFlags()
	flag.Parse()
	servenv.Init()

	if *mycnfFile == "" {
		log.Fatalf("Please specify the path for mycnf file.")
	}
	mycnf, err := mysqlctl.ReadMycnf(*mycnfFile)
	if err != nil {
		log.Fatalf("Error reading mycnf file %v", *mycnfFile)
	}
	dbcfgs, err := dbconfigs.Init(mycnf.SocketFile, *dbConfigsFile, *dbCredentialsFile)
	if err != nil {
		log.Warning(err)
	}
	mysqld := mysqlctl.NewMysqld(mycnf, dbcfgs.Dba, dbcfgs.Repl)

	binlogServer := mysqlctl.NewBinlogServer(mysqld)
	mysqlctl.EnableBinlogServerService(binlogServer, *dbname)

	proto.RegisterBinlogServer(binlogServer)
	rpcwrap.RegisterAuthenticated(binlogServer)
	servenv.OnClose(func() {
		mysqlctl.DisableBinlogServerService(binlogServer)
	})
	servenv.Run(*port)
}
开发者ID:CERN-Stage-3,项目名称:vitess,代码行数:28,代码来源:vt_binlog_server.go

示例2: registerBsonQueryService

func registerBsonQueryService(agent *tabletmanager.ActionAgent) {
	if TabletManagerGoRpcService != nil {
		log.Warningf("RPC service already up %v", TabletManagerGoRpcService)
		return
	}
	TabletManagerGoRpcService = &TabletManager{agent}
	rpcwrap.RegisterAuthenticated(TabletManagerGoRpcService)
}
开发者ID:rjammala,项目名称:vitess,代码行数:8,代码来源:gorpc_server.go

示例3: RegisterQueryService

func (agent *ActionAgent) RegisterQueryService(mysqld *mysqlctl.Mysqld) {
	if TabletManagerRpcService != nil {
		log.Warningf("RPC service already up %v", TabletManagerRpcService)
		return
	}
	TabletManagerRpcService = &TabletManager{agent, mysqld}
	rpcwrap.RegisterAuthenticated(TabletManagerRpcService)
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:8,代码来源:rpc.go

示例4: RegisterUpdateStreamService

func RegisterUpdateStreamService(mycnf *Mycnf) {
	if UpdateStreamRpcService != nil {
		//log.Warningf("Update Stream service already initialized")
		return
	}

	UpdateStreamRpcService = &UpdateStream{mycnf: mycnf}
	UpdateStreamRpcService.states = stats.NewStates("UpdateStreamState", []string{
		"Disabled",
		"Enabled",
	}, time.Now(), DISABLED)
	rpcwrap.RegisterAuthenticated(UpdateStreamRpcService)
}
开发者ID:CERN-Stage-3,项目名称:vitess,代码行数:13,代码来源:updatestreamctl.go

示例5: RegisterUpdateStreamService

func RegisterUpdateStreamService(mycnf *Mycnf) {
	if UpdateStreamRpcService != nil {
		//relog.Warning("Update Stream service already initialized")
		return
	}

	UpdateStreamRpcService = &UpdateStream{mycnf: mycnf}
	UpdateStreamRpcService.states = estats.NewStates("", []string{
		"Disabled",
		"Enabled",
	}, time.Now(), DISABLED)
	rpcwrap.RegisterAuthenticated(UpdateStreamRpcService)
	expvar.Publish("UpdateStreamRpcService", estats.StrFunc(func() string { return UpdateStreamRpcService.statsJSON() }))
}
开发者ID:shrutip,项目名称:vitess,代码行数:14,代码来源:updatestreamctl.go

示例6: main

func main() {
	flag.Parse()
	servenv.Init("vt_binlog_server")

	binlogServer := new(BinlogServer)
	if *mycnfFile == "" {
		relog.Fatal("Please specify the path for mycnf file.")
	}
	mycnf, err := mysqlctl.ReadMycnf(*mycnfFile)
	if err != nil {
		relog.Fatal("Error reading mycnf file %v", *mycnfFile)
	}
	binlogServer.mycnf = mycnf

	binlogServer.dbname = strings.ToLower(strings.TrimSpace(*dbname))
	binlogServer.blpStats = NewBlpStats()

	rpc.Register(binlogServer)
	rpcwrap.RegisterAuthenticated(binlogServer)
	//bsonrpc.ServeAuthRPC()

	rpc.HandleHTTP()
	bsonrpc.ServeHTTP()
	bsonrpc.ServeRPC()

	umgmt.SetLameDuckPeriod(30.0)
	umgmt.SetRebindDelay(0.01)
	umgmt.AddStartupCallback(func() {
		umgmt.StartHttpServer(fmt.Sprintf(":%v", *port))
	})
	umgmt.AddStartupCallback(func() {
		c := make(chan os.Signal, 1)
		signal.Notify(c, syscall.SIGTERM)
		go func() {
			for sig := range c {
				umgmt.SigTermHandler(sig)
			}
		}()
	})

	relog.Info("vt_binlog_server registered at port %v", *port)
	umgmtSocket := fmt.Sprintf("/tmp/vt_binlog_server-%08x-umgmt.sock", *port)
	if umgmtErr := umgmt.ListenAndServe(umgmtSocket); umgmtErr != nil {
		relog.Error("umgmt.ListenAndServe err: %v", umgmtErr)
	}
	relog.Info("done")
}
开发者ID:shrutip,项目名称:vitess,代码行数:47,代码来源:vt_binlog_server.go

示例7: main

func main() {
	flag.Parse()
	servenv.Init()
	defer servenv.Close()

	if *mycnfFile == "" {
		log.Fatalf("Please specify the path for mycnf file.")
	}
	mycnf, err := mysqlctl.ReadMycnf(*mycnfFile)
	if err != nil {
		log.Fatalf("Error reading mycnf file %v", *mycnfFile)
	}

	binlogServer := mysqlctl.NewBinlogServer(mycnf)
	mysqlctl.EnableBinlogServerService(binlogServer, *dbname)

	proto.RegisterBinlogServer(binlogServer)
	rpcwrap.RegisterAuthenticated(binlogServer)

	servenv.ServeRPC()

	proc.ListenAndServe(fmt.Sprintf("%v", *port))
	mysqlctl.DisableBinlogServerService(binlogServer)
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:24,代码来源:vt_binlog_server.go

示例8: init

func init() {
	tabletmanager.RegisterQueryServices = append(tabletmanager.RegisterQueryServices, func(agent *tabletmanager.ActionAgent) {
		rpcwrap.RegisterAuthenticated(&TabletManager{agent})
	})
}
开发者ID:nimishzynga,项目名称:vitess,代码行数:5,代码来源:gorpc_server.go

示例9: StartServer

// StartServer registers the Server for RPCs
func StartServer(ts topo.Server) {
	rpcwrap.RegisterAuthenticated(&VtctlServer{ts})
}
开发者ID:nangong92t,项目名称:go_src,代码行数:4,代码来源:server.go

示例10: RegisterAuthenticated

// RegisterAuthenticated registers the server.
func RegisterAuthenticated(barnacle Barnacle) {
	rpcwrap.RegisterAuthenticated(barnacle)
}
开发者ID:CERN-Stage-3,项目名称:vitess,代码行数:4,代码来源:vtgate_proto.go

示例11: init

func init() {
	vtgate.RegisterVTGates = append(vtgate.RegisterVTGates, func(vtGate *vtgate.VTGate) {
		rpcwrap.RegisterAuthenticated(&VTGate{vtGate})
	})
}
开发者ID:qinbo,项目名称:vitess,代码行数:5,代码来源:server.go

示例12: RegisterBinlogServerService

// RegisterBinlogServerService registers the service for serving and stats.
func RegisterBinlogServerService(blServer *BinlogServer) {
	rpcwrap.RegisterAuthenticated(blServer)
}
开发者ID:CERN-Stage-3,项目名称:vitess,代码行数:4,代码来源:binlog_server.go

示例13: init

func init() {
	binlog.RegisterUpdateStreamServices = append(binlog.RegisterUpdateStreamServices, func(updateStream *binlog.UpdateStream) {
		rpcwrap.RegisterAuthenticated(&UpdateStream{updateStream})
	})
}
开发者ID:chinna1986,项目名称:vitess,代码行数:5,代码来源:streamer.go

示例14: RegisterAuthenticated

// RegisterAuthenticated registers the server.
func RegisterAuthenticated(vtgate VTGate) {
	rpcwrap.RegisterAuthenticated(vtgate)
}
开发者ID:rjammala,项目名称:vitess,代码行数:4,代码来源:vtgate_proto.go

示例15: init

func init() {
	tabletserver.SqlQueryRegisterFunctions = append(tabletserver.SqlQueryRegisterFunctions, func(sq *tabletserver.SqlQuery) {
		rpcwrap.RegisterAuthenticated(&SqlQuery{sq})
	})
}
开发者ID:nangong92t,项目名称:go_src,代码行数:5,代码来源:sqlquery.go


注:本文中的github.com/youtube/vitess/go/rpcwrap.RegisterAuthenticated函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。