当前位置: 首页>>代码示例>>Golang>>正文


Golang project.DefaultDependentServices函数代码示例

本文整理汇总了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
}
开发者ID:vdemeester,项目名称:rancher-compose,代码行数:11,代码来源:utils.go

示例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
}
开发者ID:vdemeester,项目名称:rancher-compose,代码行数:10,代码来源:sidekick.go

示例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
}
开发者ID:wlan0,项目名称:rancher-compose-executor,代码行数:12,代码来源:service.go

示例4: DependentServices

func (s *Service) DependentServices() []project.ServiceRelationship {
	return project.DefaultDependentServices(s.context.Project, s)
}
开发者ID:nickschuch,项目名称:up,代码行数:3,代码来源:service.go


注:本文中的github.com/docker/libcompose/project.DefaultDependentServices函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。