mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-05-14 10:33:46 +00:00
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers
Signed-off-by: Alessandro Boch <aboch@docker.com>
79 lines
2.4 KiB
Go
79 lines
2.4 KiB
Go
package client
|
|
|
|
import "github.com/docker/libnetwork/types"
|
|
|
|
/***********
|
|
Resources
|
|
************/
|
|
|
|
// networkResource is the body of the "get network" http response message
|
|
type networkResource struct {
|
|
Name string `json:"name"`
|
|
ID string `json:"id"`
|
|
Type string `json:"type"`
|
|
Services []*serviceResource `json:"services"`
|
|
}
|
|
|
|
// serviceResource is the body of the "get service" http response message
|
|
type serviceResource struct {
|
|
Name string `json:"name"`
|
|
ID string `json:"id"`
|
|
Network string `json:"network"`
|
|
}
|
|
|
|
// sandboxResource is the body of "get service backend" response message
|
|
type sandboxResource struct {
|
|
ID string `json:"id"`
|
|
Key string `json:"key"`
|
|
ContainerID string `json:"container_id"`
|
|
}
|
|
|
|
/***********
|
|
Body types
|
|
************/
|
|
|
|
// networkCreate is the expected body of the "create network" http request message
|
|
type networkCreate struct {
|
|
Name string `json:"name"`
|
|
NetworkType string `json:"network_type"`
|
|
Options map[string]interface{} `json:"options"`
|
|
}
|
|
|
|
// serviceCreate represents the body of the "publish service" http request message
|
|
type serviceCreate struct {
|
|
Name string `json:"name"`
|
|
Network string `json:"network_name"`
|
|
ExposedPorts []types.TransportPort `json:"exposed_ports"`
|
|
PortMapping []types.PortBinding `json:"port_mapping"`
|
|
}
|
|
|
|
// serviceAttach represents the expected body of the "attach/detach sandbox to/from service" http request messages
|
|
type serviceAttach struct {
|
|
SandboxID string `json:"sandbox_id"`
|
|
}
|
|
|
|
type sandboxCreate struct {
|
|
ContainerID string `json:"container_id"`
|
|
HostName string `json:"host_name"`
|
|
DomainName string `json:"domain_name"`
|
|
HostsPath string `json:"hosts_path"`
|
|
ResolvConfPath string `json:"resolv_conf_path"`
|
|
DNS []string `json:"dns"`
|
|
ExtraHosts []extraHost `json:"extra_hosts"`
|
|
UseDefaultSandbox bool `json:"use_default_sandbox"`
|
|
}
|
|
|
|
// extraHost represents the extra host object
|
|
type extraHost struct {
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
}
|
|
|
|
// sandboxParentUpdate is the object carrying the information about the
|
|
// sanbox parent that needs to be updated
|
|
type sandboxParentUpdate struct {
|
|
ContainerID string `json:"container_id"`
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
}
|