Documentation
¶
Overview ¶
Package incus implements the sandbox.Sandbox interface using a native Incus daemon connection (local unix socket or remote HTTPS).
Index ¶
- type Incus
- func (i *Incus) AllowDomain(ctx context.Context, name, domain string) error
- func (i *Incus) Capabilities() sandbox.Capabilities
- func (i *Incus) CloneFrom(ctx context.Context, source, label, newName string) error
- func (i *Incus) Close() error
- func (i *Incus) Console(ctx context.Context, name string, opts sandbox.ConsoleOpts) error
- func (i *Incus) Create(ctx context.Context, opts sandbox.CreateOpts) (*sandbox.Instance, error)
- func (i *Incus) CreateSnapshot(ctx context.Context, name, label string) error
- func (i *Incus) Delete(ctx context.Context, name string) error
- func (i *Incus) DeleteFile(ctx context.Context, name, p string) error
- func (i *Incus) DeleteSnapshot(ctx context.Context, name, label string) error
- func (i *Incus) DenyDomain(ctx context.Context, name, domain string) error
- func (i *Incus) Get(ctx context.Context, name string) (*sandbox.Instance, error)
- func (i *Incus) GetPolicy(ctx context.Context, name string) (*sandbox.Policy, error)
- func (i *Incus) List(ctx context.Context) ([]sandbox.Instance, error)
- func (i *Incus) ListFiles(ctx context.Context, name, p string, recursive bool) ([]sandbox.FileEntry, error)
- func (i *Incus) ListSnapshots(ctx context.Context, name string) ([]sandbox.Snapshot, error)
- func (i *Incus) Output(ctx context.Context, name string, cmd []string) ([]byte, error)
- func (i *Incus) ReadFile(ctx context.Context, name, p string, maxBytes int64) ([]byte, bool, error)
- func (i *Incus) Ready(ctx context.Context, name string, timeout time.Duration) error
- func (i *Incus) RestoreSnapshot(ctx context.Context, name, label string) error
- func (i *Incus) Run(ctx context.Context, name string, opts sandbox.ExecOpts) (int, error)
- func (i *Incus) SetEgressMode(ctx context.Context, name string, mode sandbox.EgressMode) error
- func (i *Incus) Start(ctx context.Context, name string) error
- func (i *Incus) Stop(ctx context.Context, name string) error
- func (i *Incus) WriteFile(ctx context.Context, name, p string, content []byte, mode os.FileMode, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Incus ¶
type Incus struct {
// contains filtered or unexported fields
}
Incus implements sandbox.Sandbox using a native Incus daemon connection.
func (*Incus) AllowDomain ¶
AllowDomain adds a domain to the egress allowlist and re-resolves.
func (*Incus) Capabilities ¶
func (i *Incus) Capabilities() sandbox.Capabilities
Capabilities advertises that the Incus backend supports all optional features.
func (*Incus) Create ¶
Create creates a new container instance with the full provisioning flow. When opts.Bare is true, only the instance is created (no provisioning).
func (*Incus) CreateSnapshot ¶
CreateSnapshot creates a snapshot for the named instance.
func (*Incus) DeleteFile ¶ added in v0.6.0
DeleteFile removes a single file via the native Incus file API.
func (*Incus) DeleteSnapshot ¶
DeleteSnapshot deletes a snapshot by label.
func (*Incus) DenyDomain ¶
DenyDomain removes a domain from the egress allowlist and re-resolves.
func (*Incus) ListFiles ¶ added in v0.6.0
func (i *Incus) ListFiles(ctx context.Context, name, p string, recursive bool) ([]sandbox.FileEntry, error)
ListFiles enumerates entries via shell `find -printf` since the Incus file API doesn't expose size in directory listings.
func (*Incus) ListSnapshots ¶
ListSnapshots returns all snapshots for the named instance.
func (*Incus) ReadFile ¶ added in v0.6.0
ReadFile streams the file (or first maxBytes) into memory via the native Incus file API. If maxBytes>0 and the file is larger, returns truncated=true.
func (*Incus) RestoreSnapshot ¶
RestoreSnapshot rolls back to the given snapshot: stop, restore, start.
func (*Incus) SetEgressMode ¶
SetEgressMode sets the egress filtering mode for a container.
func (*Incus) WriteFile ¶ added in v0.6.0
func (i *Incus) WriteFile(ctx context.Context, name, p string, content []byte, mode os.FileMode, uid, gid int) error
WriteFile writes content to path inside the container via the native Incus file API. Parents are created as 0o755 directories (mkdir-p semantics). uid/gid set ownership; pass sandbox.NoOwner (negative) to leave the file root-owned (the filesystem-API default).