本文整理汇总了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)
}
示例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)
}
示例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)
}
示例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)
}
示例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() }))
}
示例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")
}
示例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)
}
示例8: init
func init() {
tabletmanager.RegisterQueryServices = append(tabletmanager.RegisterQueryServices, func(agent *tabletmanager.ActionAgent) {
rpcwrap.RegisterAuthenticated(&TabletManager{agent})
})
}
示例9: StartServer
// StartServer registers the Server for RPCs
func StartServer(ts topo.Server) {
rpcwrap.RegisterAuthenticated(&VtctlServer{ts})
}
示例10: RegisterAuthenticated
// RegisterAuthenticated registers the server.
func RegisterAuthenticated(barnacle Barnacle) {
rpcwrap.RegisterAuthenticated(barnacle)
}
示例11: init
func init() {
vtgate.RegisterVTGates = append(vtgate.RegisterVTGates, func(vtGate *vtgate.VTGate) {
rpcwrap.RegisterAuthenticated(&VTGate{vtGate})
})
}
示例12: RegisterBinlogServerService
// RegisterBinlogServerService registers the service for serving and stats.
func RegisterBinlogServerService(blServer *BinlogServer) {
rpcwrap.RegisterAuthenticated(blServer)
}
示例13: init
func init() {
binlog.RegisterUpdateStreamServices = append(binlog.RegisterUpdateStreamServices, func(updateStream *binlog.UpdateStream) {
rpcwrap.RegisterAuthenticated(&UpdateStream{updateStream})
})
}
示例14: RegisterAuthenticated
// RegisterAuthenticated registers the server.
func RegisterAuthenticated(vtgate VTGate) {
rpcwrap.RegisterAuthenticated(vtgate)
}
示例15: init
func init() {
tabletserver.SqlQueryRegisterFunctions = append(tabletserver.SqlQueryRegisterFunctions, func(sq *tabletserver.SqlQuery) {
rpcwrap.RegisterAuthenticated(&SqlQuery{sq})
})
}