badger

package
v0.0.0-...-92baf9f Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir            string
	ProfileTTL     time.Duration
	GCInterval     time.Duration
	GCDiscardRatio float64
}

func (*Config) CreateStorage

func (conf *Config) CreateStorage(logger *log.Logger) (*Storage, io.Closer, error)

func (*Config) RegisterFlags

func (conf *Config) RegisterFlags(f *flag.FlagSet)

type ProfileList

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

func (*ProfileList) Close

func (pl *ProfileList) Close() error

func (*ProfileList) Next

func (pl *ProfileList) Next() bool

func (*ProfileList) Profile

func (pl *ProfileList) Profile() (io.Reader, error)

type Storage

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

func NewStorage

func NewStorage(logger *log.Logger, db *badger.DB, ttl time.Duration) *Storage

func (*Storage) FindProfileIDs

func (st *Storage) FindProfileIDs(ctx context.Context, params *storage.FindProfilesParams) ([]profile.ID, error)

func (*Storage) FindProfiles

func (st *Storage) FindProfiles(ctx context.Context, params *storage.FindProfilesParams) ([]profile.Meta, error)

func (*Storage) ListProfiles

func (st *Storage) ListProfiles(ctx context.Context, pids []profile.ID) (storage.ProfileList, error)

func (*Storage) ListServices

func (st *Storage) ListServices(ctx context.Context) ([]string, error)

func (*Storage) WriteProfile

func (st *Storage) WriteProfile(ctx context.Context, params *storage.WriteProfileParams, r io.Reader) (profile.Meta, error)

Jump to

Keyboard shortcuts

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