database

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ItemBucketIndexSuffix = "__index"
View Source
const ItemBucketPrefix = "__"

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func New

func New(dataDir string) (*Database, error)

func (*Database) AdminDataDir

func (d *Database) AdminDataDir() string

func (*Database) AllContent

func (d *Database) AllContent(namespace string) [][]byte

func (*Database) AllUploads

func (d *Database) AllUploads() ([][]byte, error)

func (*Database) CheckSlugForDuplicate

func (d *Database) CheckSlugForDuplicate(namespace string, slug string) (string, error)

func (*Database) Close

func (d *Database) Close()

func (*Database) ContentByPrefix

func (d *Database) ContentByPrefix(namespace, prefix string) ([][]byte, error)

func (*Database) DeleteContent

func (d *Database) DeleteContent(namespace string, id string, slug string, hash string) error

func (*Database) DeleteUpload

func (d *Database) DeleteUpload(id string) error

func (*Database) GetContent

func (d *Database) GetContent(namespace string, id string) ([]byte, error)

func (*Database) GetIdByHash

func (d *Database) GetIdByHash(namespace string, hash string) ([]byte, error)

func (*Database) GetRandomContent added in v0.1.27

func (d *Database) GetRandomContent(namespace string) ([]byte, error)

func (*Database) GetUpload

func (d *Database) GetUpload(id string) ([]byte, error)

func (*Database) LoadConfig

func (d *Database) LoadConfig() ([]byte, error)

func (*Database) NewContent

func (d *Database) NewContent(ci any, data []byte) error

func (*Database) NewUpload

func (d *Database) NewUpload(id, slug string, data []byte) error

func (*Database) NextContentId

func (d *Database) NextContentId(ns string) (uint64, error)

func (*Database) NextUploadId

func (d *Database) NextUploadId() (uint64, error)

func (*Database) NextUserId

func (d *Database) NextUserId(email string) (uint64, error)

func (*Database) Open

func (d *Database) Open(next http.HandlerFunc) http.HandlerFunc

func (*Database) OpenFromSignature added in v0.2.1

func (d *Database) OpenFromSignature(next http.HandlerFunc) http.HandlerFunc

func (*Database) OpenPublic added in v0.2.1

func (d *Database) OpenPublic(next http.HandlerFunc) http.HandlerFunc

func (*Database) PutConfig

func (d *Database) PutConfig(data []byte) error

func (*Database) PutContent

func (d *Database) PutContent(ci any, data []byte) error

func (*Database) PutSortedContent

func (d *Database) PutSortedContent(namespace string, m map[string][]byte) error

func (*Database) PutUser

func (d *Database) PutUser(email string, data []byte) error

func (*Database) Query

func (d *Database) Query(namespace string, opts db.QueryOptions) (int, [][]byte)

func (*Database) RegisterContentBuckets

func (d *Database) RegisterContentBuckets(contentTypeNames []string)

func (*Database) StartAdminDatabase

func (d *Database) StartAdminDatabase(adminTypeNames []string) error

func (*Database) StartUserDatabase

func (d *Database) StartUserDatabase(email string) error

func (*Database) SystemInitComplete

func (d *Database) SystemInitComplete() bool

func (*Database) User

func (d *Database) User(email string) ([]byte, error)

func (*Database) UserDataDir

func (d *Database) UserDataDir() string

func (*Database) UserDir

func (d *Database) UserDir() string

func (*Database) Users

func (d *Database) Users() [][]byte

Jump to

Keyboard shortcuts

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