cli

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package cli provides the CLI client, i.e. the `otf` binary.

Index

Constants

View Source
const (
	CredentialsPath = ".terraform.d/credentials.tfrc.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

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

CLI is the `otf` cli application

func NewCLI added in v0.1.9

func NewCLI() *CLI

func (*CLI) Run

func (a *CLI) Run(ctx context.Context, args []string, out io.Writer) error

type CredentialsConfig

type CredentialsConfig struct {
	Credentials map[string]TokenConfig `json:"credentials"`
}

type CredentialsStore

type CredentialsStore string

CredentialsStore is a JSON file in a user's home dir that stores tokens for one or more TFE-type hosts

func NewCredentialsStore

func NewCredentialsStore() (CredentialsStore, error)

NewCredentialsStore is a contructor for CredentialsStore

func (CredentialsStore) Load

func (c CredentialsStore) Load(hostname string) (string, error)

Load retrieves the token for hostname

func (CredentialsStore) Save

func (c CredentialsStore) Save(hostname, token string) error

Save saves the token for the given hostname to the store, overwriting any existing tokens for the hostname.

type KVMap

type KVMap map[string]string

KVMap is a basic implementation of http.KVStore for testing purposes.

func (KVMap) Load

func (m KVMap) Load(key string) (string, error)

func (KVMap) Save

func (m KVMap) Save(key, value string) error

type KVStore

type KVStore interface {
	Save(key, value string) error
	Load(key string) (value string, err error)
}

KVStore implementations provide a key-value store.

type TokenConfig

type TokenConfig struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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