httpclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 13 Imported by: 0

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) 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) 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) GetProfile

func (c *Client) GetProfile(ctx context.Context) (*api.Profile, 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) 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) 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