http

package
v0.0.0-...-575b356 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

func CreateDeviceAuthorization

func CreateDeviceAuthorization() (string, error)

func GetDeviceAuthorization

func GetDeviceAuthorization(sessionToken string) (*models.SessionTokenForm, error)

func GetLatestBinary

func GetLatestBinary(osname string, osarch string) (string, []byte, error)

func GetLatestVersion

func GetLatestVersion() (string, error)

func GetToken

func GetToken() (string, error)

func GetTunnel

func GetTunnel(socketID string, tunnelID string) (*models.Tunnel, error)

func GetUserID

func GetUserID() (*string, *string, error)

func GetUserIDFromAccessToken

func GetUserIDFromAccessToken(accessToken string) (*string, *string, error)

func Login

func Login(email, password string) (bool, error)

func MFAChallenge

func MFAChallenge(code string) error

func Register

func Register(name, email, password string) error

func SaveTokenInDisk

func SaveTokenInDisk(accessToken string) error

func StartLocalHTTPServer

func StartLocalHTTPServer(dir string, l net.Listener) error

func TokenFilePath

func TokenFilePath() string

func WebUrl

func WebUrl() string

Types

type Client

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

func NewClient

func NewClient() (*Client, error)

func NewClientWithAccessToken

func NewClientWithAccessToken(token string) (*Client, error)

func (*Client) Request

func (c *Client) Request(method string, url string, target interface{}, data interface{}) error

func (*Client) WithAccessToken

func (c *Client) WithAccessToken(token string) *Client

func (*Client) WithVersion

func (c *Client) WithVersion(version string) *Client

type ErrorMessage

type ErrorMessage struct {
	ErrorMessage string `json:"error_message,omitempty"`
}

Jump to

Keyboard shortcuts

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