Documentation ¶
Index ¶
- Constants
- func MakeClient(_ context.Context, config coretypes.Config, ...) (engine.API, error)
- type Virt
- func (v *Virt) BuildContent(_ context.Context, _ coresource.Source, _ *enginetypes.BuildContentOptions) (string, io.Reader, error)
- func (v *Virt) BuildRefs(_ context.Context, opts *enginetypes.BuildRefOptions) (refs []string)
- func (v *Virt) CloseConn() error
- func (v *Virt) ExecExitCode(ctx context.Context, ID, execID string) (code int, err error)
- func (v *Virt) ExecResize(ctx context.Context, execID string, height, width uint) (err error)
- func (v *Virt) Execute(ctx context.Context, ID string, config *enginetypes.ExecConfig) (execID string, stdout, stderr io.ReadCloser, stdin io.WriteCloser, err error)
- func (v *Virt) GetParams() *enginetypes.Params
- func (v *Virt) ImageBuild(ctx context.Context, _ io.Reader, _ []string, _ string) (rc io.ReadCloser, err error)
- func (v *Virt) ImageBuildCachePrune(ctx context.Context, _ bool) (reclaimed uint64, err error)
- func (v *Virt) ImageBuildFromExist(ctx context.Context, ID string, refs []string, user string) (string, error)
- func (v *Virt) ImageList(ctx context.Context, imageName string) (imgs []*enginetypes.Image, err error)
- func (v *Virt) ImageLocalDigests(ctx context.Context, image string) ([]string, error)
- func (v *Virt) ImagePull(ctx context.Context, ref string, all bool) (rc io.ReadCloser, err error)
- func (v *Virt) ImagePush(ctx context.Context, ref string) (rc io.ReadCloser, err error)
- func (v *Virt) ImageRemoteDigest(ctx context.Context, image string) (string, error)
- func (v *Virt) ImageRemove(ctx context.Context, tag string, force, prune bool) (names []string, err error)
- func (v *Virt) ImagesPrune(ctx context.Context) (err error)
- func (v *Virt) Info(ctx context.Context) (*enginetypes.Info, error)
- func (v *Virt) NetworkConnect(ctx context.Context, network, target, ipv4, _ string) (cidrs []string, err error)
- func (v *Virt) NetworkDisconnect(ctx context.Context, network, target string, _ bool) (err error)
- func (v *Virt) NetworkList(ctx context.Context, drivers []string) (nets []*enginetypes.Network, err error)
- func (v *Virt) Ping(ctx context.Context) error
- func (v *Virt) RawEngine(ctx context.Context, opts *enginetypes.RawEngineOptions) (res *enginetypes.RawEngineResult, err error)
- func (v *Virt) VirtualizationAttach(ctx context.Context, ID string, _, _ bool) (stdout, stderr io.ReadCloser, stdin io.WriteCloser, err error)
- func (v *Virt) VirtualizationCopyChunkTo(ctx context.Context, ID, dest string, _ int64, content io.Reader, _, _ int, ...) error
- func (v *Virt) VirtualizationCopyFrom(ctx context.Context, ID, path string) (content []byte, uid, gid int, mode int64, err error)
- func (v *Virt) VirtualizationCopyTo(ctx context.Context, ID, dest string, content []byte, _, _ int, _ int64) error
- func (v *Virt) VirtualizationCreate(ctx context.Context, opts *enginetypes.VirtualizationCreateOptions) (guest *enginetypes.VirtualizationCreated, err error)
- func (v *Virt) VirtualizationInspect(ctx context.Context, ID string) (*enginetypes.VirtualizationInfo, error)
- func (v *Virt) VirtualizationLogs(ctx context.Context, opts *enginetypes.VirtualizationLogStreamOptions) (stdout io.ReadCloser, stderr io.ReadCloser, err error)
- func (v *Virt) VirtualizationRemove(ctx context.Context, ID string, _, force bool) (err error)
- func (v *Virt) VirtualizationResize(ctx context.Context, ID string, height, width uint) error
- func (v *Virt) VirtualizationResume(ctx context.Context, ID string) (err error)
- func (v *Virt) VirtualizationStart(ctx context.Context, ID string) (err error)
- func (v *Virt) VirtualizationStop(ctx context.Context, ID string, gracefulTimeout time.Duration) (err error)
- func (v *Virt) VirtualizationSuspend(ctx context.Context, ID string) (err error)
- func (v *Virt) VirtualizationUpdateResource(ctx context.Context, ID string, engineParams resourcetypes.Resources) error
- func (v *Virt) VirtualizationWait(ctx context.Context, ID, _ string) (*enginetypes.VirtualizationWaitResult, error)
Constants ¶
const ( // GRPCPrefixKey indicates grpc yavirtd GRPCPrefixKey = "virt-grpc://" // ImageUserKey indicates the image's owner ImageUserKey = "ImageUser" // DmiUUIDKey indicates the key within deploy info. DmiUUIDKey = "DMIUUID" // Type indicate type Type = "virt" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Virt ¶
type Virt struct {
// contains filtered or unexported fields
}
Virt implements the core engine.API interface.
func (*Virt) BuildContent ¶
func (v *Virt) BuildContent(_ context.Context, _ coresource.Source, _ *enginetypes.BuildContentOptions) (string, io.Reader, error)
BuildContent builds content, the use of it is similar to BuildRefs.
func (*Virt) BuildRefs ¶
func (v *Virt) BuildRefs(_ context.Context, opts *enginetypes.BuildRefOptions) (refs []string)
BuildRefs builds references.
func (*Virt) ExecExitCode ¶
ExecExitCode get return code of a specific execution.
func (*Virt) ExecResize ¶
ExecResize resize exec tty
func (*Virt) Execute ¶
func (v *Virt) Execute(ctx context.Context, ID string, config *enginetypes.ExecConfig) (execID string, stdout, stderr io.ReadCloser, stdin io.WriteCloser, err error)
Execute executes a command in vm in tty mode, 'execID' return value indicates the execID which has the pattern '%s_%s', at other times it indicates the pid
func (*Virt) GetParams ¶
func (v *Virt) GetParams() *enginetypes.Params
func (*Virt) ImageBuild ¶
func (v *Virt) ImageBuild(ctx context.Context, _ io.Reader, _ []string, _ string) (rc io.ReadCloser, err error)
ImageBuild captures from a guest.
func (*Virt) ImageBuildCachePrune ¶
ImageBuildCachePrune prunes cached one.
func (*Virt) ImageBuildFromExist ¶
func (v *Virt) ImageBuildFromExist(ctx context.Context, ID string, refs []string, user string) (string, error)
ImageBuildFromExist builds vm image from running vm
func (*Virt) ImageList ¶
func (v *Virt) ImageList(ctx context.Context, imageName string) (imgs []*enginetypes.Image, err error)
ImageList lists images.
func (*Virt) ImageLocalDigests ¶
ImageLocalDigests shows local images' digests. If local image file not exists return error If exists return digests Same for remote digest
func (*Virt) ImageRemoteDigest ¶
ImageRemoteDigest shows remote one's digest.
func (*Virt) ImageRemove ¶
func (v *Virt) ImageRemove(ctx context.Context, tag string, force, prune bool) (names []string, err error)
ImageRemove removes a specific image.
func (*Virt) ImagesPrune ¶
ImagesPrune prunes one.
func (*Virt) NetworkConnect ¶
func (v *Virt) NetworkConnect(ctx context.Context, network, target, ipv4, _ string) (cidrs []string, err error)
NetworkConnect connects to a network.
func (*Virt) NetworkDisconnect ¶
NetworkDisconnect disconnects from one network.
func (*Virt) NetworkList ¶
func (v *Virt) NetworkList(ctx context.Context, drivers []string) (nets []*enginetypes.Network, err error)
NetworkList lists all networks.
func (*Virt) RawEngine ¶
func (v *Virt) RawEngine(ctx context.Context, opts *enginetypes.RawEngineOptions) (res *enginetypes.RawEngineResult, err error)
func (*Virt) VirtualizationAttach ¶
func (v *Virt) VirtualizationAttach(ctx context.Context, ID string, _, _ bool) (stdout, stderr io.ReadCloser, stdin io.WriteCloser, err error)
VirtualizationAttach attaches something to a guest.
func (*Virt) VirtualizationCopyChunkTo ¶
func (v *Virt) VirtualizationCopyChunkTo(ctx context.Context, ID, dest string, _ int64, content io.Reader, _, _ int, _ int64) error
VirtualizationCopyChunkTo copies one.
func (*Virt) VirtualizationCopyFrom ¶
func (v *Virt) VirtualizationCopyFrom(ctx context.Context, ID, path string) (content []byte, uid, gid int, mode int64, err error)
VirtualizationCopyFrom copies file content from the container.
func (*Virt) VirtualizationCopyTo ¶
func (v *Virt) VirtualizationCopyTo(ctx context.Context, ID, dest string, content []byte, _, _ int, _ int64) error
VirtualizationCopyTo copies one.
func (*Virt) VirtualizationCreate ¶
func (v *Virt) VirtualizationCreate(ctx context.Context, opts *enginetypes.VirtualizationCreateOptions) (guest *enginetypes.VirtualizationCreated, err error)
VirtualizationCreate creates a guest.
func (*Virt) VirtualizationInspect ¶
func (v *Virt) VirtualizationInspect(ctx context.Context, ID string) (*enginetypes.VirtualizationInfo, error)
VirtualizationInspect gets a guest.
func (*Virt) VirtualizationLogs ¶
func (v *Virt) VirtualizationLogs(ctx context.Context, opts *enginetypes.VirtualizationLogStreamOptions) (stdout io.ReadCloser, stderr io.ReadCloser, err error)
VirtualizationLogs streams a specific guest's log
func (*Virt) VirtualizationRemove ¶
VirtualizationRemove removes a guest.
func (*Virt) VirtualizationResize ¶
VirtualizationResize resized window size
func (*Virt) VirtualizationResume ¶
VirtualizationResume resumes a guest.
func (*Virt) VirtualizationStart ¶
VirtualizationStart boots a guest.
func (*Virt) VirtualizationStop ¶
func (v *Virt) VirtualizationStop(ctx context.Context, ID string, gracefulTimeout time.Duration) (err error)
VirtualizationStop stops it.
func (*Virt) VirtualizationSuspend ¶
VirtualizationSuspend suspends a guest.
func (*Virt) VirtualizationUpdateResource ¶
func (v *Virt) VirtualizationUpdateResource(ctx context.Context, ID string, engineParams resourcetypes.Resources) error
VirtualizationUpdateResource updates resource.
func (*Virt) VirtualizationWait ¶
func (v *Virt) VirtualizationWait(ctx context.Context, ID, _ string) (*enginetypes.VirtualizationWaitResult, error)
VirtualizationWait is waiting for a shut-off