Documentation
¶
Index ¶
- Constants
- Variables
- type BindMount
- type CapabilityConfig
- type Client
- func (c *Client) Cleanup()
- func (c *Client) CreateContainer(config ContainerConfig) (string, error)
- func (c *Client) CreateVolume(name string) error
- func (c *Client) DeleteContainer(id string) error
- func (c *Client) DeleteVolume(name string) error
- func (c *Client) Init() (plugin.Config, error)
- func (c *Client) KillContainer(id string, signal os.Signal) error
- func (c *Client) ListVolumes() ([]string, error)
- func (c *Client) Metadata() plugin.Metadata
- func (c *Client) ResizeContainer(id string, height, width uint32) error
- func (c *Client) ResolveImage(spec string) (string, error)
- func (c *Client) StartContainer(id string) error
- func (c *Client) StreamContainer(id string, stream *plugin.StreamConfig) (*Result, error)
- func (c *Client) Type() plugin.Type
- func (c *Client) WriteFile(containerID, path string, contents []byte) error
- type Command
- type ContainerConfig
- type ContainerRuntime
- type DeviceMount
- type Entrypoint
- type EnvironmentConfig
- type EnvironmentVariable
- type ImageMount
- type Mount
- type MountConfig
- type MountType
- type PortBinding
- type PortConfig
- type Process
- type Result
- type Server
- func (s *Server) CreateContainer(_ context.Context, config *api.CreateContainerRequest) (*api.CreateContainerResponse, error)
- func (s *Server) CreateVolume(_ context.Context, request *api.CreateVolumeRequest) (*empty.Empty, error)
- func (s *Server) DeleteContainer(_ context.Context, request *api.DeleteContainerRequest) (*empty.Empty, error)
- func (s *Server) DeleteVolume(_ context.Context, request *api.DeleteVolumeRequest) (*empty.Empty, error)
- func (s *Server) GetImage(_ context.Context, request *api.GetImageRequest) (*api.GetImageResponse, error)
- func (s *Server) GetPluginMetadata(_ context.Context, _ *empty.Empty) (*pluginapi.GetPluginMetadataResponse, error)
- func (s *Server) InitPlugin(_ context.Context, _ *empty.Empty) (*pluginapi.InitPluginResponse, error)
- func (s *Server) KillContainer(_ context.Context, request *api.KillContainerRequest) (*empty.Empty, error)
- func (s *Server) ListVolumes(_ context.Context, _ *empty.Empty) (*api.ListVolumesResponse, error)
- func (s *Server) ResetPlugin(_ context.Context, _ *empty.Empty) (*empty.Empty, error)
- func (s *Server) ResizeContainer(_ context.Context, request *api.ResizeContainerRequest) (*empty.Empty, error)
- func (s *Server) StartContainer(_ context.Context, request *api.StartContainerRequest) (*empty.Empty, error)
- func (s *Server) StreamContainer(_ context.Context, request *api.StreamContainerRequest) (*api.StreamContainerResponse, error)
- func (s *Server) WriteFile(_ context.Context, request *api.WriteFileRequest) (*empty.Empty, error)
- type TerminalConfig
- type TmpfsMount
- type VolumeMount
Constants ¶
View Source
const Type pluginType = "runtime"
Variables ¶
View Source
var ErrDeviceFormat = errors.New("invalid device format")
View Source
var ErrEnvironmentFormat = errors.New("invalid environment format")
View Source
var ErrPortFormat = errors.New("invalid publish format")
View Source
var ErrUnexpectedMapType = errors.New("unexpected map type for stdio streaming server")
View Source
var ErrVolumeFormat = errors.New("invalid volume format")
Functions ¶
This section is empty.
Types ¶
type BindMount ¶ added in v0.10.0
func BindMountFromProto ¶ added in v0.10.0
type CapabilityConfig ¶ added in v0.10.0
type CapabilityConfig []string
func MergeCapabilityConfig ¶ added in v0.10.0
func MergeCapabilityConfig(first, second CapabilityConfig) CapabilityConfig
type Client ¶ added in v0.10.0
type Client struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(conn grpc.ClientConnInterface) *Client
func (*Client) CreateContainer ¶ added in v0.10.0
func (c *Client) CreateContainer(config ContainerConfig) (string, error)
func (*Client) CreateVolume ¶ added in v0.10.0
func (*Client) DeleteContainer ¶ added in v0.10.0
func (*Client) DeleteVolume ¶ added in v0.10.0
func (*Client) KillContainer ¶ added in v0.10.0
func (*Client) ListVolumes ¶ added in v0.10.1
func (*Client) ResizeContainer ¶ added in v0.10.0
func (*Client) ResolveImage ¶ added in v0.10.0
func (*Client) StartContainer ¶ added in v0.10.0
func (*Client) StreamContainer ¶ added in v0.10.0
type ContainerConfig ¶ added in v0.10.0
type ContainerConfig struct {
Name string
Image string
Process Process
Terminal TerminalConfig
Environment EnvironmentConfig
Ports PortConfig
Mounts MountConfig
Capabilities CapabilityConfig
}
func ContainerConfigFromProto ¶ added in v0.10.0
func ContainerConfigFromProto(c *api.ContainerConfig) ContainerConfig
func EmptyContainerConfig ¶ added in v0.10.0
func EmptyContainerConfig() ContainerConfig
func MergeContainerConfig ¶ added in v0.10.0
func MergeContainerConfig(first, second ContainerConfig) ContainerConfig
func (ContainerConfig) ToProto ¶ added in v0.10.0
func (c ContainerConfig) ToProto() *api.ContainerConfig
type ContainerRuntime ¶
type ContainerRuntime interface {
plugin.Plugin
ResolveImage(spec string) (string, error)
CreateContainer(containerConfig ContainerConfig) (string, error)
StartContainer(id string) error
DeleteContainer(id string) error
ResizeContainer(id string, height, width uint32) error
KillContainer(id string, signal os.Signal) error
StreamContainer(id string, streamConfig *plugin.StreamConfig) (*Result, error)
ListVolumes() ([]string, error)
CreateVolume(name string) error
DeleteVolume(name string) error
WriteFile(name, path string, contents []byte) error
}
type DeviceMount ¶ added in v0.10.0
type DeviceMount struct {
CGroupRule string
HostPath string
ContainerPath string
Permissions string
}
func DeviceMountFromProto ¶ added in v0.10.0
func DeviceMountFromProto(m *api.DeviceMount) DeviceMount
func (DeviceMount) ToProto ¶ added in v0.10.0
func (m DeviceMount) ToProto() *api.Mount
func (DeviceMount) Type ¶ added in v0.10.0
func (DeviceMount) Type() MountType
type Entrypoint ¶ added in v0.10.0
type Entrypoint []string
type EnvironmentConfig ¶ added in v0.10.0
type EnvironmentConfig []EnvironmentVariable
func EnvironmentConfigFromProto ¶ added in v0.10.0
func EnvironmentConfigFromProto(e []*api.EnvironmentVariable) EnvironmentConfig
func MergeEnvironmentConfig ¶ added in v0.10.0
func MergeEnvironmentConfig(first, second EnvironmentConfig) EnvironmentConfig
func (EnvironmentConfig) ToProto ¶ added in v0.10.0
func (e EnvironmentConfig) ToProto() []*api.EnvironmentVariable
type EnvironmentVariable ¶ added in v0.10.0
func EnvironmentVariableFromProto ¶ added in v0.10.0
func EnvironmentVariableFromProto(e *api.EnvironmentVariable) EnvironmentVariable
func EnvironmentVariableFromSpec ¶ added in v0.10.0
func EnvironmentVariableFromSpec(spec string) (EnvironmentVariable, error)
func (EnvironmentVariable) String ¶ added in v0.10.0
func (e EnvironmentVariable) String() string
func (EnvironmentVariable) ToProto ¶ added in v0.10.0
func (e EnvironmentVariable) ToProto() *api.EnvironmentVariable
type ImageMount ¶ added in v0.10.0
func ImageMountFromProto ¶ added in v0.10.0
func ImageMountFromProto(m *api.ImageMount) ImageMount
func (ImageMount) ToProto ¶ added in v0.10.0
func (m ImageMount) ToProto() *api.Mount
func (ImageMount) Type ¶ added in v0.10.0
func (ImageMount) Type() MountType
type Mount ¶ added in v0.10.0
func BindMountFromSpec ¶ added in v0.10.0
func DeviceMountFromSpec ¶ added in v0.10.0
func MountFromProto ¶ added in v0.10.0
type MountConfig ¶ added in v0.10.0
type MountConfig []Mount
func MergeMountConfig ¶ added in v0.10.0
func MergeMountConfig(first, second MountConfig) MountConfig
func MountConfigFromProto ¶ added in v0.10.0
func MountConfigFromProto(m []*api.Mount) MountConfig
func (MountConfig) ToProto ¶ added in v0.10.0
func (m MountConfig) ToProto() []*api.Mount
type MountType ¶ added in v0.10.0
type MountType string
const TypeBind MountType = "bind"
const TypeDevice MountType = "device"
const TypeImage MountType = "image"
const TypeTmpfs MountType = "tmpfs"
const TypeVolume MountType = "volume"
type PortBinding ¶ added in v0.10.0
func PortBindingFromProto ¶ added in v0.10.0
func PortBindingFromProto(p *api.PortBinding) PortBinding
func PortBindingFromSpec ¶ added in v0.10.0
func PortBindingFromSpec(spec string) (PortBinding, error)
func (PortBinding) ToProto ¶ added in v0.10.0
func (p PortBinding) ToProto() *api.PortBinding
type PortConfig ¶ added in v0.10.0
type PortConfig []PortBinding
func MergePortConfig ¶ added in v0.10.0
func MergePortConfig(first, second PortConfig) PortConfig
func PortConfigFromProto ¶ added in v0.10.0
func PortConfigFromProto(p []*api.PortBinding) PortConfig
func (PortConfig) ToProto ¶ added in v0.10.0
func (p PortConfig) ToProto() []*api.PortBinding
type Process ¶ added in v0.10.0
type Process struct {
User string
WorkingDir string
Entrypoint Entrypoint
Command Command
}
func MergeProcess ¶ added in v0.10.0
func ProcessFromProto ¶ added in v0.10.0
type Server ¶ added in v0.10.0
type Server struct {
pluginapi.UnsafePluginServer
pluginapi.UnsafeInputStreamingPluginServer
api.UnsafeRuntimePluginServer
stdio.OutputStreamingPluginServer
stdio.InputStreamingPluginServer
// contains filtered or unexported fields
}
func NewGRPCServer ¶
func NewGRPCServer(impl ContainerRuntime) *Server
func (*Server) CreateContainer ¶ added in v0.10.0
func (s *Server) CreateContainer( _ context.Context, config *api.CreateContainerRequest, ) (*api.CreateContainerResponse, error)
func (*Server) CreateVolume ¶ added in v0.10.0
func (*Server) DeleteContainer ¶ added in v0.10.0
func (*Server) DeleteVolume ¶ added in v0.10.0
func (*Server) GetImage ¶ added in v0.10.0
func (s *Server) GetImage(_ context.Context, request *api.GetImageRequest) (*api.GetImageResponse, error)
func (*Server) GetPluginMetadata ¶ added in v0.10.0
func (*Server) InitPlugin ¶ added in v0.10.0
func (*Server) KillContainer ¶ added in v0.10.0
func (*Server) ListVolumes ¶ added in v0.10.1
func (*Server) ResetPlugin ¶ added in v0.10.0
func (*Server) ResizeContainer ¶ added in v0.10.0
func (*Server) StartContainer ¶ added in v0.10.0
func (*Server) StreamContainer ¶ added in v0.10.0
func (s *Server) StreamContainer( _ context.Context, request *api.StreamContainerRequest, ) (*api.StreamContainerResponse, error)
type TerminalConfig ¶ added in v0.10.0
func MergeTerminalConfig ¶ added in v0.10.0
func MergeTerminalConfig(first, second TerminalConfig) TerminalConfig
func TerminalConfigFromProto ¶ added in v0.10.0
func TerminalConfigFromProto(t *api.TerminalConfig) TerminalConfig
func (TerminalConfig) ToProto ¶ added in v0.10.0
func (t TerminalConfig) ToProto() *api.TerminalConfig
type TmpfsMount ¶ added in v0.10.0
func TmpfsMountFromProto ¶ added in v0.10.0
func TmpfsMountFromProto(m *api.TmpfsMount) TmpfsMount
func (TmpfsMount) ToProto ¶ added in v0.10.0
func (m TmpfsMount) ToProto() *api.Mount
func (TmpfsMount) Type ¶ added in v0.10.0
func (TmpfsMount) Type() MountType
type VolumeMount ¶ added in v0.10.0
func VolumeMountFromProto ¶ added in v0.10.0
func VolumeMountFromProto(m *api.VolumeMount) VolumeMount
func (VolumeMount) ToProto ¶ added in v0.10.0
func (m VolumeMount) ToProto() *api.Mount
func (VolumeMount) Type ¶ added in v0.10.0
func (VolumeMount) Type() MountType
Click to show internal directories.
Click to hide internal directories.