provider

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: CC0-1.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCP

type GCP struct {
	ProjectID  string `json:"project_id" mapstructure:"project_id"`
	BucketName string `json:"bucket_name" mapstructure:"bucket_name"`
	Host       string `json:"host" mapstructure:"host"`
	ApiKey     string `json:"api_key" mapstructure:"api_key"`
	// contains filtered or unexported fields
}

func (*GCP) Get

func (gcp *GCP) Get(ctx context.Context, path string) (io.Reader, error)

func (*GCP) Put

func (gcp *GCP) Put(ctx context.Context, path string, object io.Reader) error

type InactiveProvider

type InactiveProvider struct {
	ProviderName string `json:"provider_name"`
}

func (*InactiveProvider) Get

func (ip *InactiveProvider) Get(ctx context.Context, path string) (io.Reader, error)

func (*InactiveProvider) Put

func (ip *InactiveProvider) Put(ctx context.Context, path string, object io.Reader) error

type Local

type Local struct {
	Filepath string `json:"filepath" mapstructure:"filepath"`
}

func (*Local) Get

func (l *Local) Get(ctx context.Context, fullpath string) (io.Reader, error)

func (*Local) Put

func (l *Local) Put(ctx context.Context, fullpath string, f io.Reader) (err error)

type S3

type S3 struct {
	Endpoint     string `json:"endpoint"`
	AccessKey    string `json:"access_key" mapstructure:"access_key"`
	SecretKey    string `json:"secret_key" mapstructure:"secret_key"`
	SSL          bool   `json:"ssl"`
	Bucket       string `json:"bucket"`
	BucketRegion string `json:"bucket_region" mapstructure:"bucket_region"`
	// contains filtered or unexported fields
}

func (*S3) Get

func (s *S3) Get(ctx context.Context, path string) (io.Reader, error)

func (*S3) Put

func (s *S3) Put(ctx context.Context, path string, f io.Reader) error

type SLocal

type SLocal struct {
	Filepath string `json:"filepath" mapstructure:"filepath"`
	Secret   string `json:"secret"`
	// contains filtered or unexported fields
}

func (*SLocal) Get

func (l *SLocal) Get(ctx context.Context, fullpath string) (io.Reader, error)

func (*SLocal) Put

func (l *SLocal) Put(ctx context.Context, fullpath string, f io.Reader) (err error)

type SS3

type SS3 struct {
	Endpoint     string `json:"endpoint"`
	AccessKey    string `json:"access_key" mapstructure:"access_key"`
	SecretKey    string `json:"secret_key" mapstructure:"secret_key"`
	SSL          bool   `json:"ssl"`
	Bucket       string `json:"bucket"`
	BucketRegion string `json:"bucket_region" mapstructure:"bucket_region"`
	Secret       string `json:"secret"`
	// contains filtered or unexported fields
}

func (*SS3) Get

func (s *SS3) Get(ctx context.Context, path string) (io.Reader, error)

func (*SS3) Put

func (s *SS3) Put(ctx context.Context, path string, f io.Reader) error

type StorageProvider

type StorageProvider interface {
	Get(ctx context.Context, path string) (io.Reader, error)
	Put(ctx context.Context, path string, object io.Reader) error
}

func NewGCPStorage

func NewGCPStorage(cfg config.Getter) (StorageProvider, error)

func NewInactiveProvider

func NewInactiveProvider(providerName string) StorageProvider

func NewLocalStorage

func NewLocalStorage(conf config.Getter) (StorageProvider, error)

func NewS3Storage

func NewS3Storage(conf config.Getter) (StorageProvider, error)

func NewSLocalStorage

func NewSLocalStorage(conf config.Getter) (StorageProvider, error)

func NewSS3Storage

func NewSS3Storage(conf config.Getter) (StorageProvider, error)

Jump to

Keyboard shortcuts

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