本文整理匯總了Golang中github.com/joernweissenborn/aurarath/config.Config.UUID方法的典型用法代碼示例。如果您正苦於以下問題:Golang Config.UUID方法的具體用法?Golang Config.UUID怎麽用?Golang Config.UUID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/joernweissenborn/aurarath/config.Config
的用法示例。
在下文中一共展示了Config.UUID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewService
func NewService(dsc *servicedescriptor.ServiceDescriptor, servicetype string, cfg *config.Config, codecs []byte) (s *Service) {
s = new(Service)
if cfg.UUID == "" {
id, _ := uid.NewV4()
cfg.UUID = id.String()
}
s.uuid = cfg.UUID
s.logger = log.New(cfg.Logger(), fmt.Sprintf("service %s ", s.uuid), log.Lshortfile)
s.serviceDescriptor = dsc
s.logger.Println("ServiceDesctiptor TagsSet is", dsc.AsTagSet())
s.servicetype = servicetype
s.codecs = codecs
s.newpeers = eventual2go.NewStreamController()
s.gonepeers = eventual2go.NewStreamController()
s.incoming = map[string]*connection.Incoming{}
s.in = eventual2go.NewStreamController()
s.connectedServices = map[string]*ServiceConnection{}
s.connected = eventual2go.NewCompleter()
s.disconnected = eventual2go.NewCompleter()
s.remove = eventual2go.NewCompleter()
s.r = eventual2go.NewReactor()
s.r.React("service_arrived", s.serviceArrived)
s.r.React("service_gone", s.serviceGone)
s.r.React("announce_finish", s.announced)
s.r.React("service_shake_hand", s.serviceHandshake)
s.r.AddStream("service_shake_hand", s.in.Where(messages.Is(messages.HELLO)))
s.r.React("service_shake_hand_reply", s.serviceHandShakeReply)
s.r.AddStream("service_shake_hand_reply", s.in.Where(messages.Is(messages.HELLO_OK)))
s.createIncoming(cfg)
s.createAnnouncer(cfg)
return
}