db

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(item Item) ([][]byte, error)

Types

type BucketItem

type BucketItem interface {
	Bucket() string
}

type Item

type Item interface {
	BucketItem
	KeyValue
}

type Items

type Items interface {
	BucketItem
	KeyValues() []KeyValue
}

type KeyValue

type KeyValue interface {
	Key() string
	Value() []byte
}

type QueryOptions

type QueryOptions struct {
	Count  int
	Offset int
	Order  string
}

QueryOptions holds options for a query

type Store

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

func NewStore

func NewStore(dataDir string, contentTypes []string) (*Store, error)

func OpenUserStore

func OpenUserStore(userID string, dataDir string, contentTypes []string) (*Store, error)

func (*Store) CheckSlugForDuplicate

func (s *Store) CheckSlugForDuplicate(slug string) (string, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) ContentAll

func (s *Store) ContentAll(namespace string) [][]byte

ContentAll retrives all items from the database within the provided namespace

func (*Store) Delete

func (s *Store) Delete(item Item) error

func (*Store) Get

func (s *Store) Get(item Item) ([]byte, error)

func (*Store) NextSequence

func (s *Store) NextSequence(item BucketItem) (uint64, error)

func (*Store) Query

func (s *Store) Query(namespace string, opts QueryOptions) (int, [][]byte)

Query retrieves a set of content from the db based on options and returns the total number of content in the namespace and the content

func (*Store) RemoveIndex

func (s *Store) RemoveIndex(slug string) error

func (*Store) Set

func (s *Store) Set(item Item) error

func (*Store) SetIndex

func (s *Store) SetIndex(item KeyValue) error

func (*Store) Sort

func (s *Store) Sort(items Items) error

Jump to

Keyboard shortcuts

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