config

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = ".ldcli-config.yml"

Variables

This section is empty.

Functions

func AccessTokenIsSet added in v1.2.0

func AccessTokenIsSet(filename string) (bool, error)

func GetConfigFile

func GetConfigFile() string

GetConfigFile gets the full path to the config file.

Types

type Config added in v1.2.0

type Config struct {
	AccessToken     string `json:"access-token,omitempty" yaml:"access-token,omitempty"`
	AnalyticsOptOut *bool  `json:"analytics-opt-out,omitempty" yaml:"analytics-opt-out,omitempty"`
	BaseURI         string `json:"base-uri,omitempty" yaml:"base-uri,omitempty"`
	DevStreamURI    string `json:"dev-stream-uri,omitempty" yaml:"dev-stream-uri,omitempty"`
	Environment     string `json:"environment,omitempty" yaml:"environment,omitempty"`
	Flag            string `json:"flag,omitempty" yaml:"flag,omitempty"`
	Output          string `json:"output,omitempty" yaml:"output,omitempty"`
	Project         string `json:"project,omitempty" yaml:"project,omitempty"`
}

Config represents the data stored in the config file.

func New added in v1.2.0

func New(filename string, readFile ReadFile) (Config, error)

func (Config) Remove added in v1.2.0

func (c Config) Remove(key string) (Config, error)

Remove validates the key exists but doesn't do anything else since we unset the value when writing to disk.

func (Config) Update added in v1.2.0

func (c Config) Update(kvs []string) (Config, []string, error)

Update validates the updating fields and sets them on the Config. It returns the updated fields in addition to the Config.

type ReadFile added in v1.2.0

type ReadFile func(name string) ([]byte, error)

type Service added in v1.1.0

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

func NewService added in v1.1.0

func NewService(client resources.Client) Service

func (Service) VerifyAccessToken added in v1.1.0

func (s Service) VerifyAccessToken(accessToken string, baseURI string) bool

VerifyAccessToken is true if the given access token is valid to make API requests.

Jump to

Keyboard shortcuts

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