storage

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct{}

func NewFS

func NewFS() *FS

func (*FS) Delete

func (fs *FS) Delete(path string) error

func (*FS) Read

func (fs *FS) Read(path string) (io.Reader, error)

func (*FS) Type

func (fs *FS) Type() Type

func (*FS) Write

func (fs *FS) Write(path string, r io.Reader) error

type OSS

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

func NewOSS

func NewOSS(endpoint, accessKeyID, accessKeySecret, bucket string,
	clientOptions []oss.ClientOption, options []oss.Option) *OSS

func (*OSS) Delete

func (o *OSS) Delete(path string) error

func (*OSS) Read

func (o *OSS) Read(path string) (io.Reader, error)

func (*OSS) Type

func (o *OSS) Type() Type

func (*OSS) Write

func (o *OSS) Write(path string, r io.Reader) error

type Storager

type Storager interface {
	Type() Type
	Read(path string) (io.Reader, error)
	Write(path string, r io.Reader) error
	Delete(path string) error
}

type Type

type Type string
var (
	TypeFileSystem Type = "fs"
	TypeOSS        Type = "oss"
)

Jump to

Keyboard shortcuts

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