conf

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package conf writes and reads the Encore configuration file for the user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthClient

func AuthClient() *http.Client

AuthClient creates an *http.Client that authenticates requests using the logged-in user.

func Logout

func Logout() error

func Write

func Write(cfg *Config) (err error)

Write persists the configuration for the user.

Types

type Config

type Config struct {
	oauth2.Token
	Email     string `json:"email"`
	WireGuard struct {
		PublicKey  string `json:"pub,omitempty"`
		PrivateKey string `json:"priv,omitempty"`
	} `json:"wg,omitempty"`
}

Config represents the stored Encore configuration.

func CurrentUser

func CurrentUser() (*Config, error)

func OriginalUser

func OriginalUser(configDir string) (cfg *Config, err error)

type TokenSource

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

TokenSource implements oauth2.TokenSource by looking up the current logged in user's API Token. The zero value is ready to be used.

func (*TokenSource) Token

func (ts *TokenSource) Token() (*oauth2.Token, error)

Token implements oauth2.TokenSource.

Jump to

Keyboard shortcuts

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