本文整理汇总了Golang中github.com/coreos/fleet/config.Config.Metadata方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.Metadata方法的具体用法?Golang Config.Metadata怎么用?Golang Config.Metadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/coreos/fleet/config.Config
的用法示例。
在下文中一共展示了Config.Metadata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: New
func New(cfg config.Config) *Server {
m := machine.New(cfg.BootId, cfg.PublicIP, cfg.Metadata())
m.RefreshState()
regClient := etcd.NewClient(cfg.EtcdServers)
regClient.SetConsistency(etcd.STRONG_CONSISTENCY)
r := registry.New(regClient)
eb := event.NewEventBus()
eb.Listen()
eventClient := etcd.NewClient(cfg.EtcdServers)
eventClient.SetConsistency(etcd.STRONG_CONSISTENCY)
es := registry.NewEventStream(eventClient)
a, err := agent.New(r, eb, m, cfg.AgentTTL, cfg.UnitPrefix)
if err != nil {
//TODO: return this as an error object rather than panicking
panic(err)
}
e := engine.New(r, eb, m)
return &Server{a, e, m, r, eb, es}
}
示例2: New
func New(cfg config.Config) *Server {
m := machine.New(cfg.BootId, cfg.PublicIP, cfg.Metadata())
m.RefreshState()
regClient := etcd.NewClient(cfg.EtcdServers)
regClient.SetConsistency(etcd.STRONG_CONSISTENCY)
r := registry.New(regClient)
eb := event.NewEventBus()
eb.Listen()
eventClient := etcd.NewClient(cfg.EtcdServers)
eventClient.SetConsistency(etcd.STRONG_CONSISTENCY)
es := registry.NewEventStream(eventClient, r)
var verifier *sign.SignatureVerifier
if cfg.VerifyUnits {
var err error
verifier, err = sign.NewSignatureVerifierFromAuthorizedKeysFile(cfg.AuthorizedKeysFile)
if err != nil {
log.Errorln("Failed to get any key from authorized key file in verify_units mode:", err)
verifier = sign.NewSignatureVerifier()
}
}
a, err := agent.New(r, eb, m, cfg.AgentTTL, cfg.UnitPrefix, verifier)
if err != nil {
//TODO: return this as an error object rather than panicking
panic(err)
}
e := engine.New(r, eb, m)
return &Server{a, e, m, r, eb, es}
}
示例3: newMachineFromConfig
func newMachineFromConfig(cfg config.Config) (*machine.CoreOSMachine, error) {
state := machine.MachineState{
PublicIP: cfg.PublicIP,
Metadata: cfg.Metadata(),
Version: version.Version,
}
mach := machine.NewCoreOSMachine(state)
mach.Refresh()
if mach.State().ID == "" {
return nil, errors.New("unable to determine local machine ID")
}
return mach, nil
}