config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FormatVersion = 1

Variables

View Source
var (
	BuildkiteGraphQLToken = CredentialType{"Buildkite GraphQL Token", "graphql-token"}
	GithubOAuthToken      = CredentialType{"Github OAuth Token", "rest-token"}
)

Functions

func Path

func Path() (string, error)

Path returns either $BUILDKITE_CLI_CONFIG_FILE or ~/.buildkite/config.json

func RetrieveCredential

func RetrieveCredential(kr keyring.Keyring, t CredentialType, into interface{}) error

func StoreCredential

func StoreCredential(kr keyring.Keyring, t CredentialType, value interface{}) error

Types

type Config

type Config struct {
	Path           string `json:"-"`
	Version        int    `json:"version"`
	BuildkiteEmail string `json:"email"`
	BuildkiteUUID  string `json:"uuid"`
}

func Open

func Open() (*Config, error)

Open opens and parses the Config, returns a empty Config if one doesn't exist

func (*Config) Write

func (c *Config) Write() error

Write serializes the config to the Path in the config

type CredentialType

type CredentialType struct {
	Label string
	Key   string
}

func ListCredentials

func ListCredentials() []CredentialType

Jump to

Keyboard shortcuts

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