service

package
v0.0.0-...-3f4ad0c Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package service provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.

Index

Constants

View Source
const (
	ApiKeyAuthScopes = "ApiKeyAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewDeleteNetworkRequest

func NewDeleteNetworkRequest(server string, networkID string) (*http.Request, error)

NewDeleteNetworkRequest generates requests for DeleteNetwork

func NewGetNetworkRequest

func NewGetNetworkRequest(server string, networkID string) (*http.Request, error)

NewGetNetworkRequest generates requests for GetNetwork

func NewGetNetworksRequest

func NewGetNetworksRequest(server string) (*http.Request, error)

NewGetNetworksRequest generates requests for GetNetworks

func NewGetPeerRequest

func NewGetPeerRequest(server string, address string) (*http.Request, error)

NewGetPeerRequest generates requests for GetPeer

func NewGetPeersRequest

func NewGetPeersRequest(server string) (*http.Request, error)

NewGetPeersRequest generates requests for GetPeers

func NewGetStatusRequest

func NewGetStatusRequest(server string) (*http.Request, error)

NewGetStatusRequest generates requests for GetStatus

func NewUpdateNetworkRequest

func NewUpdateNetworkRequest(server string, networkID string, body UpdateNetworkJSONRequestBody) (*http.Request, error)

NewUpdateNetworkRequest calls the generic UpdateNetwork builder with application/json body

func NewUpdateNetworkRequestWithBody

func NewUpdateNetworkRequestWithBody(server string, networkID string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateNetworkRequestWithBody generates requests for UpdateNetwork with any type of body

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) DeleteNetwork

func (c *Client) DeleteNetwork(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetNetwork

func (c *Client) GetNetwork(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetNetworks

func (c *Client) GetNetworks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPeer

func (c *Client) GetPeer(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPeers

func (c *Client) GetPeers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateNetwork

func (c *Client) UpdateNetwork(ctx context.Context, networkID string, body UpdateNetworkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateNetworkWithBody

func (c *Client) UpdateNetworkWithBody(ctx context.Context, networkID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetNetworks request
	GetNetworks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteNetwork request
	DeleteNetwork(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetNetwork request
	GetNetwork(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateNetwork request  with any body
	UpdateNetworkWithBody(ctx context.Context, networkID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateNetwork(ctx context.Context, networkID string, body UpdateNetworkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPeers request
	GetPeers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPeer request
	GetPeer(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetStatus request
	GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) DeleteNetworkWithResponse

func (c *ClientWithResponses) DeleteNetworkWithResponse(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*DeleteNetworkResponse, error)

DeleteNetworkWithResponse request returning *DeleteNetworkResponse

func (*ClientWithResponses) GetNetworkWithResponse

func (c *ClientWithResponses) GetNetworkWithResponse(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*GetNetworkResponse, error)

GetNetworkWithResponse request returning *GetNetworkResponse

func (*ClientWithResponses) GetNetworksWithResponse

func (c *ClientWithResponses) GetNetworksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetNetworksResponse, error)

GetNetworksWithResponse request returning *GetNetworksResponse

func (*ClientWithResponses) GetPeerWithResponse

func (c *ClientWithResponses) GetPeerWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetPeerResponse, error)

GetPeerWithResponse request returning *GetPeerResponse

func (*ClientWithResponses) GetPeersWithResponse

func (c *ClientWithResponses) GetPeersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPeersResponse, error)

GetPeersWithResponse request returning *GetPeersResponse

func (*ClientWithResponses) GetStatusWithResponse

func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)

GetStatusWithResponse request returning *GetStatusResponse

func (*ClientWithResponses) UpdateNetworkWithBodyWithResponse

func (c *ClientWithResponses) UpdateNetworkWithBodyWithResponse(ctx context.Context, networkID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateNetworkResponse, error)

UpdateNetworkWithBodyWithResponse request with arbitrary body returning *UpdateNetworkResponse

func (*ClientWithResponses) UpdateNetworkWithResponse

func (c *ClientWithResponses) UpdateNetworkWithResponse(ctx context.Context, networkID string, body UpdateNetworkJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateNetworkResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetNetworks request
	GetNetworksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetNetworksResponse, error)

	// DeleteNetwork request
	DeleteNetworkWithResponse(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*DeleteNetworkResponse, error)

	// GetNetwork request
	GetNetworkWithResponse(ctx context.Context, networkID string, reqEditors ...RequestEditorFn) (*GetNetworkResponse, error)

	// UpdateNetwork request  with any body
	UpdateNetworkWithBodyWithResponse(ctx context.Context, networkID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateNetworkResponse, error)

	UpdateNetworkWithResponse(ctx context.Context, networkID string, body UpdateNetworkJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateNetworkResponse, error)

	// GetPeers request
	GetPeersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPeersResponse, error)

	// GetPeer request
	GetPeerWithResponse(ctx context.Context, address string, reqEditors ...RequestEditorFn) (*GetPeerResponse, error)

	// GetStatus request
	GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type DeleteNetworkResponse

type DeleteNetworkResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDeleteNetworkResponse

func ParseDeleteNetworkResponse(rsp *http.Response) (*DeleteNetworkResponse, error)

ParseDeleteNetworkResponse parses an HTTP response from a DeleteNetworkWithResponse call

func (DeleteNetworkResponse) Status

func (r DeleteNetworkResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteNetworkResponse) StatusCode

func (r DeleteNetworkResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetNetworkResponse

type GetNetworkResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Network
}

func ParseGetNetworkResponse

func ParseGetNetworkResponse(rsp *http.Response) (*GetNetworkResponse, error)

ParseGetNetworkResponse parses an HTTP response from a GetNetworkWithResponse call

func (GetNetworkResponse) Status

func (r GetNetworkResponse) Status() string

Status returns HTTPResponse.Status

func (GetNetworkResponse) StatusCode

func (r GetNetworkResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetNetworksResponse

type GetNetworksResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Network
}

func ParseGetNetworksResponse

func ParseGetNetworksResponse(rsp *http.Response) (*GetNetworksResponse, error)

ParseGetNetworksResponse parses an HTTP response from a GetNetworksWithResponse call

func (GetNetworksResponse) Status

func (r GetNetworksResponse) Status() string

Status returns HTTPResponse.Status

func (GetNetworksResponse) StatusCode

func (r GetNetworksResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPeerResponse

type GetPeerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Peer
}

func ParseGetPeerResponse

func ParseGetPeerResponse(rsp *http.Response) (*GetPeerResponse, error)

ParseGetPeerResponse parses an HTTP response from a GetPeerWithResponse call

func (GetPeerResponse) Status

func (r GetPeerResponse) Status() string

Status returns HTTPResponse.Status

func (GetPeerResponse) StatusCode

func (r GetPeerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPeersResponse

type GetPeersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Peer
}

func ParseGetPeersResponse

func ParseGetPeersResponse(rsp *http.Response) (*GetPeersResponse, error)

ParseGetPeersResponse parses an HTTP response from a GetPeersWithResponse call

func (GetPeersResponse) Status

func (r GetPeersResponse) Status() string

Status returns HTTPResponse.Status

func (GetPeersResponse) StatusCode

func (r GetPeersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetStatusResponse

type GetStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Status
}

func ParseGetStatusResponse

func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error)

ParseGetStatusResponse parses an HTTP response from a GetStatusWithResponse call

func (GetStatusResponse) Status

func (r GetStatusResponse) Status() string

Status returns HTTPResponse.Status

func (GetStatusResponse) StatusCode

func (r GetStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Network

type Network struct {

	// Let ZeroTier modify the system's DNS settings
	AllowDNS *bool `json:"allowDNS,omitempty"`

	// Let ZeroTier to modify the system's default route.
	AllowDefault *bool `json:"allowDefault,omitempty"`

	// Let ZeroTier to manage IP addresses and Route assignments that aren't in private ranges (rfc1918).
	AllowGlobal *bool `json:"allowGlobal,omitempty"`

	// Let ZeroTier to manage IP addresses and Route assignments.
	AllowManaged *bool `json:"allowManaged,omitempty"`

	AssignedAddresses *[]string `json:"assignedAddresses,omitempty"`
	Bridge            *bool     `json:"bridge,omitempty"`
	BroadcastEnabled  *bool     `json:"broadcastEnabled,omitempty"`
	Dns               *struct {
		Domain  *string   `json:"domain,omitempty"`
		Servers *[]string `json:"servers,omitempty"`
	} `json:"dns,omitempty"`
	Id *string `json:"id,omitempty"`

	// MAC address for this network's interface
	Mac                    *string `json:"mac,omitempty"`
	Mtu                    *int    `json:"mtu,omitempty"`
	MulticastSubscriptions *[]struct {
		Adi *int64  `json:"adi,omitempty"`
		Mac *string `json:"mac,omitempty"`
	} `json:"multicastSubscriptions,omitempty"`
	Name            *string  `json:"name,omitempty"`
	NetconfRevision *int     `json:"netconfRevision,omitempty"`
	PortDeviceName  *string  `json:"portDeviceName,omitempty"`
	PortError       *float32 `json:"portError,omitempty"`
	Routes          *[]struct {
		Flags  *float32 `json:"flags,omitempty"`
		Metric *float32 `json:"metric,omitempty"`
		Target *string  `json:"target,omitempty"`
		Via    *string  `json:"via,omitempty"`
	} `json:"routes,omitempty"`
	Status *string `json:"status,omitempty"`
	Type   *string `json:"type,omitempty"`
}

Network defines model for Network.

type Peer

type Peer struct {
	Address  *string `json:"address,omitempty"`
	IsBonded *bool   `json:"isBonded,omitempty"`
	Latency  *int    `json:"latency,omitempty"`
	Paths    *[]struct {
		Active        *bool   `json:"active,omitempty"`
		Address       *string `json:"address,omitempty"`
		Expired       *bool   `json:"expired,omitempty"`
		LastReceive   *int    `json:"lastReceive,omitempty"`
		LastSend      *int    `json:"lastSend,omitempty"`
		Preferred     *bool   `json:"preferred,omitempty"`
		TrustedPathId *int    `json:"trustedPathId,omitempty"`
	} `json:"paths,omitempty"`
	Role         *string `json:"role,omitempty"`
	Version      *string `json:"version,omitempty"`
	VersionMajor *int    `json:"versionMajor,omitempty"`
	VersionMinor *int    `json:"versionMinor,omitempty"`
	VersionRev   *int    `json:"versionRev,omitempty"`
}

Peer defines model for Peer.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Status

type Status struct {
	Address *string `json:"address,omitempty"`
	Clock   *int    `json:"clock,omitempty"`
	Config  *struct {
		Settings *struct {
			AllowTcpFallbackRelay *bool `json:"allowTcpFallbackRelay,omitempty"`
			PortMappingEnabled    *bool `json:"portMappingEnabled,omitempty"`
			PrimaryPort           *int  `json:"primaryPort,omitempty"`
		} `json:"settings,omitempty"`
	} `json:"config,omitempty"`
	Online               *bool    `json:"online,omitempty"`
	PlanetWorldId        *float32 `json:"planetWorldId,omitempty"`
	PlanetWorldTimestamp *float32 `json:"planetWorldTimestamp,omitempty"`
	PublicIdentity       *string  `json:"publicIdentity,omitempty"`
	TcpFallbackActive    *bool    `json:"tcpFallbackActive,omitempty"`
	Version              *string  `json:"version,omitempty"`
	VersionBuild         *int     `json:"versionBuild,omitempty"`
	VersionMajor         *int     `json:"versionMajor,omitempty"`
	VersionMinor         *int     `json:"versionMinor,omitempty"`
	VersionRev           *int     `json:"versionRev,omitempty"`
}

Status defines model for Status.

type UpdateNetworkJSONBody

type UpdateNetworkJSONBody struct {

	// Let ZeroTier modify the system's DNS settings
	AllowDNS *bool `json:"allowDNS,omitempty"`

	// Let ZeroTier to modify the system's default route.
	AllowDefault *bool `json:"allowDefault,omitempty"`

	// Let ZeroTier to manage IP addresses and Route assignments that aren't in private ranges (rfc1918).
	AllowGlobal *bool `json:"allowGlobal,omitempty"`

	// Let ZeroTier to manage IP addresses and Route assignments.
	AllowManaged *bool `json:"allowManaged,omitempty"`
}

UpdateNetworkJSONBody defines parameters for UpdateNetwork.

type UpdateNetworkJSONRequestBody

type UpdateNetworkJSONRequestBody UpdateNetworkJSONBody

UpdateNetworkJSONRequestBody defines body for UpdateNetwork for application/json ContentType.

type UpdateNetworkResponse

type UpdateNetworkResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Network
}

func ParseUpdateNetworkResponse

func ParseUpdateNetworkResponse(rsp *http.Response) (*UpdateNetworkResponse, error)

ParseUpdateNetworkResponse parses an HTTP response from a UpdateNetworkWithResponse call

func (UpdateNetworkResponse) Status

func (r UpdateNetworkResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateNetworkResponse) StatusCode

func (r UpdateNetworkResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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