當前位置: 首頁>>代碼示例>>Golang>>正文


Golang config.Config類代碼示例

本文整理匯總了Golang中github.com/joernweissenborn/aurarath/config.Config的典型用法代碼示例。如果您正苦於以下問題:Golang Config類的具體用法?Golang Config怎麽用?Golang Config使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Config類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: NewImport

func NewImport(a *servicedescriptor.ServiceDescriptor, cfg *config.Config) (i *Import) {
	i = new(Import)
	i.Service = service.NewService(a, service.IMPORTING, cfg, []byte{0})
	i.logger = log.New(cfg.Logger(), fmt.Sprintf("export %s ", i.UUID()), log.Lshortfile)
	i.Connected().Then(i.onConnected)
	i.NewServiceConnections().Listen(i.sendListenFunctions)
	i.results = i.Messages(messages.RESULT)
	return
}
開發者ID:joernweissenborn,項目名稱:aursir4go,代碼行數:9,代碼來源:import.go

示例2: NewExport

func NewExport(a *appdescriptor.AppDescriptor, cfg *config.Config) (e *Export) {
	e = new(Export)
	e.Service = service.NewService(a, service.EXPORTING, cfg, []byte{0})
	e.logger = log.New(cfg.Logger(), fmt.Sprintf("export %s ", e.UUID()), log.Lshortfile)
	e.requests = e.Messages(messages.REQUEST)
	e.listeners = map[string][]string{}
	e.r = eventual2go.NewReactor()
	e.r.React("listen", e.newListener)
	e.r.AddStream("listen", e.IncomingMessages(messages.LISTEN))
	e.r.React("listen_stop", e.stopListener)
	e.r.AddStream("listen", e.IncomingMessages(messages.STOP_LISTEN))
	e.r.React("reply", e.deliverResult)
	return
}
開發者ID:AurSir,項目名稱:aurarath,代碼行數:14,代碼來源:export.go

示例3: NewAnnouncer

func NewAnnouncer(uuid string, servicetype string, desc *servicedescriptor.ServiceDescriptor, cfg *config.Config, ports []int) (a *Announcer) {

	a = &Announcer{
		announced:   eventual2go.NewCompleter(),
		clientPorts: map[string]int{},
		logger:      log.New(cfg.Logger(), fmt.Sprintf("announcer %s ", uuid), log.Lshortfile),
		new:         eventual2go.NewStreamController(),
		node:        node.New(uuid, cfg, desc.AsTagSet()),
		servicetype: servicetype,
	}

	a.setPorts(cfg, ports)

	a.initReactor()

	return
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:17,代碼來源:announcer.go

示例4: 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
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:38,代碼來源:service.go

示例5: New

func New(uuid string, cfg *config.Config, tags map[string]string) (node *Node) {

	node = new(Node)
	node.logger = log.New(cfg.Logger(), fmt.Sprintf("node %s ", uuid), log.Lshortfile)

	node.logger.Println("Initializing")

	node.cfg = cfg
	node.tags = tags

	node.UUID = uuid
	node.beacons = []*beacon.Beacon{}
	node.logger.Println("Launching Serf Agents")

	node.join = eventual2go.NewStreamController()
	node.join.First().Then(node.silenceBeacons)
	node.leave = eventual2go.NewStreamController()
	node.query = eventual2go.NewStreamController()

	node.createSerfAgents()

	return node
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:23,代碼來源:node.go


注:本文中的github.com/joernweissenborn/aurarath/config.Config類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。