client

package
v0.0.0-...-48b11af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE       = iota
	URL        = iota
	DOCKER_NS  = iota
	DOCKER_RUN = iota
	CHILD      = iota
	CHAIN      = iota
	REMOTE     = iota
	TUNNEL     = iota
	UDPTUNNEL  = iota
)

Variables

View Source
var CommandName = []string{
	NONE:       "none",
	DOCKER_NS:  "docker-ns",
	DOCKER_RUN: "docker-run",
	CHILD:      "child",
	CHAIN:      "chain",
	REMOTE:     "remote",
	TUNNEL:     "tunnel",
	URL:        "url",
}

Functions

This section is empty.

Types

type BuildTunnelArgs

type BuildTunnelArgs struct {
	Dst    net.IP
	Tunnel *Tunnel
}

type BuildTunnelReply

type BuildTunnelReply struct {
	Src    net.IP
	Tunnel *Tunnel
}

type Client

type Client struct {
	RpcClient *rpc.Client
}

func NewClient

func NewClient(host string, config *tls.Config) (*Client, error)

func (*Client) BuildTunnel

func (c *Client) BuildTunnel(dst net.IP, tunnel *Tunnel) (net.IP, *Tunnel, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateSegment

func (c *Client) CreateSegment(id string, init []SegmentCommand, trig []SegmentCommand) (string, error)

func (*Client) CreateTunnel

func (c *Client) CreateTunnel(host string, udp bool) (net.IP, net.IP, error)

func (*Client) DeleteSegment

func (c *Client) DeleteSegment(id string) error

func (*Client) DeleteTunnel

func (c *Client) DeleteTunnel(host string) error

func (*Client) DestroyTunnel

func (c *Client) DestroyTunnel(dst net.IP) (net.IP, error)

func (*Client) Echo

func (c *Client) Echo(value []byte, host string) ([]byte, error)

func (*Client) GetSrcIP

func (c *Client) GetSrcIP(dst net.IP) (net.IP, error)

type CreateSegmentArgs

type CreateSegmentArgs struct {
	Id   string
	Init []SegmentCommand
	Trig []SegmentCommand
}

type CreateSegmentReply

type CreateSegmentReply struct {
	Url string
}

type CreateTunnelArgs

type CreateTunnelArgs struct {
	Host string
	Udp  bool
}

type CreateTunnelReply

type CreateTunnelReply struct {
	Src net.IP
	Dst net.IP
}

type DeleteSegmentArgs

type DeleteSegmentArgs struct {
	Id string
}

type DeleteSegmentReply

type DeleteSegmentReply struct {
}

type DeleteTunnelArgs

type DeleteTunnelArgs struct {
	Host string
}

type DeleteTunnelReply

type DeleteTunnelReply struct {
}

type DestroyTunnelArgs

type DestroyTunnelArgs struct {
	Dst net.IP
}

type DestroyTunnelReply

type DestroyTunnelReply struct {
	Src   net.IP
	Error error
}

DestroyTunnel has no reply value

type EchoArgs

type EchoArgs struct {
	Value []byte
	Host  string
}

type EchoReply

type EchoReply struct {
	Value []byte
}

type GetSrcIPArgs

type GetSrcIPArgs struct {
	Dst net.IP
}

type GetSrcIPReply

type GetSrcIPReply struct {
	Src net.IP
}

type SegmentCommand

type SegmentCommand struct {
	Type      int
	Tail      bool
	Arg       string
	ChildInit []SegmentCommand
	ChildTrig []SegmentCommand
}

func (*SegmentCommand) AddInit

func (s *SegmentCommand) AddInit(c *SegmentCommand)

func (*SegmentCommand) AddTrig

func (s *SegmentCommand) AddTrig(c *SegmentCommand)

type Tunnel

type Tunnel struct {
	Reqid   int
	AuthKey []byte
	EncKey  []byte
	Src     net.IP
	Dst     net.IP
	SrcPort int
	DstPort int
}

func (Tunnel) Equal

func (t Tunnel) Equal(o *Tunnel) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL