Documentation
¶
Overview ¶
Package mutagenio provides infrastructure for interfacing with mutagen.io.
Index ¶
- Constants
- Variables
- func ExtractTokenScheme(token string) (string, error)
- func Login(apiToken string) error
- func Logout() error
- func TunnelClientExchangeFinish(ctx context.Context, ...) error
- func TunnelClientExchangeStart(ctx context.Context, tunnelID, clientToken string) (string, string, string, error)
- func TunnelCreate(ctx context.Context) (string, string, string, error)
- func TunnelHostExchange(ctx context.Context, tunnelID, hostToken, offer, signature string) (string, string, error)
Constants ¶
const (
// TokenSchemeAPI is the scheme name for API tokens.
TokenSchemeAPI = "api"
)
Variables ¶
var ( // a 401 (Unauthorized) status code. ErrUnauthorized = errors.New("unauthorized") )
Functions ¶
func ExtractTokenScheme ¶
ExtractTokenScheme parses a mutagen.io token (without validation) and returns the token scheme.
func Login ¶
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 ¶
TunnelCreate creates a new tunnel using the underlying API key. It returns the tunnel identifier, host token, and client token.
Types ¶
This section is empty.