service

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// An error that is thrown when the response body is empty https://github.com/go-swagger/go-swagger/issues/1929
	ServiceEmptyBodyErrMessage = "&{0 [] } (*models.RPCStatus) is not supported by the TextConsumer, can be resolved by supporting TextUnmarshaler interface"
	ErrEmptyResponseBody       = errors.New("the request response body was empty, which likely means the request was unauthorized. check your authentication credentials and try again")
)

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Endpoint string
	Token    string
}

type CreateDeviceInput

type CreateDeviceInput struct {
	User *string
	Key  *string
}

type CreatePreAuthKeyInput

type CreatePreAuthKeyInput struct {
	User       string
	Reusable   bool
	Ephemeral  bool
	Expiration *strfmt.DateTime
	ACLTags    []string
}

type Headscale

type Headscale interface {
	ListAPIKeys(ctx context.Context) ([]*models.V1APIKey, error)
	CreateAPIKey(ctx context.Context, expiration *strfmt.DateTime) (string, error)
	ExpireAPIKey(ctx context.Context, key string) error
	ListDevices(ctx context.Context, user *string) ([]*models.V1Machine, error)
	GetDevice(ctx context.Context, deviceId string) (*models.V1Machine, error)
	CreateDevice(ctx context.Context, user string, key string) (*models.V1Machine, error)
	ExpireDevice(ctx context.Context, deviceId string) (*models.V1Machine, error)
	DeleteDevice(ctx context.Context, deviceId string) error
	RenameDevice(ctx context.Context, deviceId string, newName string) (*models.V1Machine, error)
	GetDeviceRoutes(ctx context.Context, deviceId string) ([]*models.V1Route, error)
	TagDevice(ctx context.Context, deviceId string, tags []string) (*models.V1Machine, error)
	MoveDevice(ctx context.Context, deviceId string, newOwner string) (*models.V1Machine, error)
	ListPreAuthKeys(ctx context.Context, user string) ([]*models.V1PreAuthKey, error)
	CreatePreAuthKey(ctx context.Context, input CreatePreAuthKeyInput) (*models.V1PreAuthKey, error)
	ExpirePreAuthKey(ctx context.Context, user string, key string) error
	ListRoutes(ctx context.Context) ([]*models.V1Route, error)
	DeleteRoute(ctx context.Context, routeId string) error
	DisableRoute(ctx context.Context, routeId string) error
	EnableRoute(ctx context.Context, routeId string) error
	GetUser(ctx context.Context, userId string) (*models.V1User, error)
	ListUsers(ctx context.Context) ([]*models.V1User, error)
	CreateUser(ctx context.Context, name string) (*models.V1User, error)
	DeleteUser(ctx context.Context, userId string) error
	RenameUser(ctx context.Context, oldName string, newName string) (*models.V1User, error)
}

func New

func New(c ClientConfig) (Headscale, error)

type HeadscaleService

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

func (*HeadscaleService) CreateAPIKey

func (h *HeadscaleService) CreateAPIKey(ctx context.Context, expiration *strfmt.DateTime) (string, error)

func (*HeadscaleService) CreateDevice

func (h *HeadscaleService) CreateDevice(ctx context.Context, user string, key string) (*models.V1Machine, error)

func (*HeadscaleService) CreatePreAuthKey

func (h *HeadscaleService) CreatePreAuthKey(ctx context.Context, input CreatePreAuthKeyInput) (*models.V1PreAuthKey, error)

func (*HeadscaleService) CreateUser

func (h *HeadscaleService) CreateUser(ctx context.Context, name string) (*models.V1User, error)

func (*HeadscaleService) DeleteDevice

func (h *HeadscaleService) DeleteDevice(ctx context.Context, deviceId string) error

func (*HeadscaleService) DeleteRoute

func (h *HeadscaleService) DeleteRoute(ctx context.Context, route string) error

func (*HeadscaleService) DeleteUser

func (h *HeadscaleService) DeleteUser(ctx context.Context, name string) error

func (*HeadscaleService) DisableRoute

func (h *HeadscaleService) DisableRoute(ctx context.Context, route string) error

func (*HeadscaleService) EnableRoute

func (h *HeadscaleService) EnableRoute(ctx context.Context, route string) error

func (*HeadscaleService) ExpireAPIKey

func (h *HeadscaleService) ExpireAPIKey(ctx context.Context, key string) error

func (*HeadscaleService) ExpireDevice

func (h *HeadscaleService) ExpireDevice(ctx context.Context, deviceId string) (*models.V1Machine, error)

func (*HeadscaleService) ExpirePreAuthKey

func (h *HeadscaleService) ExpirePreAuthKey(ctx context.Context, user string, key string) error

func (*HeadscaleService) GetDevice

func (h *HeadscaleService) GetDevice(ctx context.Context, deviceId string) (*models.V1Machine, error)

func (*HeadscaleService) GetDeviceRoutes

func (h *HeadscaleService) GetDeviceRoutes(ctx context.Context, deviceId string) ([]*models.V1Route, error)

func (*HeadscaleService) GetUser

func (h *HeadscaleService) GetUser(ctx context.Context, name string) (*models.V1User, error)

func (*HeadscaleService) ListAPIKeys

func (h *HeadscaleService) ListAPIKeys(ctx context.Context) ([]*models.V1APIKey, error)

func (*HeadscaleService) ListDevices

func (h *HeadscaleService) ListDevices(ctx context.Context, user *string) ([]*models.V1Machine, error)

func (*HeadscaleService) ListPreAuthKeys

func (h *HeadscaleService) ListPreAuthKeys(ctx context.Context, user string) ([]*models.V1PreAuthKey, error)

func (*HeadscaleService) ListRoutes

func (h *HeadscaleService) ListRoutes(ctx context.Context) ([]*models.V1Route, error)

func (*HeadscaleService) ListUsers

func (h *HeadscaleService) ListUsers(ctx context.Context) ([]*models.V1User, error)

func (*HeadscaleService) MoveDevice

func (h *HeadscaleService) MoveDevice(ctx context.Context, deviceId string, user string) (*models.V1Machine, error)

func (*HeadscaleService) RenameDevice

func (h *HeadscaleService) RenameDevice(ctx context.Context, deviceId string, name string) (*models.V1Machine, error)

func (*HeadscaleService) RenameUser

func (h *HeadscaleService) RenameUser(ctx context.Context, oldName string, newName string) (*models.V1User, error)

func (*HeadscaleService) TagDevice

func (h *HeadscaleService) TagDevice(ctx context.Context, deviceId string, tags []string) (*models.V1Machine, error)

Jump to

Keyboard shortcuts

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