github.com/containers/podman/v4@v4.9.4/pkg/bindings/network/types.go (about)

     1  package network
     2  
     3  import (
     4  	"net"
     5  )
     6  
     7  // CreateOptions are optional options for creating networks
     8  //
     9  //go:generate go run ../generator/generator.go CreateOptions
    10  type CreateOptions struct {
    11  	// DisableDNS turns off use of DNSMasq for name resolution
    12  	// on the network
    13  	DisableDNS *bool
    14  	// Driver is the name of network driver
    15  	Driver *string
    16  	// Gateway of the network
    17  	Gateway *net.IP
    18  	// Internal turns off communication outside the networking
    19  	// being created
    20  	Internal *bool
    21  	// Labels are metadata that can be associated with the network
    22  	Labels map[string]string
    23  	// MacVLAN is the name of the macvlan network to associate with
    24  	MacVLAN *string
    25  	// Range is the CIDR description of leasable IP addresses
    26  	IPRange *net.IPNet `scheme:"range"`
    27  	// Subnet to use
    28  	Subnet *net.IPNet
    29  	// IPv6 means the network is ipv6 capable
    30  	IPv6 *bool
    31  	// Options are a mapping of driver options and values.
    32  	Options map[string]string
    33  	// Name of the network
    34  	Name *string
    35  }
    36  
    37  // InspectOptions are optional options for inspecting networks
    38  //
    39  //go:generate go run ../generator/generator.go InspectOptions
    40  type InspectOptions struct {
    41  }
    42  
    43  // RemoveOptions are optional options for inspecting networks
    44  //
    45  //go:generate go run ../generator/generator.go RemoveOptions
    46  type RemoveOptions struct {
    47  	// Force removes the network even if it is being used
    48  	Force   *bool
    49  	Timeout *uint
    50  }
    51  
    52  // ListOptions are optional options for listing networks
    53  //
    54  //go:generate go run ../generator/generator.go ListOptions
    55  type ListOptions struct {
    56  	// Filters are applied to the list of networks to be more
    57  	// specific on the output
    58  	Filters map[string][]string
    59  }
    60  
    61  // NetworkUpdateOptions describes options to update a network
    62  //
    63  //go:generate go run ../generator/generator.go UpdateOptions
    64  type UpdateOptions struct {
    65  	AddDNSServers    []string `json:"adddnsservers"`
    66  	RemoveDNSServers []string `json:"removednsservers"`
    67  }
    68  
    69  // DisconnectOptions are optional options for disconnecting
    70  // containers from a network
    71  //
    72  //go:generate go run ../generator/generator.go DisconnectOptions
    73  type DisconnectOptions struct {
    74  	// Force indicates to remove the container from
    75  	// the network forcibly
    76  	Force *bool
    77  }
    78  
    79  // ExistsOptions are optional options for checking
    80  // if a network exists
    81  //
    82  //go:generate go run ../generator/generator.go ExistsOptions
    83  type ExistsOptions struct {
    84  }
    85  
    86  // PruneOptions are optional options for removing unused
    87  // networks
    88  //
    89  //go:generate go run ../generator/generator.go PruneOptions
    90  type PruneOptions struct {
    91  	// Filters are applied to the prune of networks to be more
    92  	// specific on choosing
    93  	Filters map[string][]string
    94  }
    95  
    96  // ExtraCreateOptions are optional additional configuration flags for creating Networks
    97  // that are not part of the network configuration
    98  //
    99  //go:generate go run ../generator/generator.go ExtraCreateOptions
   100  type ExtraCreateOptions struct {
   101  	// IgnoreIfExists if true, do not fail if the network already exists
   102  	IgnoreIfExists *bool `schema:"ignoreIfExists"`
   103  }