files

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Extension string
	Size      int64
	Mime      Mime
	Hash      Hash
}

func Info

func Info(r io.ReadSeeker) (*FileInfo, error)

type Hash

type Hash struct {
	Algorithm string
	Digest    string
}

func (Hash) String

func (h Hash) String() string

type Mime

type Mime struct {
	Type    string
	Subtype string
	Value   string
}

type Object

type Object struct {
	Bucket string
	Key    string
}

type Storage

type Storage interface {
	Upload(ctx context.Context, path string, r io.Reader) (*UploadResult, error)
}

func NewLocalStorage

func NewLocalStorage(basePath string, urlPrefix string) Storage

func NewS3Storage

func NewS3Storage(endpointUrl, bucket, accessKeyId, accessKeySecret, urlTemplate string) Storage

type UploadResult

type UploadResult struct {
	Id  string
	Url string
}

Jump to

Keyboard shortcuts

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