storage

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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