db

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	UserForKey(key string, create bool) (*charm.User, error)
	LinkUserKey(user *charm.User, key string) error
	UnlinkUserKey(user *charm.User, key string) error
	KeysForUser(user *charm.User) ([]*charm.PublicKey, error)
	MergeUsers(userID1 int, userID2 int) error
	EncryptKeysForPublicKey(pk *charm.PublicKey) ([]*charm.EncryptKey, error)
	AddEncryptKeyForPublicKey(user *charm.User, publicKey string, globalID string, encryptedKey string, createdAt *time.Time) error
	GetUserWithID(charmID string) (*charm.User, error)
	GetUserWithName(name string) (*charm.User, error)
	SetUserName(charmID string, name string) (*charm.User, error)
	UserCount() (int, error)
	UserNameCount() (int, error)
	NextSeq(user *charm.User, name string) (uint64, error)
	GetSeq(user *charm.User, name string) (uint64, error)
	PostNews(subject string, body string, tags []string) error
	GetNews(id string) (*charm.News, error)
	GetNewsList(tag string, page int) ([]*charm.News, error)
	SetToken(token charm.Token) error
	DeleteToken(token charm.Token) error
	Close() error
}

DB specifies the business logic methods a datastore must implement as the Charm Cloud backend.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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