mutagenio

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mutagenio provides infrastructure for interfacing with mutagen.io.

Index

Constants

View Source
const (

	// TokenSchemeAPI is the scheme name for API tokens.
	TokenSchemeAPI = "api"
)

Variables

View Source
var (
	// ErrUnauthorized is a sentinel error returned if an API endpoint returns
	// a 401 (Unauthorized) status code.
	ErrUnauthorized = errors.New("unauthorized")
)

Functions

func ExtractTokenScheme

func ExtractTokenScheme(token string) (string, error)

ExtractTokenScheme parses a mutagen.io token (without validation) and returns the token scheme.

func Login

func Login(apiToken string) error

Login stores the provided API token for use in API requests. It replaces any existing API token.

func Logout

func Logout() error

Logout ensures that any stored API token is cleared. If no existing API token is present, Logout is a no-op.

func TunnelClientExchangeFinish

func TunnelClientExchangeFinish(ctx context.Context, tunnelID, clientToken, exchangeID, offer, signature string) error

TunnelClientExchangeFinish performs completion of the client side of a tunnel offer exchange.

func TunnelClientExchangeStart

func TunnelClientExchangeStart(ctx context.Context, tunnelID, clientToken string) (string, string, string, error)

TunnelClientExchangeStart performs initiation of the client side of a tunnel offer exchange.

func TunnelCreate

func TunnelCreate(ctx context.Context) (string, string, string, error)

TunnelCreate creates a new tunnel using the underlying API key. It returns the tunnel identifier, host token, and client token.

func TunnelHostExchange

func TunnelHostExchange(ctx context.Context, tunnelID, hostToken, offer, signature string) (string, string, error)

TunnelHostExchange performs the host side of a tunnel offer exchange.

Types

This section is empty.

Jump to

Keyboard shortcuts

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