store

package
v0.0.0-...-18492a3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bolt

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

Bolt store data in BoldDB

func NewBoltStorage

func NewBoltStorage(fileName string) (*Bolt, error)

NewBoltStorage create Bolt Store.

func (*Bolt) Close

func (b *Bolt) Close() error

Close storage

func (*Bolt) DeleteBlob

func (b *Bolt) DeleteBlob(key string) error

func (*Bolt) GetBlob

func (b *Bolt) GetBlob(key string) (io.Reader, map[string]string, error)

func (*Bolt) SetBlob

func (b *Bolt) SetBlob(key string, reader io.Reader, meta map[string]string, _ time.Duration) error

Save data in storage

type S3Config

type S3Config struct {
	Endpoint        string `json:"endpoint"`
	AccessKeyID     string `json:"access_key"`
	SecretAccessKey string `json:"secret"`
	Bucket          string `json:"bucket"`
}

type S3Storage

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

func NewS3Storage

func NewS3Storage(cfg S3Config) (*S3Storage, error)

func (*S3Storage) DeleteBlob

func (s3 *S3Storage) DeleteBlob(key string) error

func (*S3Storage) GetBlob

func (s3 *S3Storage) GetBlob(key string) (io.Reader, map[string]string, error)

func (*S3Storage) GetMeta

func (s3 *S3Storage) GetMeta(key string) (map[string]string, error)

func (*S3Storage) SetBlob

func (s3 *S3Storage) SetBlob(key string, reader io.Reader, meta map[string]string, ttl time.Duration) error

Jump to

Keyboard shortcuts

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