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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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