Documentation ¶
Index ¶
- type Client
- type FakeClient
- func (c *FakeClient) Add(network, description string, tags []string) error
- func (c *FakeClient) Assign(supernet, description string, cidr int, tags []string) (network1 Network, err error)
- func (c *FakeClient) Delete(network string) error
- func (c *FakeClient) Get(network string) (Network, error)
- func (c *FakeClient) List(supernet string) (networks []Network, err error)
- func (c *FakeClient) Reset() error
- func (c *FakeClient) Search(description string, exact bool) (networks []Network, err error)
- func (c *FakeClient) String() string
- type FakeSupernet
- type Network
- type WebClient
- func (c *WebClient) Add(network, description string, tags []string) error
- func (c *WebClient) Assign(supernet, description string, cidr int, tags []string) (network1 Network, err error)
- func (c *WebClient) Delete(network string) (err error)
- func (c *WebClient) Get(network string) (network1 Network, err error)
- func (c *WebClient) List(supernet string) (networks []Network, err error)
- func (c *WebClient) Reset() error
- func (c *WebClient) Search(description string, exact bool) (networks []Network, err error)
- func (c *WebClient) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Get(network string) (Network, error) List(supernet string) ([]Network, error) Assign(supernet string, description string, cidr int, tags []string) (Network, error) Delete(network string) error Add(network, description string, tags []string) error Search(description string, exact bool) ([]Network, error) Reset() error String() string }
type FakeClient ¶
type FakeClient struct { UseFirst bool Supernets map[string]*FakeSupernet Added map[string]Network }
A very simple and limited client for unit tests.
func NewFakeClientUsesFirst ¶
func NewFakeClientUsesFirst() *FakeClient
Create a new HaCi fake client that assigns the first (network address) of a network.
func (*FakeClient) Delete ¶
func (c *FakeClient) Delete(network string) error
func (*FakeClient) List ¶
func (c *FakeClient) List(supernet string) (networks []Network, err error)
func (*FakeClient) Reset ¶
func (c *FakeClient) Reset() error
func (*FakeClient) Search ¶
func (c *FakeClient) Search(description string, exact bool) (networks []Network, err error)
func (*FakeClient) String ¶
func (c *FakeClient) String() string
type FakeSupernet ¶
type Network ¶
Click to show internal directories.
Click to hide internal directories.