本文整理汇总了Golang中launchpad/net/juju-core/state.Service.IsExposed方法的典型用法代码示例。如果您正苦于以下问题:Golang Service.IsExposed方法的具体用法?Golang Service.IsExposed怎么用?Golang Service.IsExposed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类launchpad/net/juju-core/state.Service
的用法示例。
在下文中一共展示了Service.IsExposed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: startService
// startService creates a new data value for tracking details of the
// service and starts watching the service for exposure changes.
func (fw *Firewaller) startService(service *state.Service) error {
serviced := &serviceData{
fw: fw,
service: service,
exposed: service.IsExposed(),
unitds: make(map[string]*unitData),
}
fw.serviceds[service.Name()] = serviced
go serviced.watchLoop(serviced.exposed)
return nil
}
示例2: processService
func (context *statusContext) processService(service *state.Service) (status serviceStatus) {
url, _ := service.CharmURL()
status.Charm = url.String()
status.Exposed = service.IsExposed()
status.Life = processLife(service)
var err error
status.Relations, status.SubordinateTo, err = context.processRelations(service)
if err != nil {
status.Err = err
return
}
if service.IsPrincipal() {
status.Units = context.processUnits(context.units[service.Name()])
}
return status
}
示例3: processService
func processService(service *state.Service) (map[string]interface{}, error) {
r := m()
ch, _, err := service.Charm()
if err != nil {
return nil, err
}
r["charm"] = ch.String()
r["exposed"] = service.IsExposed()
// TODO(dfc) service.IsSubordinate() ?
units, err := service.AllUnits()
if err != nil {
return nil, err
}
u := checkError(processUnits(units))
if len(u) > 0 {
r["units"] = u
}
// TODO(dfc) process relations
return r, nil
}