package context

import "github.com/oslokommune/okctl/pkg/context"

Package context provides an interface to ephemeral resources

Index

Constants

const (
	// DefaultDebugEnv if set will ensure verbose debugging output
	DefaultDebugEnv = "OKCTL_DEBUG"
	// DefaultAWSCredentialsType if set will ensure where okctl seeks AWS authentication credentials
	DefaultAWSCredentialsType = "OKCTL_AWS_CREDENTIALS_TYPE" //nolint:gosec
	// DefaultGithubCredentialsType if set will ensure where okctl seeks Github authentication credentials
	DefaultGithubCredentialsType = "OKCTL_GITHUB_CREDENTIALS_TYPE" //nolint:gosec
)
const (
	// AWSCredentialsTypeAccessKey represents using access key environment variables for AWS authentication
	AWSCredentialsTypeAccessKey = "access-key"
	// AWSCredentialsTypeAwsProfile represents using AWS Profile environment variable for AWS authentication
	AWSCredentialsTypeAwsProfile = "aws-profile"

	// GithubCredentialsTypeDeviceAuthentication represents using the device authentication flow to authenticate with
	// Github
	GithubCredentialsTypeDeviceAuthentication = "device-authentication"
	// GithubCredentialsTypeToken represents using a Github Token (GH Actions) or a PAT for authentication
	GithubCredentialsTypeToken = "token"
)

Types

type Context

type Context struct {
	FileSystem *afero.Afero

	Debug                 bool
	AWSCredentialsType    string
	GithubCredentialsType string

	In  io.Reader
	Out io.Writer
	Err io.Writer

	Ctx context.Context

	Logger   *logrus.Logger
	LogLevel logrus.Level
}

Context provides access to ephemeral state nolint: maligned

func New

func New() *Context

New returns a context with sensible defaults

Source Files

context.go

Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
5 packages
Last checked
18 hours ago

Tools for package owners.