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) PolicyCreate(peer string) error
- func (cli *Client) PolicyDelete(peer string) error
- func (cli *Client) PolicyList() ([]string, error)
- type DaoliCli
- func (cli *DaoliCli) CmdCut(args ...string) error
- func (cli *DaoliCli) CmdCutls(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) CmdPolicy(args ...string) error
- func (cli *DaoliCli) CmdUncut(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" )
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 PolicyList() ([]string, error) PolicyCreate(string) error PolicyDelete(string) error FirewallList() ([]Firewall, error) FirewallShow(string) ([]Firewall, error) FirewallCreate(Firewall) (Firewall, error) FirewallDelete(string) 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) PolicyCreate ¶
func (*Client) PolicyDelete ¶
func (*Client) PolicyList ¶
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) CmdCut ¶
// Usage: daolictl policy create <CONTAINER:CONTAINER>
func (cli *DaoliCli) CmdPolicyCreate(args ...string) error { cmd := Cli.Subcmd("policy create", []string{"CONTAINER:CONTAINER"}, "Creates a policy with container peer", false)
Usage: daolictl cut <CONTAINER:CONTAINER>
func (*DaoliCli) CmdCutls ¶
//Usage: daolictl policy list
func (cli *DaoliCli) CmdPolicyList(args ...string) error { cmd := Cli.Subcmd("policy list", nil, "Lists policies", true)
Usage: daolictl cutls
func (*DaoliCli) CmdFirewall ¶
Usage: daolictl firewall <COMMAND> [OPTIONS]
func (*DaoliCli) CmdFirewallCreate ¶
Usage: daolictl firewall create <NAME> --rule <GATEWAYPORT: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) CmdUncut ¶
// Usage: daolictl policy delete <CONTAINER:CONTAINER>
func (cli *DaoliCli) CmdPolicyDelete(args ...string) error { cmd := Cli.Subcmd("policy delete", []string{"CONTAINER:CONTAINER"}, "Delete a policy with container peer", false)
Usage: daolictl uncut <CONTAINER:CONTAINER>
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. |