httpclient

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = errors.New("forbidden")
View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

func TokenResponseToSessionData

func TokenResponseToSessionData(token *api.TokenResponse) session.Data

Types

type APIError

type APIError struct {
	StatusCode int
	Code       string
	Message    string
}

func (APIError) Error

func (e APIError) Error() string

type AuthTransport

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

func (*AuthTransport) RoundTrip

func (t *AuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Client

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

func New

func New(baseURL, profile string, backend session.Backend, sessions *session.Manager) (*Client, error)

func (*Client) CreateDeviceCode

func (c *Client) CreateDeviceCode(ctx context.Context, clientName string) (*api.DeviceCode, error)

func (*Client) CreateGizmo added in v0.5.0

func (c *Client) CreateGizmo(ctx context.Context, body api.GizmoWrite) (*api.Gizmo, error)

func (*Client) CreateNetworkDevice

func (c *Client) CreateNetworkDevice(ctx context.Context, body api.NetworkDeviceWrite) (*api.NetworkDevice, error)

func (*Client) CreateVlan

func (c *Client) CreateVlan(ctx context.Context, body api.VlanWrite) (*api.Vlan, error)

func (*Client) DeleteGizmo added in v0.5.0

func (c *Client) DeleteGizmo(ctx context.Context, id string) error

func (*Client) DeleteNetworkDevice

func (c *Client) DeleteNetworkDevice(ctx context.Context, id string) error

func (*Client) DeleteVlan

func (c *Client) DeleteVlan(ctx context.Context, vlanID int32) error

func (*Client) ExchangeDeviceCode

func (c *Client) ExchangeDeviceCode(ctx context.Context, deviceCode string) (*api.TokenResponse, error)

func (*Client) GenerateWiFiPassword added in v0.7.0

func (c *Client) GenerateWiFiPassword(ctx context.Context) (string, error)

func (*Client) GetProfile

func (c *Client) GetProfile(ctx context.Context) (*api.Profile, error)

func (*Client) ListGizmos added in v0.5.0

func (c *Client) ListGizmos(ctx context.Context) ([]api.Gizmo, error)

func (*Client) ListNetworkDevices

func (c *Client) ListNetworkDevices(ctx context.Context) ([]api.NetworkDevice, error)

func (*Client) ListSessions

func (c *Client) ListSessions(ctx context.Context, all bool, limit, offset int32) (*api.AuthSessionPage, error)

func (*Client) ListVlans

func (c *Client) ListVlans(ctx context.Context) ([]api.Vlan, error)

func (*Client) Logout

func (c *Client) Logout(ctx context.Context, refreshToken string) error

func (*Client) RevealWiFiPassword added in v0.7.0

func (c *Client) RevealWiFiPassword(ctx context.Context, id string) (string, error)

func (*Client) RevokeAllSessions

func (c *Client) RevokeAllSessions(ctx context.Context, all bool) error

func (*Client) RevokeSession

func (c *Client) RevokeSession(ctx context.Context, id string, all bool) error

func (*Client) UpdateGizmo added in v0.5.0

func (c *Client) UpdateGizmo(ctx context.Context, id string, body api.GizmoUpdate) (*api.Gizmo, error)

func (*Client) UpdateNetworkDevice

func (c *Client) UpdateNetworkDevice(ctx context.Context, id string, body api.NetworkDevicePatch) (*api.NetworkDevice, error)

func (*Client) UpdateVlan

func (c *Client) UpdateVlan(ctx context.Context, vlanID int32, body api.VlanPatch) (*api.Vlan, error)

type ClientAuthError

type ClientAuthError struct {
	Code        string
	Description string
	StatusCode  int
}

func (ClientAuthError) Error

func (e ClientAuthError) Error() string

Jump to

Keyboard shortcuts

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