storage

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 7 Imported by: 0

README

storage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferWriterAt

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

func NewBufferWriterAt

func NewBufferWriterAt(w io.Writer) *BufferWriterAt

func (BufferWriterAt) WriteAt

func (fw BufferWriterAt) WriteAt(p []byte, offset int64) (n int, err error)

type File

type File struct {
	Name         *string    `json:"name,omitempty" yaml:"name,omitempty"`
	Extension    *string    `json:"extension,omitempty" yaml:"extension,omitempty"`
	Key          *string    `json:"key,omitempty" yaml:"key,omitempty"`
	Path         *string    `json:"path,omitempty" yaml:"path,omitempty"`
	Size         *int       `json:"size,omitempty" yaml:"size,omitempty"`
	ContentType  *string    `json:"content_type,omitempty" yaml:"content_type,omitempty"`
	LastModified *time.Time `json:"last_modified,omitempty" yaml:"last_modified,omitempty"`
	Prefix       *string    `json:"prefix,omitempty" yaml:"prefix,omitempty"`
}

type Storage

type Storage interface {
	Download(ctx context.Context, key *string) (io.Reader, error)
	PreSign(ctx context.Context, key, contentType *string) (*string, error)
	ListObjects(ctx context.Context) ([]*File, error)
	Upload(ctx context.Context, key, contentType *string, data io.Reader) error
}

func NewS3

func NewS3(ctx context.Context, bucket string) (Storage, error)

Jump to

Keyboard shortcuts

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