sink

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindBuf               Kind  = "Buffer"
	KindTravisCi          Kind  = "TravisCI"
	KindAwsParamStore     Kind  = "AWSParameterStore"
	KindAwsSecretsManager Kind  = "AWSSecretsManager"
	ErrUnknownKind        Error = "UnknownSink"
)
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

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 Error

type Error string

func (Error) Error

func (e Error) Error() string

type Kind

type Kind string

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 TravisCiSink

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

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

TravisCiSink returns the

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