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: 0

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