本文整理汇总了Golang中github.com/docker/libcompose/project.DefaultDependentServices函数的典型用法代码示例。如果您正苦于以下问题:Golang DefaultDependentServices函数的具体用法?Golang DefaultDependentServices怎么用?Golang DefaultDependentServices使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DefaultDependentServices函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DefaultDependentServices
// DefaultDependentServices return the dependent services (as an array of ServiceRelationship)
// for the specified project and service. It looks for : links, volumesFrom, net and ipc configuration.
// It uses default project implementation and append some docker specific ones.
func DefaultDependentServices(p *project.Project, s project.Service) []project.ServiceRelationship {
result := project.DefaultDependentServices(p, s)
result = appendNs(p, result, s.Config().NetworkMode, project.RelTypeNetNamespace)
result = appendNs(p, result, s.Config().Ipc, project.RelTypeIpcNamespace)
return result
}
示例2: DependentServices
func (s *Sidekick) DependentServices() []project.ServiceRelationship {
dependentServices := project.DefaultDependentServices(s.context.Project, s)
for i, dependentService := range dependentServices {
if dependentService.Type == project.RelTypeLink {
dependentServices[i].Optional = true
}
}
return dependentServices
}
示例3: DependentServices
func (r *RancherService) DependentServices() []project.ServiceRelationship {
result := []project.ServiceRelationship{}
for _, rel := range project.DefaultDependentServices(r.context.Project, r) {
if rel.Type == project.REL_TYPE_LINK {
rel.Optional = true
result = append(result, rel)
}
}
return result
}
示例4: DependentServices
func (s *Service) DependentServices() []project.ServiceRelationship {
return project.DefaultDependentServices(s.context.Project, s)
}