github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/domain/entities/engine_container.go (about)

     1  package entities
     2  
     3  import (
     4  	"context"
     5  	"io"
     6  
     7  	"github.com/containers/common/libnetwork/types"
     8  	"github.com/containers/common/pkg/config"
     9  	"github.com/hanks177/podman/v4/libpod/define"
    10  	"github.com/hanks177/podman/v4/pkg/domain/entities/reports"
    11  	"github.com/hanks177/podman/v4/pkg/specgen"
    12  )
    13  
    14  type ContainerCopyFunc func() error
    15  
    16  type ContainerEngine interface {
    17  	AutoUpdate(ctx context.Context, options AutoUpdateOptions) ([]*AutoUpdateReport, []error)
    18  	Config(ctx context.Context) (*config.Config, error)
    19  	ContainerAttach(ctx context.Context, nameOrID string, options AttachOptions) error
    20  	ContainerCheckpoint(ctx context.Context, namesOrIds []string, options CheckpointOptions) ([]*CheckpointReport, error)
    21  	ContainerCleanup(ctx context.Context, namesOrIds []string, options ContainerCleanupOptions) ([]*ContainerCleanupReport, error)
    22  	ContainerClone(ctx context.Context, ctrClone ContainerCloneOptions) (*ContainerCreateReport, error)
    23  	ContainerCommit(ctx context.Context, nameOrID string, options CommitOptions) (*CommitReport, error)
    24  	ContainerCopyFromArchive(ctx context.Context, nameOrID, path string, reader io.Reader, options CopyOptions) (ContainerCopyFunc, error)
    25  	ContainerCopyToArchive(ctx context.Context, nameOrID string, path string, writer io.Writer) (ContainerCopyFunc, error)
    26  	ContainerCreate(ctx context.Context, s *specgen.SpecGenerator) (*ContainerCreateReport, error)
    27  	ContainerExec(ctx context.Context, nameOrID string, options ExecOptions, streams define.AttachStreams) (int, error)
    28  	ContainerExecDetached(ctx context.Context, nameOrID string, options ExecOptions) (string, error)
    29  	ContainerExists(ctx context.Context, nameOrID string, options ContainerExistsOptions) (*BoolReport, error)
    30  	ContainerExport(ctx context.Context, nameOrID string, options ContainerExportOptions) error
    31  	ContainerInit(ctx context.Context, namesOrIds []string, options ContainerInitOptions) ([]*ContainerInitReport, error)
    32  	ContainerInspect(ctx context.Context, namesOrIds []string, options InspectOptions) ([]*ContainerInspectReport, []error, error)
    33  	ContainerKill(ctx context.Context, namesOrIds []string, options KillOptions) ([]*KillReport, error)
    34  	ContainerList(ctx context.Context, options ContainerListOptions) ([]ListContainer, error)
    35  	ContainerListExternal(ctx context.Context) ([]ListContainer, error)
    36  	ContainerLogs(ctx context.Context, containers []string, options ContainerLogsOptions) error
    37  	ContainerMount(ctx context.Context, nameOrIDs []string, options ContainerMountOptions) ([]*ContainerMountReport, error)
    38  	ContainerPause(ctx context.Context, namesOrIds []string, options PauseUnPauseOptions) ([]*PauseUnpauseReport, error)
    39  	ContainerPort(ctx context.Context, nameOrID string, options ContainerPortOptions) ([]*ContainerPortReport, error)
    40  	ContainerPrune(ctx context.Context, options ContainerPruneOptions) ([]*reports.PruneReport, error)
    41  	ContainerRename(ctr context.Context, nameOrID string, options ContainerRenameOptions) error
    42  	ContainerRestart(ctx context.Context, namesOrIds []string, options RestartOptions) ([]*RestartReport, error)
    43  	ContainerRestore(ctx context.Context, namesOrIds []string, options RestoreOptions) ([]*RestoreReport, error)
    44  	ContainerRm(ctx context.Context, namesOrIds []string, options RmOptions) ([]*reports.RmReport, error)
    45  	ContainerRun(ctx context.Context, opts ContainerRunOptions) (*ContainerRunReport, error)
    46  	ContainerRunlabel(ctx context.Context, label string, image string, args []string, opts ContainerRunlabelOptions) error
    47  	ContainerStart(ctx context.Context, namesOrIds []string, options ContainerStartOptions) ([]*ContainerStartReport, error)
    48  	ContainerStat(ctx context.Context, nameOrDir string, path string) (*ContainerStatReport, error)
    49  	ContainerStats(ctx context.Context, namesOrIds []string, options ContainerStatsOptions) (chan ContainerStatsReport, error)
    50  	ContainerStop(ctx context.Context, namesOrIds []string, options StopOptions) ([]*StopReport, error)
    51  	ContainerTop(ctx context.Context, options TopOptions) (*StringSliceReport, error)
    52  	ContainerUnmount(ctx context.Context, nameOrIDs []string, options ContainerUnmountOptions) ([]*ContainerUnmountReport, error)
    53  	ContainerUnpause(ctx context.Context, namesOrIds []string, options PauseUnPauseOptions) ([]*PauseUnpauseReport, error)
    54  	ContainerWait(ctx context.Context, namesOrIds []string, options WaitOptions) ([]WaitReport, error)
    55  	Diff(ctx context.Context, namesOrIds []string, options DiffOptions) (*DiffReport, error)
    56  	Events(ctx context.Context, opts EventsOptions) error
    57  	GenerateSystemd(ctx context.Context, nameOrID string, opts GenerateSystemdOptions) (*GenerateSystemdReport, error)
    58  	GenerateKube(ctx context.Context, nameOrIDs []string, opts GenerateKubeOptions) (*GenerateKubeReport, error)
    59  	SystemPrune(ctx context.Context, options SystemPruneOptions) (*SystemPruneReport, error)
    60  	HealthCheckRun(ctx context.Context, nameOrID string, options HealthCheckOptions) (*define.HealthCheckResults, error)
    61  	Info(ctx context.Context) (*define.Info, error)
    62  	NetworkConnect(ctx context.Context, networkname string, options NetworkConnectOptions) error
    63  	NetworkCreate(ctx context.Context, network types.Network) (*types.Network, error)
    64  	NetworkDisconnect(ctx context.Context, networkname string, options NetworkDisconnectOptions) error
    65  	NetworkExists(ctx context.Context, networkname string) (*BoolReport, error)
    66  	NetworkInspect(ctx context.Context, namesOrIds []string, options InspectOptions) ([]types.Network, []error, error)
    67  	NetworkList(ctx context.Context, options NetworkListOptions) ([]types.Network, error)
    68  	NetworkPrune(ctx context.Context, options NetworkPruneOptions) ([]*NetworkPruneReport, error)
    69  	NetworkReload(ctx context.Context, names []string, options NetworkReloadOptions) ([]*NetworkReloadReport, error)
    70  	NetworkRm(ctx context.Context, namesOrIds []string, options NetworkRmOptions) ([]*NetworkRmReport, error)
    71  	PlayKube(ctx context.Context, body io.Reader, opts PlayKubeOptions) (*PlayKubeReport, error)
    72  	PlayKubeDown(ctx context.Context, body io.Reader, opts PlayKubeDownOptions) (*PlayKubeReport, error)
    73  	PodCreate(ctx context.Context, specg PodSpec) (*PodCreateReport, error)
    74  	PodExists(ctx context.Context, nameOrID string) (*BoolReport, error)
    75  	PodInspect(ctx context.Context, options PodInspectOptions) (*PodInspectReport, error)
    76  	PodKill(ctx context.Context, namesOrIds []string, options PodKillOptions) ([]*PodKillReport, error)
    77  	PodLogs(ctx context.Context, pod string, options PodLogsOptions) error
    78  	PodPause(ctx context.Context, namesOrIds []string, options PodPauseOptions) ([]*PodPauseReport, error)
    79  	PodPrune(ctx context.Context, options PodPruneOptions) ([]*PodPruneReport, error)
    80  	PodPs(ctx context.Context, options PodPSOptions) ([]*ListPodsReport, error)
    81  	PodRestart(ctx context.Context, namesOrIds []string, options PodRestartOptions) ([]*PodRestartReport, error)
    82  	PodRm(ctx context.Context, namesOrIds []string, options PodRmOptions) ([]*PodRmReport, error)
    83  	PodStart(ctx context.Context, namesOrIds []string, options PodStartOptions) ([]*PodStartReport, error)
    84  	PodStats(ctx context.Context, namesOrIds []string, options PodStatsOptions) ([]*PodStatsReport, error)
    85  	PodStop(ctx context.Context, namesOrIds []string, options PodStopOptions) ([]*PodStopReport, error)
    86  	PodTop(ctx context.Context, options PodTopOptions) (*StringSliceReport, error)
    87  	PodUnpause(ctx context.Context, namesOrIds []string, options PodunpauseOptions) ([]*PodUnpauseReport, error)
    88  	SetupRootless(ctx context.Context, noMoveProcess bool) error
    89  	SecretCreate(ctx context.Context, name string, reader io.Reader, options SecretCreateOptions) (*SecretCreateReport, error)
    90  	SecretInspect(ctx context.Context, nameOrIDs []string) ([]*SecretInfoReport, []error, error)
    91  	SecretList(ctx context.Context, opts SecretListRequest) ([]*SecretInfoReport, error)
    92  	SecretRm(ctx context.Context, nameOrID []string, opts SecretRmOptions) ([]*SecretRmReport, error)
    93  	Shutdown(ctx context.Context)
    94  	SystemDf(ctx context.Context, options SystemDfOptions) (*SystemDfReport, error)
    95  	Unshare(ctx context.Context, args []string, options SystemUnshareOptions) error
    96  	Version(ctx context.Context) (*SystemVersionReport, error)
    97  	VolumeCreate(ctx context.Context, opts VolumeCreateOptions) (*IDOrNameResponse, error)
    98  	VolumeExists(ctx context.Context, namesOrID string) (*BoolReport, error)
    99  	VolumeMounted(ctx context.Context, namesOrID string) (*BoolReport, error)
   100  	VolumeInspect(ctx context.Context, namesOrIds []string, opts InspectOptions) ([]*VolumeInspectReport, []error, error)
   101  	VolumeList(ctx context.Context, opts VolumeListOptions) ([]*VolumeListReport, error)
   102  	VolumeMount(ctx context.Context, namesOrIds []string) ([]*VolumeMountReport, error)
   103  	VolumePrune(ctx context.Context, options VolumePruneOptions) ([]*reports.PruneReport, error)
   104  	VolumeRm(ctx context.Context, namesOrIds []string, opts VolumeRmOptions) ([]*VolumeRmReport, error)
   105  	VolumeUnmount(ctx context.Context, namesOrIds []string) ([]*VolumeUnmountReport, error)
   106  }