filemanager

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VaultKey      string
	PublicBucket  string
	PrivateBucket string
	PublicURL     string
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is the packages error type

func (Error) Error

func (e Error) Error() string

Error satisfies the standard library Go error interface

func (Error) LogData

func (e Error) LogData() map[string]interface{}

LogData satisfies the dataLogger interface which is used to recover log data from an error

func (Error) Unwrap

func (e Error) Unwrap() error

Unwrap implements the standard library Go unwrapper interface

type FileManager

type FileManager struct {
	// contains filtered or unexported fields
}

func New

func (*FileManager) PrivateUploader

func (f *FileManager) PrivateUploader() S3Uploader

PrivateUploader returns the private S3 uploader

func (*FileManager) PublicUploader

func (f *FileManager) PublicUploader() S3Uploader

PublicUploader returns the public S3 uploader

func (*FileManager) Upload

func (f *FileManager) Upload(body io.Reader, filename string) (string, error)

func (*FileManager) UploadPrivate

func (f *FileManager) UploadPrivate(body io.Reader, filename, vaultPath string) (string, error)

type Generator

type Generator interface {
	NewPSK() ([]byte, error)
}

type S3Uploader

type S3Uploader interface {
	Get(key string) (io.ReadCloser, *int64, error)
	Upload(input *s3manager.UploadInput, options ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error)
	UploadWithPSK(input *s3manager.UploadInput, psk []byte) (*s3manager.UploadOutput, error)
	BucketName() string
	Checker(context.Context, *healthcheck.CheckState) error
}

type VaultClient

type VaultClient interface {
	WriteKey(path, key, value string) error
	Checker(context.Context, *healthcheck.CheckState) error
}

Jump to

Keyboard shortcuts

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