Documentation ¶
Overview ¶
Package ztcontrollers provides a high-level client for management of Zerotier network controllers
Index ¶
- type Cache
- func (c *Cache) GetAddressByServer(server string) (string, bool, error)
- func (c *Cache) GetControllerByAddress(address string) (*Controller, bool, error)
- func (c *Cache) GetNetworkIDsByServer(server string) ([]string, error)
- func (c *Cache) SetAddressByServer(server string, address string, networkCostWeight float32) error
- func (c *Cache) SetControllerByAddress(address string, ztController Controller) error
- func (c *Cache) SetNetworkIDsByServer(server string, networkIDs []string, costWeight float32) error
- func (c *Cache) UnsetAddressByServer(server string)
- func (c *Cache) UnsetControllerByAddress(address string)
- func (c *Cache) UnsetNetworkIDsByServer(server string)
- type Client
- func (c *Client) FindController(name string) (*Controller, error)
- func (c *Client) FindControllerByAddress(ctx context.Context, address string) (*Controller, error)
- func (c *Client) GetAddress(ctx context.Context, controller Controller) (string, error)
- func (c *Client) GetControllers() ([]Controller, error)
- func (c *Client) ScanControllers(ctx context.Context, controllers []Controller) ([]string, error)
- type Config
- type Controller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Cache clientcache.Cache
}
func (*Cache) GetAddressByServer ¶
func (*Cache) GetControllerByAddress ¶
func (c *Cache) GetControllerByAddress(address string) (*Controller, bool, error)
func (*Cache) GetNetworkIDsByServer ¶
func (*Cache) SetAddressByServer ¶
func (*Cache) SetControllerByAddress ¶
func (c *Cache) SetControllerByAddress(address string, ztController Controller) error
func (*Cache) SetNetworkIDsByServer ¶
func (*Cache) UnsetAddressByServer ¶
func (*Cache) UnsetControllerByAddress ¶
func (*Cache) UnsetNetworkIDsByServer ¶
type Client ¶
func (*Client) FindController ¶
func (c *Client) FindController(name string) (*Controller, error)
func (*Client) FindControllerByAddress ¶
func (*Client) GetAddress ¶
func (*Client) GetControllers ¶
func (c *Client) GetControllers() ([]Controller, error)
func (*Client) ScanControllers ¶
type Config ¶
type Config struct {
Controller Controller
}
type Controller ¶
type Controller struct { Server string `json:"server"` Name string `json:"name"` // Must be unique for display purposes! Description string `json:"description"` Authtoken string `json:"authtoken"` NetworkCostWeight float32 `json:"local"` }
func GetController ¶
func GetController() (c Controller, err error)
func (Controller) NewClient ¶
func (c Controller) NewClient() (*zerotier.ClientWithResponses, error)
Click to show internal directories.
Click to hide internal directories.