當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。