sdk

package
v0.0.0-...-a727419 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: GPL-3.0 Imports: 9 Imported by: ? 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

This section is empty.

Functions

func ParseEncryptedResponse

func ParseEncryptedResponse(body map[string]any) error

Types

type Client

type Client struct {
	*http.Client

	OwnerID string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c *websocket.Client, host string) *Client

func (*Client) CreateApplication

func (c *Client) CreateApplication(name string) (string, error)

func (*Client) CreateLicense

func (c *Client) CreateLicense(settings *License) (string, error)

func (*Client) CreateOwner

func (c *Client) CreateOwner(userID string) (string, error)

func (*Client) License

func (c *Client) License(d *LicenseValidate) error

func (*Client) Login

func (c *Client) Login(username, password string) (*LoginInfo, error)

func (*Client) Logout

func (c *Client) Logout() error

func (*Client) Register

func (c *Client) Register(username, password string, apiKey ...string) (string, error)

type License

type License struct {
	OwnerID       string `json:"owner_id"`
	Expiry        uint64 `json:"expiry"`
	AppID         string `json:"app_id"`
	AppName       string `json:"name"`
	Mask          string `json:"mask,omitempty"`
	OnlyCapitals  bool   `json:"include_capitals,omitempty"`
	OnlyLowercase bool   `json:"include_lowercase,omitempty"`
}

type LicenseValidate

type LicenseValidate struct {
	IntegritySignature string `json:"integrity_signature"`
	Fingerprint        string `json:"fingerprint"`
	AppID              string `json:"app_id"`
	OwnerID            string `json:"owner_id"`
	LicenseKey         string `json:"license_key"`
}

type LoginInfo

type LoginInfo struct {
	RefreshToken string `mapstructure:"refresh_token"`
	Token        string `mapstructure:"token"`
}

Jump to

Keyboard shortcuts

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