Documentation ¶
Index ¶
- Constants
- func ActivateLayer(info DriverInfo, id string) error
- func CopyLayer(info DriverInfo, srcId, dstId string, parentLayerPaths []string) error
- func CreateComputeSystem(id string, configuration string) error
- func CreateLayer(info DriverInfo, id, parent string) error
- func CreateProcessInComputeSystem(id string, useStdin bool, useStdout bool, useStderr bool, ...) (_ uint32, _ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err error)
- func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error
- func DeactivateLayer(info DriverInfo, id string) error
- func DestroyLayer(info DriverInfo, id string) error
- func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, ...) error
- func GetLayerMountPath(info DriverInfo, id string) (string, error)
- func GetSharedBaseImages() (imageData string, err error)
- func ImportLayer(info DriverInfo, layerId string, importFolderPath string, ...) error
- func LayerExists(info DriverInfo, id string) (bool, error)
- func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error
- func ResizeConsoleInComputeSystem(id string, processid uint32, h, w int) error
- func ShutdownComputeSystem(id string, timeout uint32, context string) error
- func StartComputeSystem(id string) error
- func TerminateComputeSystem(id string, timeout uint32, context string) error
- func TerminateProcessInComputeSystem(id string, processid uint32) (err error)
- func UnprepareLayer(info DriverInfo, layerId string) error
- func WaitForProcessInComputeSystem(id string, processid uint32, timeout uint32) (int32, error)
- type CreateProcessParams
- type DriverInfo
- type GUID
- type HNSEndpoint
- type HNSNetwork
- type HcsError
- type MacPool
- type NatPolicy
- type QosPolicy
- type Subnet
- type WC_LAYER_DESCRIPTOR
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ActivateLayer ¶
func ActivateLayer(info DriverInfo, id string) error
ActivateLayer will find the layer with the given id and mount it's filesystem. For a read/write layer, the mounted filesystem will appear as a volume on the host, while a read-only layer is generally expected to be a no-op. An activated layer must later be deactivated via DeactivateLayer.
func CopyLayer ¶
func CopyLayer(info DriverInfo, srcId, dstId string, parentLayerPaths []string) error
CopyLayer performs a commit of the srcId (which is expected to be a read-write layer) into a new read-only layer at dstId. This requires the full list of on-disk paths to parent layers, provided in parentLayerPaths, in order to complete the commit.
func CreateComputeSystem ¶
CreateComputeSystem creates a container, initializing its configuration in the Host Compute Service such that it can be started by a call to the StartComputeSystem method.
func CreateLayer ¶
func CreateLayer(info DriverInfo, id, parent string) error
CreateLayer creates a new, empty, read-only layer on the filesystem based on the parent layer provided.
func CreateProcessInComputeSystem ¶
func CreateProcessInComputeSystem(id string, useStdin bool, useStdout bool, useStderr bool, params CreateProcessParams) (_ uint32, _ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err error)
CreateProcessInComputeSystem starts a process in a container. This is invoked, for example, as a result of docker run, docker exec, or RUN in Dockerfile. If successful, it returns the PID of the process.
func CreateSandboxLayer ¶
func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error
CreateSandboxLayer creates and populates new read-write layer for use by a container. This requires both the id of the direct parent layer, as well as the full list of paths to all parent layers up to the base (and including the direct parent whose id was provided).
func DeactivateLayer ¶
func DeactivateLayer(info DriverInfo, id string) error
DeactivateLayer will dismount a layer that was mounted via ActivateLayer.
func DestroyLayer ¶
func DestroyLayer(info DriverInfo, id string) error
DestroyLayer will remove the on-disk files representing the layer with the given id, including that layer's containing folder, if any.
func ExportLayer ¶
func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, parentLayerPaths []string) error
ExportLayer will create a folder at exportFolderPath and fill that folder with the transport format version of the layer identified by layerId. This transport format includes any metadata required for later importing the layer (using ImportLayer), and requires the full list of parent layer paths in order to perform the export.
func GetLayerMountPath ¶
func GetLayerMountPath(info DriverInfo, id string) (string, error)
GetLayerMountPath will look for a mounted layer with the given id and return the path at which that layer can be accessed. This path may be a volume path if the layer is a mounted read-write layer, otherwise it is expected to be the folder path at which the layer is stored.
func GetSharedBaseImages ¶
GetSharedBaseImages will enumerate the images stored in the common central image store and return descriptive info about those images for the purpose of registering them with the graphdriver, graph, and tagstore.
func ImportLayer ¶
func ImportLayer(info DriverInfo, layerId string, importFolderPath string, parentLayerPaths []string) error
ImportLayer will take the contents of the folder at importFolderPath and import that into a layer with the id layerId. Note that in order to correctly populate the layer and interperet the transport format, all parent layers must already be present on the system at the paths provided in parentLayerPaths.
func LayerExists ¶
func LayerExists(info DriverInfo, id string) (bool, error)
LayerExists will return true if a layer with the given id exists and is known to the system.
func PrepareLayer ¶
func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error
PrepareLayer finds a mounted read-write layer matching layerId and enables the the filesystem filter for use on that layer. This requires the paths to all parent layers, and is necessary in order to view or interact with the layer as an actual filesystem (reading and writing files, creating directories, etc). Disabling the filter must be done via UnprepareLayer.
func ResizeConsoleInComputeSystem ¶
ResizeConsoleInComputeSystem updates the height and width of the console session for the process with the given id in the container with the given id.
func ShutdownComputeSystem ¶
ShutdownComputeSystem shuts down a container by requesting a shutdown within the container operating system.
func StartComputeSystem ¶
StartComputeSystem starts a container that has previously been created via CreateComputeSystem.
func TerminateComputeSystem ¶
TerminateComputeSystem force terminates a container.
func TerminateProcessInComputeSystem ¶
TerminateProcessInComputeSystem kills a process in a running container.
func UnprepareLayer ¶
func UnprepareLayer(info DriverInfo, layerId string) error
UnprepareLayer disables the filesystem filter for the read-write layer with the given id.
Types ¶
type CreateProcessParams ¶
type CreateProcessParams struct { ApplicationName string CommandLine string WorkingDirectory string Environment map[string]string EmulateConsole bool ConsoleSize [2]int }
CreateProcessParams is used as both the input of CreateProcessInComputeSystem and to convert the parameters to JSON for passing onto the HCS
type DriverInfo ¶
To pass into syscall, we need a struct matching the following:
enum GraphDriverType
{ DiffDriver, FilterDriver };
struct DriverInfo { GraphDriverType Flavour; LPCWSTR HomeDir; };
type GUID ¶
type GUID [16]byte
func NameToGuid ¶
NameToGuid converts the given string into a GUID using the algorithm in the Host Compute Service, ensuring GUIDs generated with the same string are common across all clients.
type HNSEndpoint ¶
type HNSEndpoint struct { Id string `json:",omitempty"` Name string `json:",omitempty"` VirtualNetwork string `json:",omitempty"` VirtualNetworkName string `json:",omitempty"` Policies []json.RawMessage `json:",omitempty"` MacAddress string `json:",omitempty"` IPAddress net.IP `json:",omitempty"` }
HNSEndpoint represents a network endpoint in HNS
func HNSEndpointRequest ¶
func HNSEndpointRequest(method, path, request string) (*HNSEndpoint, error)
HNSEndpointRequest makes a HNS call to modify/query a network endpoint
type HNSNetwork ¶
type HNSNetwork struct { Id string `json:",omitempty"` Name string `json:",omitempty"` Type string `json:",omitempty"` Policies []json.RawMessage `json:",omitempty"` MacPools []MacPool `json:",omitempty"` Subnets []Subnet `json:",omitempty"` }
HNSNetwork represents a network in HNS
func HNSListNetworkRequest ¶
func HNSListNetworkRequest(method, path, request string) ([]HNSNetwork, error)
HNSListNetworkRequest makes a HNS call to query the list of available networks
func HNSNetworkRequest ¶
func HNSNetworkRequest(method, path, request string) (*HNSNetwork, error)
HNSNetworkRequest makes a call into HNS to update/query a single network
type MacPool ¶
type MacPool struct { StartMacAddress string `json:",omitempty"` EndMacAddress string `json:",omitempty"` }
MacPool is assoicated with a network and represents a list of macaddresses available to the network
type Subnet ¶
type Subnet struct { AddressPrefix string `json:",omitempty"` GatewayAddress string `json:",omitempty"` }
Subnet is assoicated with a network and represents a list of subnets available to the network
type WC_LAYER_DESCRIPTOR ¶
To pass into syscall, we need a struct matching the following:
typedef struct _WC_LAYER_DESCRIPTOR {
// // The ID of the layer // GUID LayerId; // // Additional flags // union { struct { ULONG Reserved : 31; ULONG Dirty : 1; // Created from sandbox as a result of snapshot }; ULONG Value; } Flags; // // Path to the layer root directory, null-terminated // PCWSTR Path;
} WC_LAYER_DESCRIPTOR, *PWC_LAYER_DESCRIPTOR;
Source Files ¶
- activatelayer.go
- copylayer.go
- createcomputesystem.go
- createlayer.go
- createprocess.go
- createsandboxlayer.go
- deactivatelayer.go
- destroylayer.go
- exportlayer.go
- getlayermountpath.go
- getsharedbaseimages.go
- guid.go
- hcsshim.go
- hnsfuncs.go
- importlayer.go
- layerexists.go
- layerutils.go
- nametoguid.go
- preparelayer.go
- resizeconsole.go
- shutdownterminatecomputesystem.go
- startcomputesystem.go
- terminateprocess.go
- unpreparelayer.go
- waitprocess.go
- zhcsshim.go