summaryrefslogtreecommitdiff
path: root/pkg/domain/entities/engine.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-03-12 10:49:03 -0700
committerJhon Honce <jhonce@redhat.com>2020-03-18 16:41:12 -0700
commitfbe743501e2a3ea28fe446754b9b12988b4e7a0e (patch)
tree7582c99d828bcbc83b6bb312e253f006ac637734 /pkg/domain/entities/engine.go
parentbd9386ddac4ef6730fbe6ce4104e80f56a48fe43 (diff)
downloadpodman-fbe743501e2a3ea28fe446754b9b12988b4e7a0e.tar.gz
podman-fbe743501e2a3ea28fe446754b9b12988b4e7a0e.tar.bz2
podman-fbe743501e2a3ea28fe446754b9b12988b4e7a0e.zip
V2 podman command
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/domain/entities/engine.go')
-rw-r--r--pkg/domain/entities/engine.go97
1 files changed, 97 insertions, 0 deletions
diff --git a/pkg/domain/entities/engine.go b/pkg/domain/entities/engine.go
new file mode 100644
index 000000000..a1096f1f1
--- /dev/null
+++ b/pkg/domain/entities/engine.go
@@ -0,0 +1,97 @@
+package entities
+
+import (
+ "net/url"
+ "os/user"
+ "path/filepath"
+
+ "github.com/containers/libpod/libpod/define"
+ "github.com/spf13/pflag"
+)
+
+type EngineMode string
+
+const (
+ ABIMode = EngineMode("abi")
+ TunnelMode = EngineMode("tunnel")
+)
+
+func (m EngineMode) String() string {
+ return string(m)
+}
+
+type EngineOptions struct {
+ Uri *url.URL
+ Identities []string
+ FlagSet pflag.FlagSet
+ Flags EngineFlags
+}
+
+type EngineFlags struct {
+ CGroupManager string
+ CniConfigDir string
+ ConmonPath string
+ DefaultMountsFile string
+ EventsBackend string
+ HooksDir []string
+ MaxWorks int
+ Namespace string
+ Root string
+ Runroot string
+ Runtime string
+ StorageDriver string
+ StorageOpts []string
+ Syslog bool
+ Trace bool
+ NetworkCmdPath string
+
+ Config string
+ CpuProfile string
+ LogLevel string
+ TmpDir string
+
+ RemoteUserName string
+ RemoteHost string
+ VarlinkAddress string
+ ConnectionName string
+ RemoteConfigFilePath string
+ Port int
+ IdentityFile string
+ IgnoreHosts bool
+
+ EngineMode EngineMode
+}
+
+func NewEngineOptions() (EngineFlags, error) {
+ u, _ := user.Current()
+ return EngineFlags{
+ CGroupManager: define.SystemdCgroupsManager,
+ CniConfigDir: "",
+ Config: "",
+ ConmonPath: filepath.Join("usr", "bin", "conmon"),
+ ConnectionName: "",
+ CpuProfile: "",
+ DefaultMountsFile: "",
+ EventsBackend: "",
+ HooksDir: nil,
+ IdentityFile: "",
+ IgnoreHosts: false,
+ LogLevel: "",
+ MaxWorks: 0,
+ Namespace: "",
+ NetworkCmdPath: "",
+ Port: 0,
+ RemoteConfigFilePath: "",
+ RemoteHost: "",
+ RemoteUserName: "",
+ Root: "",
+ Runroot: filepath.Join("run", "user", u.Uid),
+ Runtime: "",
+ StorageDriver: "overlayfs",
+ StorageOpts: nil,
+ Syslog: false,
+ TmpDir: filepath.Join("run", "user", u.Uid, "libpod", "tmp"),
+ Trace: false,
+ VarlinkAddress: "",
+ }, nil
+}