converge: github.com/asteris-llc/converge/resource/docker/network Index | Files

package network

import "github.com/asteris-llc/converge/resource/docker/network"

Index

Package Files

network.go preparer.go

type IPAMConfigs Uses

type IPAMConfigs []dc.IPAMConfig

IPAMConfigs is a slice of dc.IPAMConfig

func (IPAMConfigs) Len Uses

func (ic IPAMConfigs) Len() int

Len implements the sort interface for IPAMConfigs

func (IPAMConfigs) Less Uses

func (ic IPAMConfigs) Less(i, j int) bool

Less implements the sort interface for IPAMConfigs

func (IPAMConfigs) String Uses

func (ic IPAMConfigs) String() string

IPAMConfigString returns a string representation of the IPAMConfigs slice

func (IPAMConfigs) Swap Uses

func (ic IPAMConfigs) Swap(i, j int)

Swap implements the sort interface for IPAMConfigs

type Network Uses

type Network struct {

    // name of the network
    Name string `export:"name"`

    // network drive configured in the hcl
    Driver string `export:"driver"`

    // labels set on the network
    Labels map[string]string `export:"labels"`

    // driver-specific options that have been configured
    Options map[string]interface{} `export:"options"`

    // docker client IPAM options
    IPAM dc.IPAMOptions `export:"ipam"`

    // restricted to internal networking
    Internal bool `export:"internal"`

    // uses ipv6
    IPv6 bool `export:"ipv6"`

    // the configured state
    State State `export:"state"`

    // true if 'force' was specified in the hcl
    Force bool `export:"force"`
    // contains filtered or unexported fields
}

Network is responsible for managing docker networks

func (*Network) Apply Uses

func (n *Network) Apply(context.Context) (resource.TaskStatus, error)

Apply ensures the network matches the desired state

func (*Network) Check Uses

func (n *Network) Check(context.Context, resource.Renderer) (resource.TaskStatus, error)

Check system for docker network

func (*Network) SetClient Uses

func (n *Network) SetClient(client docker.NetworkClient)

SetClient injects a docker api client

type Preparer Uses

type Preparer struct {
    // name of the network
    Name string `hcl:"name" required:"true" nonempty:"true"`

    // network driver. default: bridge
    Driver string `hcl:"driver"`

    // labels to set on the network
    Labels map[string]string `hcl:"labels"`

    // driver specific options
    Options map[string]interface{} `hcl:"options"`

    // ip address management driver. default: default
    IPAMDriver string `hcl:"ipam_driver"`

    // optional custom IPAM configuration. multiple IPAM configurations are
    // permitted. Each IPAM configuration block should contain one or more of the
    // following items:
    //
    //   * subnet:      subnet in CIDR format
    //   * gateway:     ipv4 or ipv6 gateway for the corresponding subnet
    //   * ip_range:    container ips are allocated from this sub-ranges (CIDR format)
    //   * aux_address: auxiliary ipv4 or ipv6 addresses used by the network driver.
    //                  Aux addresses are specified as a map with a name key and an IP
    //                  address value
    IPAMConfig []ipamConfigMap `hcl:"ipam_config"`

    // restricts external access to the network
    Internal bool `hcl:"internal"`

    // enable ipv6 networking
    IPv6 bool `hcl:"ipv6"`

    // indicates whether the network should exist. default: present
    State State `hcl:"state" valid_values:"present,absent"`

    // indicates whether or not the network will be recreated if the state is not
    // what is expected. By default, the module will only check to see if the
    // network exists. Specified as a boolean value
    Force bool `hcl:"force"`
}

Preparer for docker networks

Network is responsible for managing Docker networks. It assumes that there is already a Docker daemon running on the system. *Note: docker resources are not currently supported on Solaris.*

func (*Preparer) Prepare Uses

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare a docker network

type State Uses

type State string

State type for Network

const (
    // StatePresent indicates the network should be present
    StatePresent State = "present"

    // StateAbsent indicates the network should be absent
    StateAbsent State = "absent"

    // DefaultDriver is the default network driver
    DefaultDriver = "bridge"

    // DefaultIPAMDriver is the default IPAM driver
    DefaultIPAMDriver = "default"
)

Package network imports 10 packages (graph) and is imported by 1 packages. Updated 2017-01-13. Refresh now. Tools for package owners.