Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExitResult ¶
type Instance ¶
type Instance struct { Id string `json:"id"` Metadata InstanceMetadata `json:"metadata"` Config InstanceConfig `json:"config"` ImageRef string `json:"image_ref"` Network NetworkingConfig `json:"network"` State State `json:"state"` CreatedAt time.Time `json:"created_at"` }
type InstanceConfig ¶
type InstanceConfig struct { Image string `json:"image"` Guest InstanceGuestConfig `json:"guest"` Init api.InitConfig `json:"init"` Stop *api.StopConfig `json:"stop,omitempty"` Env []string `json:"env"` }
type InstanceGuestConfig ¶
type InstanceMetadata ¶
type InstanceNetwork ¶
type InstanceNetwork struct { Network networking.Network `json:"network"` InstanceIP net.IP `json:"instance_ip"` HostIP net.IP `json:"host_ip"` Gateway net.IP `json:"gateway"` Broadcast net.IP `json:"broadcast"` }
func GetLocalNetwork ¶
func GetLocalNetwork(netw networking.Network) InstanceNetwork
func (*InstanceNetwork) HostIPNet ¶
func (i *InstanceNetwork) HostIPNet() *net.IPNet
func (*InstanceNetwork) InstanceIPNet ¶
func (i *InstanceNetwork) InstanceIPNet() *net.IPNet
func (*InstanceNetwork) MarshalJSON ¶
func (i *InstanceNetwork) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*InstanceNetwork) UnmarshalJSON ¶
func (i *InstanceNetwork) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InstanceOptions ¶
type InstanceOptions struct { Id string `json:"id"` Metadata InstanceMetadata `json:"metadata"` Config InstanceConfig `json:"config"` }
type InstanceStatus ¶
type InstanceStatus = string
const ( InstanceStatusCreated InstanceStatus = "created" InstanceStatusStopped InstanceStatus = "stopped" InstanceStatusStarting InstanceStatus = "starting" InstanceStatusRunning InstanceStatus = "running" InstanceStatusDestroying InstanceStatus = "destroying" InstanceStatusDestroyed InstanceStatus = "destroyed" )
type InstanceStore ¶
type NetworkingConfig ¶
type NetworkingConfig struct { TapDevice string `json:"tap_device"` Local InstanceNetwork `json:"local"` DefaultGateway net.IP `json:"default_gateway"` }
func (*NetworkingConfig) MarshalJSON ¶
func (n *NetworkingConfig) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*NetworkingConfig) UnmarshalJSON ¶
func (n *NetworkingConfig) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NetworkingService ¶
type NetworkingService interface { EnsureInstanceNetwork(id string, config NetworkingConfig) error CleanupInstanceNetwork(id string, config NetworkingConfig) error }
type State ¶
type State struct { Status InstanceStatus `json:"status"` Stopping bool `json:"stopping"` ExitResult *ExitResult `json:"exit_result,omitempty"` }
type VM ¶
type VM interface { Start(ctx context.Context) error Exec(ctx context.Context, cmd []string, timeout time.Duration) (*api.ExecResult, error) Run() ExitResult WaitExit(ctx context.Context) bool Signal(ctx context.Context, signal string) error Stop(ctx context.Context, signal string) error Shutdown(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.