Documentation ¶
Index ¶
- Constants
- Variables
- func ParseFlags(fs *flag.FlagSet, args []string, withHelp bool) error
- func ParseHost(host string) (string, string, string, error)
- type APIClient
- type Client
- func (cli *Client) FirewallCreate(fw Firewall) (Firewall, error)
- func (cli *Client) FirewallDelete(name string) error
- func (cli *Client) FirewallList() ([]Firewall, error)
- func (cli *Client) FirewallShow(name string) ([]Firewall, error)
- func (cli *Client) GroupCreate(name string) (string, error)
- func (cli *Client) GroupDelete(name string) error
- func (cli *Client) GroupList() ([]string, error)
- func (cli *Client) GroupShow(name string) ([]string, error)
- func (cli *Client) MemberAdd(name, group string) error
- func (cli *Client) MemberRemove(name, group string) error
- func (cli *Client) PolicyDelete(peer string) error
- func (cli *Client) PolicyShow(peer string) (string, error)
- func (cli *Client) PolicyUpdate(peer, action string) error
- func (cli *Client) ResetContainer(container, node string) (string, error)
- func (cli *Client) ShowContainer(container string) ([]ContainerNetwork, error)
- type ContainerNetwork
- type DaoliCli
- func (cli *DaoliCli) CmdClear(args ...string) error
- func (cli *DaoliCli) CmdConnect(args ...string) error
- func (cli *DaoliCli) CmdContainer(args ...string) error
- func (cli *DaoliCli) CmdContainerMove(args ...string) error
- func (cli *DaoliCli) CmdContainerShownet(args ...string) error
- func (cli *DaoliCli) CmdDisconnect(args ...string) error
- func (cli *DaoliCli) CmdFirewall(args ...string) error
- func (cli *DaoliCli) CmdFirewallCreate(args ...string) error
- func (cli *DaoliCli) CmdFirewallDelete(args ...string) error
- func (cli *DaoliCli) CmdFirewallList(args ...string) error
- func (cli *DaoliCli) CmdFirewallShow(args ...string) error
- func (cli *DaoliCli) CmdGroup(args ...string) error
- func (cli *DaoliCli) CmdGroupCreate(args ...string) error
- func (cli *DaoliCli) CmdGroupDelete(args ...string) error
- func (cli *DaoliCli) CmdGroupList(args ...string) error
- func (cli *DaoliCli) CmdGroupShow(args ...string) error
- func (cli *DaoliCli) CmdMember(args ...string) error
- func (cli *DaoliCli) CmdMemberAdd(args ...string) error
- func (cli *DaoliCli) CmdMemberRm(args ...string) error
- func (cli *DaoliCli) CmdShow(args ...string) error
- func (cli *DaoliCli) CmdVersion(args ...string) (err error)
- func (cli *DaoliCli) Initialize() error
- type Firewall
Constants ¶
const ( DefaultVersion = "1.23" DefaultHost = "tcp://127.0.0.1:3380" )
const ( CONNECTED = "ACCEPT" DISCONNECTED = "DROP" )
Variables ¶
var ErrConnectionFailed = errors.New("Cannot connect to the Daolinet server. Is the daolinet server running on this host?")
ErrConnectionFailed is a error raised when the connection between the client and the server failed.
Functions ¶
Types ¶
type APIClient ¶
type APIClient interface { GroupList() ([]string, error) GroupShow(string) ([]string, error) GroupCreate(string) (string, error) GroupDelete(string) error MemberAdd(string, string) error MemberRemove(string, string) error PolicyShow(string) (string, error) PolicyUpdate(string, string) error PolicyDelete(string) error FirewallList() ([]Firewall, error) FirewallShow(string) ([]Firewall, error) FirewallCreate(Firewall) (Firewall, error) FirewallDelete(string) error ResetContainer(string, string) (string, error) ShowContainer(string) ([]ContainerNetwork, error) }
APIClient is an interface that clients that talk with a daolinet server must implement.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error)
NewClient initialize a new API client for the given host and API version.
func (*Client) FirewallDelete ¶
func (*Client) FirewallList ¶
func (*Client) GroupDelete ¶
func (*Client) MemberRemove ¶
func (*Client) PolicyDelete ¶
func (*Client) PolicyUpdate ¶
func (*Client) ResetContainer ¶
func (*Client) ShowContainer ¶
func (cli *Client) ShowContainer(container string) ([]ContainerNetwork, error)
type ContainerNetwork ¶
type DaoliCli ¶
type DaoliCli struct {
// contains filtered or unexported fields
}
DaoliCli represents the daolictl command line client. instances of the client can be returned from NewDaoliCli.
func NewDaoliCli ¶
func NewDaoliCli(in io.ReadCloser, out, err io.Writer, clientFlags *cli.ClientFlags) *DaoliCli
func (*DaoliCli) CmdConnect ¶
Usage: daolictl connect <CONTAINER:CONTAINER>
func (*DaoliCli) CmdContainer ¶
Usage: daolictl container
func (*DaoliCli) CmdContainerMove ¶
Usage: daolictl container move <CONTAINER>
func (*DaoliCli) CmdContainerShownet ¶
Usage: daolictl container shownet <CONTAINER>
func (*DaoliCli) CmdDisconnect ¶
Usage: daolictl disconnect <CONTAINER:CONTAINER>
func (*DaoliCli) CmdFirewall ¶
Usage: daolictl firewall <COMMAND> [OPTIONS]
func (*DaoliCli) CmdFirewallCreate ¶
Usage: daolictl firewall create <NAME> --rule <GATEWAYPORT:GATEWAYIP:SERVICEPORT> --container <CONTAINER>
func (*DaoliCli) CmdFirewallDelete ¶
Usage: daolictl firewall delete <FIREWALL-NAME>
func (*DaoliCli) CmdFirewallList ¶
Usage: daolictl firewall list
func (*DaoliCli) CmdFirewallShow ¶
Usage: daolictl firewall show <CONTAINER>
func (*DaoliCli) CmdGroup ¶
CmdGroup is the parent subcommand for all group commands
Usage: daolictl group <COMMAND> [OPTIONS]
func (*DaoliCli) CmdGroupCreate ¶
CmdGroupCreate creates a new group with a given name
Usage: daolictl group create <GROUP-NAME>
func (*DaoliCli) CmdGroupDelete ¶
CmdGroupDelete creates a new group with a given name
Usage: daolictl group delete <GROUP-NAME>
func (*DaoliCli) CmdGroupList ¶
CmdGroupList lists all the groups managed by daolictl
Usage: daolictl group list
func (*DaoliCli) CmdGroupShow ¶
Usage: daolictl group show <GROUP-NAME>
func (*DaoliCli) CmdMemberAdd ¶
Usage: daolictl member add <NETWORK-NAME> --group <GROUP-NAME>
func (*DaoliCli) CmdMemberRm ¶
Usage: daolictl member rm <NETWORK-NAME> --group <GROUP-NAME>
func (*DaoliCli) CmdVersion ¶
CmdVersion shows Daolictl version information Usage: daolictl version
func (*DaoliCli) Initialize ¶
Initialize calls the init function that will setup the configuration for the client such as the TLS, tcp and other parameters used to run the client.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Copy from github.com/docker/engine-api/client/transport/client.go
|
Copy from github.com/docker/engine-api/client/transport/client.go |
cancellable
Package cancellable provides helper function to cancel http requests.
|
Package cancellable provides helper function to cancel http requests. |