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

     1  package entities
     2  
     3  import (
     4  	"net"
     5  
     6  	buildahDefine "github.com/containers/buildah/define"
     7  	"github.com/containers/common/libnetwork/types"
     8  	"github.com/hanks177/podman/v4/libpod/define"
     9  	"github.com/hanks177/podman/v4/libpod/events"
    10  	"github.com/hanks177/podman/v4/pkg/specgen"
    11  	"github.com/containers/storage/pkg/archive"
    12  	dockerAPI "github.com/docker/docker/api/types"
    13  )
    14  
    15  type Container struct {
    16  	IDOrNamed
    17  }
    18  
    19  type Volume struct {
    20  	Identifier
    21  }
    22  
    23  type Report struct {
    24  	Id  []string // nolint
    25  	Err map[string]error
    26  }
    27  
    28  type PodDeleteReport struct{ Report }
    29  
    30  type (
    31  	VolumeDeleteOptions struct{}
    32  	VolumeDeleteReport  struct{ Report }
    33  )
    34  
    35  type NetFlags struct {
    36  	AddHosts     []string `json:"add-host,omitempty"`
    37  	DNS          []string `json:"dns,omitempty"`
    38  	DNSOpt       []string `json:"dns-opt,omitempty"`
    39  	DNDSearch    []string `json:"dns-search,omitempty"`
    40  	MacAddr      string   `json:"mac-address,omitempty"`
    41  	Publish      []string `json:"publish,omitempty"`
    42  	IP           string   `json:"ip,omitempty"`
    43  	NoHosts      bool     `json:"no-hosts,omitempty"`
    44  	Network      string   `json:"network,omitempty"`
    45  	NetworkAlias []string `json:"network-alias,omitempty"`
    46  }
    47  
    48  // NetOptions reflect the shared network options between
    49  // pods and containers
    50  type NetOptions struct {
    51  	AddHosts           []string                           `json:"hostadd,omitempty"`
    52  	Aliases            []string                           `json:"network_alias,omitempty"`
    53  	Networks           map[string]types.PerNetworkOptions `json:"networks,omitempty"`
    54  	UseImageResolvConf bool                               `json:"no_manage_resolv_conf,omitempty"`
    55  	DNSOptions         []string                           `json:"dns_option,omitempty"`
    56  	DNSSearch          []string                           `json:"dns_search,omitempty"`
    57  	DNSServers         []net.IP                           `json:"dns_server,omitempty"`
    58  	Network            specgen.Namespace                  `json:"netns,omitempty"`
    59  	NoHosts            bool                               `json:"no_manage_hosts,omitempty"`
    60  	PublishPorts       []types.PortMapping                `json:"portmappings,omitempty"`
    61  	// NetworkOptions are additional options for each network
    62  	NetworkOptions map[string][]string `json:"network_options,omitempty"`
    63  }
    64  
    65  // InspectOptions all CLI inspect commands and inspect sub-commands use the same options
    66  type InspectOptions struct {
    67  	// Format - change the output to JSON or a Go template.
    68  	Format string `json:",omitempty"`
    69  	// Latest - inspect the latest container Podman is aware of.
    70  	Latest bool `json:",omitempty"`
    71  	// Size (containers only) - display total file size.
    72  	Size bool `json:",omitempty"`
    73  	// Type -- return JSON for specified type.
    74  	Type string `json:",omitempty"`
    75  	// All -- inspect all
    76  	All bool `json:",omitempty"`
    77  }
    78  
    79  // DiffOptions all API and CLI diff commands and diff sub-commands use the same options
    80  type DiffOptions struct {
    81  	Format string          `json:",omitempty"` // CLI only
    82  	Latest bool            `json:",omitempty"` // API and CLI, only supported by containers
    83  	Type   define.DiffType // Type which should be compared
    84  }
    85  
    86  // DiffReport provides changes for object
    87  type DiffReport struct {
    88  	Changes []archive.Change
    89  }
    90  
    91  type EventsOptions struct {
    92  	FromStart bool
    93  	EventChan chan *events.Event
    94  	Filter    []string
    95  	Stream    bool
    96  	Since     string
    97  	Until     string
    98  }
    99  
   100  // ContainerCreateResponse is the response struct for creating a container
   101  type ContainerCreateResponse struct {
   102  	// ID of the container created
   103  	// required: true
   104  	ID string `json:"Id"`
   105  	// Warnings during container creation
   106  	// required: true
   107  	Warnings []string `json:"Warnings"`
   108  }
   109  
   110  // BuildOptions describe the options for building container images.
   111  type BuildOptions struct {
   112  	buildahDefine.BuildOptions
   113  }
   114  
   115  // BuildReport is the image-build report.
   116  type BuildReport struct {
   117  	// ID of the image.
   118  	ID string
   119  }
   120  
   121  type IDOrNameResponse struct {
   122  	// The Id or Name of an object
   123  	IDOrName string
   124  }
   125  
   126  // swagger:model
   127  type IDResponse dockerAPI.IDResponse