storage

package
v0.0.0-...-99fd3eb Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("Item could not be found")

ErrNotFound is not found

Functions

This section is empty.

Types

type Item

type Item interface {
	Key() string
	PublicURL() string
	Contents() (io.ReadCloser, error)
}

Item interface

type S3Config

type S3Config struct {
	Bucket   string
	Endpoint string
	Region   string

	ID     string
	Secret string
	Token  string

	DisableSSL     bool
	ForcePathStyle bool
}

S3Config structure

type Store

type Store interface {
	Add(key string, r io.ReadSeeker) (Item, error)
	Get(key string) (Item, error)
	Remove(key string) error
	List() ([]Item, error)
}

Store interface

func NewFileSystem

func NewFileSystem(dir, basePath string) Store

NewFileSystem creates a new storage

func S3

func S3(config S3Config) (Store, error)

S3 inits and S3 storage

Jump to

Keyboard shortcuts

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