rawdb

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K           = "_id"
	V           = "_value"
	MongoDBType = "MongoDB"
)
View Source
const (
	ForeverLandEndpoint = "https://endpoint.4everland.co"
	S3Type              = "s3"
)
View Source
const (
	AliyunType = "aliyun"
)

refer https://help.aliyun.com/document_detail/32157.html?spm=a2c4g.11186623.0.0.1a4b32bcxaC4kR

View Source
const (
	BoltType = "boltdb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunDB added in v1.0.27

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

func NewAliyunDB added in v1.0.27

func NewAliyunDB(endpoint, accKey, accessKeySecret, bktPrefix string) (*AliyunDB, error)

func (*AliyunDB) Close added in v1.0.27

func (a *AliyunDB) Close() (err error)

func (*AliyunDB) Delete added in v1.0.27

func (a *AliyunDB) Delete(bucket, key string) (err error)

func (*AliyunDB) Exist added in v1.1.0

func (a *AliyunDB) Exist(bucket, key string) bool

func (*AliyunDB) Get added in v1.0.27

func (a *AliyunDB) Get(bucket, key string) (data []byte, err error)

func (*AliyunDB) GetAllKey added in v1.0.27

func (a *AliyunDB) GetAllKey(bucket string) (keys []string, err error)

func (*AliyunDB) GetStream added in v1.1.0

func (a *AliyunDB) GetStream(bucket, key string) (data *os.File, err error)

func (*AliyunDB) Put added in v1.0.27

func (a *AliyunDB) Put(bucket, key string, value interface{}) (err error)

func (*AliyunDB) Type added in v1.1.0

func (a *AliyunDB) Type() string

type BoltDB

type BoltDB struct {
	Db *bolt.DB
}

func NewBoltDB

func NewBoltDB(boltDirPath string) (*BoltDB, error)

func (*BoltDB) Close

func (s *BoltDB) Close() (err error)

func (*BoltDB) Delete

func (s *BoltDB) Delete(bucket, key string) (err error)

func (*BoltDB) Exist added in v1.1.0

func (s *BoltDB) Exist(bucket, key string) bool

func (*BoltDB) Get

func (s *BoltDB) Get(bucket, key string) (data []byte, err error)

func (*BoltDB) GetAllKey

func (s *BoltDB) GetAllKey(bucket string) (keys []string, err error)

func (*BoltDB) GetStream added in v1.1.0

func (s *BoltDB) GetStream(bucket, key string) (data *os.File, err error)

func (*BoltDB) Put

func (s *BoltDB) Put(bucket, key string, value interface{}) (err error)

func (*BoltDB) Type added in v1.1.0

func (s *BoltDB) Type() string

type KeyValueDB

type KeyValueDB interface {
	Put(bucket, key string, value interface{}) (err error)

	Get(bucket, key string) (data []byte, err error)

	GetStream(bucket, key string) (data *os.File, err error)

	GetAllKey(bucket string) (keys []string, err error)

	Delete(bucket, key string) (err error)

	Close() (err error)

	Type() string

	Exist(bucket, key string) bool
}

type MongoDB added in v1.1.3

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

func NewMongoDB added in v1.1.3

func NewMongoDB(ctx context.Context, uri string) (*MongoDB, error)

NewMongoDB uri be like mongodb://user:password@localhost:27017

func (*MongoDB) Close added in v1.1.3

func (m *MongoDB) Close() (err error)

func (*MongoDB) Delete added in v1.1.3

func (m *MongoDB) Delete(bucket, key string) (err error)

func (*MongoDB) Exist added in v1.1.3

func (m *MongoDB) Exist(bucket, key string) bool

func (*MongoDB) Get added in v1.1.3

func (m *MongoDB) Get(bucket, key string) (data []byte, err error)

func (*MongoDB) GetAllKey added in v1.1.3

func (m *MongoDB) GetAllKey(bucket string) (keys []string, err error)

func (*MongoDB) GetStream added in v1.1.3

func (m *MongoDB) GetStream(bucket, key string) (data *os.File, err error)

func (*MongoDB) Put added in v1.1.3

func (m *MongoDB) Put(bucket, key string, value interface{}) (err error)

func (*MongoDB) Type added in v1.1.3

func (m *MongoDB) Type() string

type S3DB

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

func NewS3DB

func NewS3DB(accKey, secretKey, region, bktPrefix, endpoint string) (*S3DB, error)

func (*S3DB) Close

func (s *S3DB) Close() (err error)

func (*S3DB) Delete

func (s *S3DB) Delete(bucket, key string) (err error)

func (*S3DB) Exist added in v1.1.0

func (s *S3DB) Exist(bucket, key string) bool

func (*S3DB) Get

func (s *S3DB) Get(bucket, key string) (data []byte, err error)

func (*S3DB) GetAllKey

func (s *S3DB) GetAllKey(bucket string) (keys []string, err error)

func (*S3DB) GetStream added in v1.1.0

func (s *S3DB) GetStream(bucket, key string) (data *os.File, err error)

func (*S3DB) Put

func (s *S3DB) Put(bucket, key string, value interface{}) (err error)

func (*S3DB) Type added in v1.1.0

func (s *S3DB) Type() string

Jump to

Keyboard shortcuts

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