Documentation ¶
Index ¶
- type Client
- func (c *Client) GetNetworkStatus() (Status, error)
- func (c *Client) JoinNetwork(networkId string) (Network, error)
- func (c *Client) LeaveNetwork(networkId string) (LeaveNetwork, error)
- func (c *Client) MakeDeleteRequest(url string) ([]byte, error)
- func (c *Client) MakeGetRequest(url string) ([]byte, error)
- func (c *Client) MakePostRequest(url string, data io.Reader) ([]byte, error)
- type Join
- type LeaveNetwork
- type Network
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents a client for interacting with the ZeroTier API.
func NewClient ¶
NewClient creates a new instance of Client with the provided base URL and API token.
func (*Client) GetNetworkStatus ¶
func (*Client) LeaveNetwork ¶
func (c *Client) LeaveNetwork(networkId string) (LeaveNetwork, error)
func (*Client) MakeDeleteRequest ¶
makeDeleteRequest performs a DELETE request to the specified URL. It returns an error if any.
func (*Client) MakeGetRequest ¶
makeGetRequest performs a GET request to the specified URL. It returns the response body ([]byte) and an error if any.
type LeaveNetwork ¶
type LeaveNetwork struct {
Result bool `json:"result"`
}
type Network ¶
type Network struct { AllowDNS bool `json:"allowDNS"` AllowDefault bool `json:"allowDefault"` AllowManaged bool `json:"allowManaged"` AllowGlobal bool `json:"allowGlobal"` AssignedAddresses []string `json:"assignedAddresses"` Bridge bool `json:"bridge"` BroadcastEnabled bool `json:"broadcastEnabled"` DNS struct { Domain string `json:"domain"` Servers []string `json:"servers"` } `json:"dns"` ID string `json:"id"` Mac string `json:"mac"` Mtu int `json:"mtu"` MulticastSubscriptions []struct { Adi int `json:"adi"` Mac string `json:"mac"` } `json:"multicastSubscriptions"` AuthenticationURL string `json:"authenticationURL"` AuthenticationExpiryTime int `json:"authenticationExpiryTime"` Name string `json:"name"` NetconfRevision int `json:"netconfRevision"` PortDeviceName string `json:"portDeviceName"` PortError int `json:"portError"` Routes []struct { Flags int `json:"flags"` Metric int `json:"metric"` Target string `json:"target"` Via string `json:"via"` } `json:"routes"` Status string `json:"status"` Type string `json:"type"` Property1 interface{} `json:"property1"` Property2 interface{} `json:"property2"` }
type Status ¶
type Status struct { Address string `json:"address"` Clock int64 `json:"clock"` Config struct { Settings struct { AllowTCPFallbackRelay bool `json:"allowTcpFallbackRelay"` ForceTCPRelay bool `json:"forceTcpRelay"` ListeningOn []string `json:"listeningOn"` PortMappingEnabled bool `json:"portMappingEnabled"` PrimaryPort int `json:"primaryPort"` SecondaryPort int `json:"secondaryPort"` SoftwareUpdate string `json:"softwareUpdate"` SoftwareUpdateChannel string `json:"softwareUpdateChannel"` SurfaceAddresses []string `json:"surfaceAddresses"` TertiaryPort int `json:"tertiaryPort"` } `json:"settings"` } `json:"config"` Online bool `json:"online"` PlanetWorldID int `json:"planetWorldId"` PlanetWorldTimestamp int64 `json:"planetWorldTimestamp"` PublicIdentity string `json:"publicIdentity"` TCPFallbackActive bool `json:"tcpFallbackActive"` Version string `json:"version"` VersionBuild int `json:"versionBuild"` VersionMajor int `json:"versionMajor"` VersionMinor int `json:"versionMinor"` VersionRev int `json:"versionRev"` }
Click to show internal directories.
Click to hide internal directories.