client

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package client implements Wrapper around `net/http` to make HTTP requests to the admin REST API.

Index

Constants

View Source
const APPLICATION_JSON = "application/json"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceResponse

type DeviceResponse struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
}

type WGClient added in v1.0.4

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

func NewWGClient

func NewWGClient(host, password string) (WGClient, error)

Create authenticated `WGClient` ready to use.

func (WGClient) Create added in v1.0.4

func (wg WGClient) Create(name string) error

Create new client with the given name.

func (WGClient) Delete added in v1.0.4

func (wg WGClient) Delete(id string) error

Delete client by id.

func (WGClient) Disable added in v1.0.4

func (wg WGClient) Disable(id string) error

Disable client by id.

func (WGClient) Enable added in v1.0.4

func (wg WGClient) Enable(id string) error

Enable client by id.

func (WGClient) GetConfig added in v1.0.4

func (wg WGClient) GetConfig(id string) ([]byte, error)

GetConfig returns encoded client config by id.

func (WGClient) List added in v1.0.4

func (wg WGClient) List() ([]DeviceResponse, error)

List - returns list of all clients.

Jump to

Keyboard shortcuts

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