本文整理匯總了Golang中github.com/citadel/citadel.Engine類的典型用法代碼示例。如果您正苦於以下問題:Golang Engine類的具體用法?Golang Engine怎麽用?Golang Engine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Engine類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Schedule
func (u *UniqueScheduler) Schedule(c *citadel.Image, e *citadel.Engine) (bool, error) {
containers, err := e.ListContainers(false, false, "")
if err != nil {
return false, err
}
if u.hasImage(c, containers) {
return false, nil
}
return true, nil
}
示例2: Schedule
func (s *PortScheduler) Schedule(i *citadel.Image, e *citadel.Engine) (bool, error) {
containers, err := e.ListContainers(false, false, "")
if err != nil {
return false, err
}
if s.hasConflictingPorts(i.BindPorts, containers) {
return false, nil
}
return true, nil
}
示例3: setEngineClient
func setEngineClient(docker *citadel.Engine, tlsConfig *tls.Config) error {
var tc *tls.Config
u, err := url.Parse(docker.Addr)
if err != nil {
return err
}
if u.Scheme == "https" {
tc = tlsConfig
}
return docker.Connect(tc)
}
示例4: Schedule
func (i *ImageScheduler) Schedule(c *citadel.Image, e *citadel.Engine) (bool, error) {
fullImage := c.Name
if !strings.Contains(fullImage, ":") {
fullImage = fmt.Sprintf("%s:latest", fullImage)
}
images, err := e.ListImages()
if err != nil {
return false, err
}
if i.containsImage(fullImage, images) {
return true, nil
}
return false, nil
}
示例5: setEngineClientAuth
func setEngineClientAuth(docker *citadel.Engine, username, password, email string) {
docker.SetClientAuth(username, password, email)
}