discovery

package
v0.0.0-...-75e3e40 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Port      = 8000
	EDGE_NONE = -1
)

Variables

This section is empty.

Functions

func ReadError

func ReadError(i io.Reader) error

func WriteError

func WriteError(w io.Writer, r *http.Request, err error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(s string) *Client

func (*Client) Connect

func (c *Client) Connect(nnid, enid int, eidx int) (*minigraph.Endpoint, error)

func (*Client) DeleteConfig

func (c *Client) DeleteConfig(k string) error

func (*Client) DeleteEndpoints

func (c *Client) DeleteEndpoints(k, v string) ([]*minigraph.Endpoint, error)

func (*Client) DeleteNetworks

func (c *Client) DeleteNetworks(k, v string) ([]*minigraph.Network, error)

func (*Client) Disconnect

func (c *Client) Disconnect(nnid, enid int) (*minigraph.Endpoint, error)

func (*Client) GetConfig

func (c *Client) GetConfig() (map[string]string, error)

func (*Client) GetEndpoint

func (c *Client) GetEndpoint(k, v string) (*minigraph.Endpoint, error)

GetEndpoint wraps GetEndpoints and returns the first node that matches or an error if more than one node matches.

func (*Client) GetEndpoints

func (c *Client) GetEndpoints(k, v string) ([]*minigraph.Endpoint, error)

GetEndpoints returns endpoints by search terms, or all endpoints. If k,v are empty, return all endpoints. If only v is set, do a freeform search on all endpoints, if k is set, search for v on the key k. Endpoints will be sorted by ID.

func (*Client) GetNetworks

func (c *Client) GetNetworks(k, v string) ([]*minigraph.Network, error)

Get networks by search terms, or all networks. If k,v are empty, return all networks. If only v is set, do a freeform search on all networks, if k is set, search for v on the key k. Networks will be sorted by ID.

func (*Client) InsertEndpoints

func (c *Client) InsertEndpoints(e ...*minigraph.Endpoint) ([]*minigraph.Endpoint, error)

func (*Client) InsertNetworks

func (c *Client) InsertNetworks(n ...*minigraph.Network) ([]*minigraph.Network, error)

func (*Client) Load

func (c *Client) Load(path string) error

func (*Client) Neighbors

func (c *Client) Neighbors(k, v string) ([]minigraph.Node, error)

func (*Client) Save

func (c *Client) Save(path string) error

func (*Client) SetConfig

func (c *Client) SetConfig(k, v string) error

func (*Client) UpdateEndpoints

func (c *Client) UpdateEndpoints(e ...*minigraph.Endpoint) ([]*minigraph.Endpoint, error)

func (*Client) UpdateNetworks

func (c *Client) UpdateNetworks(n ...*minigraph.Network) ([]*minigraph.Network, error)

Jump to

Keyboard shortcuts

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