content

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VaultFilenameEmptyErr = errors.New("vault filename required but was empty")
)

Functions

This section is empty.

Types

type S3Client

type S3Client interface {
	Get(key string) (io.ReadCloser, *int64, error)
	GetWithPSK(key string, psk []byte) (io.ReadCloser, *int64, error)
	Checker(ctx context.Context, check *healthcheck.CheckState) error
}

S3Client is an interface to represent methods called to retrieve from s3

type S3ReadCloser

type S3ReadCloser io.ReadCloser

S3ReadCloser is an io.ReadCloser alias to allow mockgen to create a mock impl for the tests

type S3StreamWriter

type S3StreamWriter struct {
	VaultCli           VaultClient
	VaultPath          string
	S3Client           S3Client
	EncryptionDisabled bool
}

S3StreamWriter provides functionality for retrieving content from an S3 bucket. The content is streamed/decrypted and and written to the provided io.Writer

func NewStreamWriter

func NewStreamWriter(s3c S3Client, vc VaultClient, vp string, encDisabled bool) *S3StreamWriter

NewStreamWriter create a new S3StreamWriter instance.

func (S3StreamWriter) StreamAndWrite

func (s S3StreamWriter) StreamAndWrite(ctx context.Context, s3Path string, vaultPath string, w io.Writer) (err error)

StreamAndWrite decrypt and stream the request file writing the content to the provided io.Writer.

type VaultClient

type VaultClient interface {
	ReadKey(path, key string) (string, error)
	Checker(ctx context.Context, check *healthcheck.CheckState) error
}

VaultClient is an interface to represent methods called to action upon vault

type Writer

type Writer io.Writer

Writer is an io.Writer alias to allow mockgen to create a mock impl for the tests

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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