本文整理匯總了Golang中github.com/docker/libnetwork.Sandbox.ID方法的典型用法代碼示例。如果您正苦於以下問題:Golang Sandbox.ID方法的具體用法?Golang Sandbox.ID怎麽用?Golang Sandbox.ID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/docker/libnetwork.Sandbox
的用法示例。
在下文中一共展示了Sandbox.ID方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: buildSandboxResource
func buildSandboxResource(sb libnetwork.Sandbox) *sandboxResource {
r := &sandboxResource{}
if sb != nil {
r.ID = sb.ID()
r.Key = sb.Key()
r.ContainerID = sb.ContainerID()
}
return r
}
示例2: Join
// Join creates a new sandbox for the given container ID and populates the
// network resources allocated for the endpoint and joins the sandbox to
// the endpoint. It returns the sandbox key to the caller
func (e *remoteEndpoint) Join(sandbox libnetwork.Sandbox, options ...libnetwork.EndpointOption) error {
url := path.Join("/networks", e.networkID, "endpoints", e.er.ID, "containers")
//TODO: process options somehow
join := endpointJoin{
SandboxID: sandbox.ID(),
}
sk := ""
return e.rc.httpPost(url, join, &sk)
}
示例3: updateSandboxNetworkSettings
func (container *Container) updateSandboxNetworkSettings(sb libnetwork.Sandbox) error {
container.NetworkSettings.SandboxID = sb.ID()
container.NetworkSettings.SandboxKey = sb.Key()
return nil
}