config

package
v0.0.0-...-e83cbdc Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthConfigTypeAuthCodePKCE represents the OAuth 2.0 Authorization Code Grant with Proof Key
	// for Code Exchange (PKCE) flow.
	AuthConfigTypeAuthCodePKCE = "AuthCodePKCE"
	// AuthConfigTypeClientCredentials represents the OAuth 2.0 Client Credentials flow.
	AuthConfigTypeClientCredentials = "ClientCredentials"
)
View Source
const (
	// DefaultBaseURI is the default URI for the fuzzball-service
	DefaultBaseURI = "http://localhost:8080"
)

Variables

View Source
var (
	// ErrRemoteNotFound is returned with the specified remote is not found.
	ErrRemoteNotFound = errors.New("remote not found")
)

Functions

func GetPath

func GetPath() (string, error)

GetPath returns the path to the configuration file.

Types

type Config

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

Config represents a configuration.

func Default

func Default() (*Config, error)

Default returns a defalt Config.

func Read

func Read(r io.Reader) (*Config, error)

Read reads a config from the secified reader.

func (*Config) GetActiveRemote

func (c *Config) GetActiveRemote() (Remote, error)

GetActiveRemote returns the active remote.

func (*Config) Write

func (c *Config) Write(w io.Writer) error

Write writes c to the specified writer.

type Remote

type Remote interface {
	GetAuthType() string
	SetAuthType(string) error

	GetAuthCodePKCEConfig() *oauth2.Config
	GetClientCredentialsConfig() *clientcredentials.Config

	GetToken() *oauth2.Token
	SetToken(t *oauth2.Token) error

	GetBaseURI() string
	SetBaseURI(baseURI string) error
}

Remote defines the operations that can be performed on a remote config.

Jump to

Keyboard shortcuts

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