config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessTokenPath

func AccessTokenPath() string

AccessTokenPath is the path for the access token file

func ConfigDir

func ConfigDir() string

ConfigDir is the directory for PlanetScale config.

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath is the path for the config file.

Types

type Config

type Config struct {
	AccessToken  string
	BaseURL      string
	Organization string

	ServiceTokenName string
	ServiceToken     string
}

func New

func New() *Config

func (*Config) IsAuthenticated

func (c *Config) IsAuthenticated() bool

func (*Config) NewClientFromConfig

func (c *Config) NewClientFromConfig(clientOpts ...ps.ClientOption) (*ps.Client, error)

NewClientFromConfig creates a PlaentScale API client from our configuration

func (*Config) ToWritableConfig

func (c *Config) ToWritableConfig() *WritableConfig

ToWritableConfig returns an instance of WritableConfig from the Config struct.

type WritableConfig

type WritableConfig struct {
	Organization string `yaml:"org" json:"org"`
}

WritableConfig maps

func (*WritableConfig) Write

func (w *WritableConfig) Write(path string) error

Write persists the writable config at the designated path.

Jump to

Keyboard shortcuts

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