oss

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLOption

type ACLOption func(o *aclOption)

ACLOption ACL option function

func UsePrivateACL

func UsePrivateACL() ACLOption

UsePrivateACL use private ACL

func UsePublicACL

func UsePublicACL() ACLOption

UsePublicACL use private ACL

type ACLType

type ACLType int32
const (
	//Private 不公开访问权限
	Private ACLType = 0
	//PublicRead 可公开读的访问权限
	PublicRead ACLType = 1
	//DefaultACL 缺省权限(由全局配置决定,例如OSS整体的bucket权限)
	DefaultACL ACLType = 2
)

type IOssStore

type IOssStore interface {
	//Save save k-v
	Save(ctx context.Context, key string, data []byte, acl ACLType) error

	//Delete delete k
	Delete(ctx context.Context, key string) error

	//DeleteMulti delete multi keys
	DeleteMulti(ctx context.Context, keys []string) ([]string, error)

	//Get get v from k
	Get(ctx context.Context, key string) (data []byte, err error)
}

IOssStore store interface

type OssStore

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

OssStore store container

var (
	//OssStoreIns global instance
	OssStoreIns *OssStore
)

func (*OssStore) Delete

func (c *OssStore) Delete(ctx context.Context, key string) error

Delete delete k

func (*OssStore) DeleteMulti

func (c *OssStore) DeleteMulti(ctx context.Context, keys []string) ([]string, error)

DeleteMulti delete multi

func (*OssStore) Get

func (c *OssStore) Get(ctx context.Context, key string) (data []byte, err error)

Get get v from k

func (*OssStore) Save

func (c *OssStore) Save(ctx context.Context, key string, data []byte, opts ...ACLOption) error

Save save k-v

func (*OssStore) SetStore

func (c *OssStore) SetStore(i IOssStore)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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