sync_kv

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "sync_kv"

Type is the string value of the Target type

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Artifact           *Artifact
	Target             *Target
	KVStorage          kv.Storage
	VaultClientFactory VaultClientFactory
	Logger             logz.FieldLogger
}

Action is the executor for implementing a KV Sync

func (Action) Execute

func (a Action) Execute(ctx context.Context) (err error)

Execute runs the action and produces a sync_kv.Artifact

func (*Action) UseKVStorage

func (a *Action) UseKVStorage(client kv.Storage)

UseKVStorage inject the client

func (*Action) UseLogger

func (a *Action) UseLogger(logger logz.FieldLogger)

UseLogger injects a logger into the target's action

type Artifact

type Artifact struct {
	ark.RawArtifact `mapstructure:",squash"`
}

Artifact the result of a successful actions.KVSync

func (Artifact) Cacheable

func (a Artifact) Cacheable() bool

Cacheable always returns false as state is not tracked between the local KV and a Vault cluster

func (Artifact) LocallyCached

func (a Artifact) LocallyCached(_ context.Context) (bool, error)

LocallyCached is an unused function as the target is not cacheable

func (Artifact) Pull

func (a Artifact) Pull(_ context.Context) error

Pull is an unused function as the target is not cacheable

func (Artifact) Push

func (a Artifact) Push(_ context.Context) error

Push is an unused function as the target is not cacheable

func (Artifact) RemotelyCached

func (a Artifact) RemotelyCached(_ context.Context) (bool, error)

RemotelyCached is an unused function as the target is not cacheable

type Target

type Target struct {
	ark.RawTarget  `mapstructure:",squash"`
	Engine         string `json:"engine" mapstructure:"engine"`
	EngineURL      string `json:"engineUrl" mapstructure:"engineUrl"`
	TimeoutSeconds int    `json:"timeoutSeconds" mapstructure:"timeoutSeconds"`
	Token          string `json:"token" mapstructure:"token"`
	MaxRetries     int    `json:"maxRetries" mapstructure:"maxRetries"`
}

Target expresses the intention to implement a KV Sync target

func (Target) Produce

func (t Target) Produce(checksum hash.Hash) (ark.Artifact, error)

Produce should produce Artifact

func (*Target) Validate

func (t *Target) Validate() error

Validate checks if the Target fields are valid

type VaultClientFactory

type VaultClientFactory func(config *vault.Config) (*vault.Client, error)

VaultClientFactory allows for the injection of a custom configured Vault client

Jump to

Keyboard shortcuts

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