badgerdb

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserRecordKey string = "public_key:%s"
	UserIDKey     string = "key:%s"
	PostRecordKey string = "post:%d:%s"
)

Variables

This section is empty.

Functions

func Close

func Close(wg *sync.WaitGroup) error

func DatabasePath

func DatabasePath() string

func SetDatabasePath

func SetDatabasePath(newPath string)

func SetValuePath

func SetValuePath(newPath string)

func ValuePath

func ValuePath() string

Types

type DB

type DB struct {
	*badger.DB
}

func GetConnection

func GetConnection() (*DB, error)

func (*DB) AddPost

func (d *DB) AddPost(email string, req models.SendPostRequest) error

func (*DB) GetKeys

func (d *DB) GetKeys() ([]byte, error)

func (*DB) GetPublicKey

func (d *DB) GetPublicKey(email string) (ssh.PublicKey, error)

func (*DB) RegisterUser

func (d *DB) RegisterUser(request models.RegisterRequest) error

Jump to

Keyboard shortcuts

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