sink

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TravisBaseURL is the base url for travisCI
	TravisBaseURL string = travis.ApiComUrl
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsParamSink

type AwsParamSink struct {
	BaseSink `yaml:",inline"`

	RoleArn    string         `yaml:"role_arn"`
	ExternalID string         `yaml:"external_id"`
	Region     string         `yaml:"region"`
	Client     *cziAws.Client `yaml:"client"`
}

func (*AwsParamSink) Kind

func (sink *AwsParamSink) Kind() Kind

func (*AwsParamSink) Write

func (sink *AwsParamSink) Write(ctx context.Context, name string, val string) error

Write updates the value of the the parameter with the given name in the underlying AWS Parameter Store.

type AwsSecretsManagerSink

type AwsSecretsManagerSink struct {
	BaseSink `yaml:",inline"`

	RoleArn    string         `yaml:"role_arn"`
	ExternalID string         `yaml:"external_id"`
	Region     string         `yaml:"region"`
	Client     *cziAws.Client `yaml:"client"`
}

func (*AwsSecretsManagerSink) Kind

func (sink *AwsSecretsManagerSink) Kind() Kind

func (*AwsSecretsManagerSink) Write

func (sink *AwsSecretsManagerSink) Write(ctx context.Context, name string, val string) error

type BaseSink

type BaseSink struct {
	KeyToName map[string]string `yaml:"key_to_name"`
}

func (*BaseSink) GetKeyToName

func (sink *BaseSink) GetKeyToName() map[string]string

func (*BaseSink) WithKeyToName added in v0.5.7

func (sink *BaseSink) WithKeyToName(m map[string]string) *BaseSink

type BufSink

type BufSink struct {
	BaseSink `yaml:",inline"`
	// contains filtered or unexported fields
}

A BufSink represents a sink that prints to a buffer.

func NewBufSink

func NewBufSink() *BufSink

func (*BufSink) Kind

func (sink *BufSink) Kind() Kind

func (*BufSink) Read

func (sink *BufSink) Read() string

func (*BufSink) WithKeyToName

func (sink *BufSink) WithKeyToName(m map[string]string) *BufSink

func (*BufSink) Write

func (sink *BufSink) Write(ctx context.Context, name string, val string) error

type CircleCiSink added in v0.4.0

type CircleCiSink struct {
	BaseSink `yaml:",inline"`

	Client  *circleci.Client
	Account string
	Repo    string
}

CircleCiSink is a circleci sink

func (*CircleCiSink) Kind added in v0.4.0

func (sink *CircleCiSink) Kind() Kind

Kind returns the kind of this sink

func (*CircleCiSink) WithCircleClient added in v0.4.0

func (sink *CircleCiSink) WithCircleClient(client *circleci.Client, account string, repo string) *CircleCiSink

WithCircleClient configures a circleci client for this sink

func (*CircleCiSink) Write added in v0.4.0

func (sink *CircleCiSink) Write(ctx context.Context, name string, val string) error

Write writes the value of the env var with the specified name for the given repo

type GitHubActionsSecretSink added in v0.5.0

type GitHubActionsSecretSink struct {
	BaseSink `yaml:",inline"`
	// contains filtered or unexported fields
}

GitHubActionsSecretSink holds the configuration for a Github actions secret

func (*GitHubActionsSecretSink) Kind added in v0.5.0

func (s *GitHubActionsSecretSink) Kind() Kind

Kind returns the kind of this sink

func (*GitHubActionsSecretSink) WithClient added in v0.5.0

func (s *GitHubActionsSecretSink) WithClient(client *github.Client, owner string, repo string) *GitHubActionsSecretSink

WithClient configures a github client for this sink

func (*GitHubActionsSecretSink) WithStaticTokenAuthClient added in v0.5.0

func (s *GitHubActionsSecretSink) WithStaticTokenAuthClient(token string, owner string, repo string) *GitHubActionsSecretSink

