storage

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessType

type AccessType int
const (
	Public AccessType = iota
	Private
)

func (AccessType) MarshalJSON

func (a AccessType) MarshalJSON() ([]byte, error)

func (AccessType) String

func (a AccessType) String() string

func (*AccessType) UnmarshalJSON

func (a *AccessType) UnmarshalJSON(b []byte) error

type CreateOptions

type CreateOptions struct {
	AccessType  AccessType
	Key         string
	Body        io.Reader
	ContentType string
	Size        int64
}

type FileInfo

type FileInfo struct {
	AccessType  AccessType
	Key         string
	ContentType string
	Size        int64
	Url         string
}

type Options

type Options struct {
	Storage Storage
}

type Storage

type Storage interface {
	Create(ctx context.Context, opts CreateOptions) (*FileInfo, error)
	Destroy(ctx context.Context, key string) error
	GenerateSignedURL(ctx context.Context, key string, expirationTime time.Duration) (string, error)
}

type StorageInstance

type StorageInstance interface {
	Storage
}

func InstanceFromCtx

func InstanceFromCtx(ctx web.Context) StorageInstance

type StoragePlugin

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

func NewStoragePlugin

func NewStoragePlugin(opts Options) *StoragePlugin

func (*StoragePlugin) AppendMiddlewares

func (s *StoragePlugin) AppendMiddlewares() []web.MiddlewareFunc

func (*StoragePlugin) Instance

func (s *StoragePlugin) Instance() interface{}

func (*StoragePlugin) Name

func (s *StoragePlugin) Name() string

func (*StoragePlugin) OnCreated

func (s *StoragePlugin) OnCreated(z *zepto.Zepto)

func (*StoragePlugin) OnZeptoInit

func (s *StoragePlugin) OnZeptoInit(z *zepto.Zepto)

func (*StoragePlugin) OnZeptoStart

func (s *StoragePlugin) OnZeptoStart(z *zepto.Zepto)

func (*StoragePlugin) OnZeptoStop

func (s *StoragePlugin) OnZeptoStop(z *zepto.Zepto)

func (*StoragePlugin) PrependMiddlewares

func (s *StoragePlugin) PrependMiddlewares() []web.MiddlewareFunc

type UpdateOptions

type UpdateOptions struct {
	Key string
}

Directories

Path Synopsis
providers
s3
Package storagemock is a generated GoMock package.
Package storagemock is a generated GoMock package.

Jump to

Keyboard shortcuts

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