WithStaticTokenAuthClient configures a github client for this sink using an oauth token

func (*GitHubActionsSecretSink) Write added in v0.5.0

func (s *GitHubActionsSecretSink) Write(ctx context.Context, name string, value string) error

Write updates the value of the env var with the specified name for the given repo.

type HerokuServiceIface added in v0.5.7

type HerokuServiceIface interface {
	ConfigVarUpdate(ctx context.Context, appIdentity string, o map[string]*string) (heroku.ConfigVarUpdateResult, error)
	ConfigVarInfoForApp(ctx context.Context, appIdentity string) (heroku.ConfigVarInfoForAppResult, error)
}

type HerokuSink added in v0.5.7

type HerokuSink struct {
	BaseSink    `yaml:",inline"`
	Client      HerokuServiceIface `yaml:"client"`
	AppIdentity string             `yaml:"AppIdentity"`
}

func (*HerokuSink) Kind added in v0.5.7

func (sink *HerokuSink) Kind() Kind

Kind returns the kind of this sink

func (*HerokuSink) WithHerokuClient added in v0.5.7

func (sink *HerokuSink) WithHerokuClient(client HerokuServiceIface) *HerokuSink

func (*HerokuSink) Write added in v0.5.7

func (sink *HerokuSink) Write(ctx context.Context, name string, val string) error

Write writes the value of the env var with the specified name for the given repo

type Kind

type Kind string
const (
	KindBuf                 Kind = "Buffer"
	KindTravisCi            Kind = "TravisCI"
	KindCircleCi            Kind = "CircleCI"
	KindGithubActionsSecret Kind = "GitHubActionsSecret"
	KindAwsParamStore       Kind = "AWSParameterStore"
	KindAwsSecretsManager   Kind = "AWSSecretsManager"
	KindStdout              Kind = "Stdout"
	KindHeroku              Kind = "Heroku"
)

type Sink

type Sink interface {
	Write(ctx context.Context, name string, val string) error
	GetKeyToName() map[string]string
	Kind() Kind
}

Sink is the interface for all credential sinks.

Write updates the value of the credential with the given name in the underlying sink. Unless otherwise specified, Write overwrites existing values and does not create new credentials in the sink. It returns any error encountered that caused the write to stop early.

GetKeyToName returns the KeyToName field's value.

Kind returns the kind of sink.

type Sinks

type Sinks []Sink

func (Sinks) MarshalYAML

func (sinks Sinks) MarshalYAML() (interface{}, error)

type StdoutSink added in v0.3.0

type StdoutSink struct {
	BaseSink `yaml:",inline"`
}

A StdoutSink

func NewStdoutSink added in v0.3.0

func NewStdoutSink() *StdoutSink

func (*StdoutSink) Kind added in v0.3.0

func (sink *StdoutSink) Kind() Kind

func (*StdoutSink) WithKeyToName added in v0.3.0

func (sink *StdoutSink) WithKeyToName(m map[string]string) *StdoutSink

func (*StdoutSink) Write added in v0.3.0

func (sink *StdoutSink) Write(ctx context.Context, name string, val string) error

type TravisCiSink

type TravisCiSink struct {
	BaseSink `yaml:",inline"`

	RepoSlug string         `yaml:"repo_slug"`
	Client   *travis.Client `yaml:"client"`
}

TravisCiSink is a travisCi sink

func (*TravisCiSink) Kind

func (sink *TravisCiSink) Kind() Kind

Kind returns the kind of this sink

func (*TravisCiSink) WithTravisClient

func (sink *TravisCiSink) WithTravisClient(client *travis.Client) *TravisCiSink

WithTravisClient configures a travisCI client for this sink

func (*TravisCiSink) Write

func (sink *TravisCiSink) Write(ctx context.Context, name string, val string) error

Write updates the value of the env var with the specified name for the given repository slug using the Travis CI client.

Jump to

Keyboard shortcuts

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