Documentation ¶
Index ¶
- Variables
- func ResolveDiff(update *pb.RecordUpdate) []string
- type DB
- func (d *DB) Clean(ctx context.Context) error
- func (d *DB) DeleteRecord(ctx context.Context, userid int32, iid int64) error
- func (d *DB) DeleteUser(ctx context.Context, id string) error
- func (d *DB) DeleteWant(ctx context.Context, user *pb.StoredUser, want int64) error
- func (d *DB) GenerateToken(ctx context.Context, token, secret string) (*pb.GramophileAuth, error)
- func (d *DB) GetIntent(ctx context.Context, userid int32, iid int64) (*pb.Intent, error)
- func (d *DB) GetLatestSnapshot(ctx context.Context, user *pb.StoredUser, org string) (*pb.OrganisationSnapshot, error)
- func (d *DB) GetRecord(ctx context.Context, userid int32, iid int64) (*pb.Record, error)
- func (d *DB) GetRecords(ctx context.Context, userid int32) ([]int64, error)
- func (d *DB) GetSale(ctx context.Context, userid int32, saleid int64) (*pb.SaleInfo, error)
- func (d *DB) GetSales(ctx context.Context, userid int32) ([]int64, error)
- func (d *DB) GetUpdates(ctx context.Context, userid int32, r *pb.Record) ([]*pb.RecordUpdate, error)
- func (d *DB) GetUser(ctx context.Context, user string) (*pb.StoredUser, error)
- func (d *DB) GetUsers(ctx context.Context) ([]string, error)
- func (d *DB) GetWantlists(ctx context.Context, userid int32) ([]*pb.Wantlist, error)
- func (d *DB) GetWants(ctx context.Context, userid int32) ([]*pb.Want, error)
- func (d *DB) LoadAllRecords(ctx context.Context, userid int32) ([]*pb.Record, error)
- func (d *DB) LoadLogins(ctx context.Context) (*pb.UserLoginAttempts, error)
- func (d *DB) LoadSnapshot(ctx context.Context, user *pb.StoredUser, org string, name string) (*pb.OrganisationSnapshot, error)
- func (d *DB) LoadWantlist(ctx context.Context, user *pb.StoredUser, wantlist string) (*pb.Wantlist, error)
- func (d *DB) SaveIntent(ctx context.Context, userid int32, iid int64, i *pb.Intent) error
- func (d *DB) SaveLogins(ctx context.Context, logins *pb.UserLoginAttempts) error
- func (d *DB) SaveRecord(ctx context.Context, userid int32, record *pb.Record) error
- func (d *DB) SaveRecordWithUpdate(ctx context.Context, userid int32, record *pb.Record, update *pb.RecordUpdate) error
- func (d *DB) SaveSale(ctx context.Context, userid int32, sale *pb.SaleInfo) error
- func (d *DB) SaveSnapshot(ctx context.Context, user *pb.StoredUser, org string, ...) error
- func (d *DB) SaveUpdate(ctx context.Context, userid int32, r *pb.Record, update *pb.RecordUpdate) error
- func (d *DB) SaveUser(ctx context.Context, user *pb.StoredUser) error
- func (d *DB) SaveWant(ctx context.Context, userid int32, want *pb.Want) error
- func (d *DB) SaveWantlist(ctx context.Context, userid int32, wantlist *pb.Wantlist) error
- type Database
Constants ¶
This section is empty.
Variables ¶
View Source
var (
USER_PREFIX = "gramophile/user/"
)
Functions ¶
func ResolveDiff ¶ added in v0.273.0
func ResolveDiff(update *pb.RecordUpdate) []string
Types ¶
type DB ¶ added in v0.67.0
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteRecord ¶ added in v0.249.0
func (*DB) DeleteUser ¶ added in v0.67.0
func (*DB) DeleteWant ¶ added in v0.294.0
func (*DB) GenerateToken ¶ added in v0.67.0
func (*DB) GetLatestSnapshot ¶ added in v0.229.0
func (d *DB) GetLatestSnapshot(ctx context.Context, user *pb.StoredUser, org string) (*pb.OrganisationSnapshot, error)
func (*DB) GetRecords ¶ added in v0.79.0
func (*DB) GetUpdates ¶ added in v0.213.0
func (*DB) GetWantlists ¶ added in v0.304.0
func (*DB) LoadAllRecords ¶ added in v0.304.0
func (*DB) LoadLogins ¶ added in v0.67.0
func (*DB) LoadSnapshot ¶ added in v0.231.0
func (d *DB) LoadSnapshot(ctx context.Context, user *pb.StoredUser, org string, name string) (*pb.OrganisationSnapshot, error)
func (*DB) LoadWantlist ¶ added in v0.282.0
func (*DB) SaveIntent ¶ added in v0.120.0
func (*DB) SaveLogins ¶ added in v0.67.0
func (*DB) SaveRecord ¶ added in v0.67.0
func (*DB) SaveRecordWithUpdate ¶ added in v0.351.0
func (*DB) SaveSnapshot ¶ added in v0.229.0
func (d *DB) SaveSnapshot(ctx context.Context, user *pb.StoredUser, org string, snapshot *pb.OrganisationSnapshot) error
func (*DB) SaveUpdate ¶ added in v0.273.0
type Database ¶
type Database interface { GetRecord(ctx context.Context, userid int32, iid int64) (*pb.Record, error) DeleteRecord(ctx context.Context, userid int32, iid int64) error GetRecords(ctx context.Context, userid int32) ([]int64, error) LoadAllRecords(ctx context.Context, userid int32) ([]*pb.Record, error) SaveRecord(ctx context.Context, userid int32, record *pb.Record) error SaveRecordWithUpdate(ctx context.Context, userid int32, record *pb.Record, update *pb.RecordUpdate) error GetUpdates(ctx context.Context, userid int32, record *pb.Record) ([]*pb.RecordUpdate, error) SaveUpdate(ctx context.Context, userid int32, record *pb.Record, update *pb.RecordUpdate) error GetIntent(ctx context.Context, userid int32, iid int64) (*pb.Intent, error) SaveIntent(ctx context.Context, userid int32, iid int64, i *pb.Intent) error LoadLogins(ctx context.Context) (*pb.UserLoginAttempts, error) SaveLogins(ctx context.Context, logins *pb.UserLoginAttempts) error GenerateToken(ctx context.Context, token, secret string) (*pb.GramophileAuth, error) SaveUser(ctx context.Context, user *pb.StoredUser) error DeleteUser(ctx context.Context, id string) error GetUser(ctx context.Context, user string) (*pb.StoredUser, error) GetUsers(ctx context.Context) ([]string, error) LoadSnapshot(ctx context.Context, user *pb.StoredUser, org string, hash string) (*pb.OrganisationSnapshot, error) SaveSnapshot(ctx context.Context, user *pb.StoredUser, org string, snapshot *pb.OrganisationSnapshot) error GetLatestSnapshot(ctx context.Context, user *pb.StoredUser, org string) (*pb.OrganisationSnapshot, error) GetWants(ctx context.Context, userid int32) ([]*pb.Want, error) SaveWant(ctx context.Context, userid int32, want *pb.Want) error DeleteWant(ctx context.Context, user *pb.StoredUser, want int64) error SaveWantlist(ctx context.Context, userid int32, wantlist *pb.Wantlist) error LoadWantlist(ctx context.Context, user *pb.StoredUser, name string) (*pb.Wantlist, error) GetWantlists(ctx context.Context, userId int32) ([]*pb.Wantlist, error) SaveSale(ctx context.Context, userId int32, sale *pb.SaleInfo) error GetSales(ctx context.Context, userId int32) ([]int64, error) GetSale(ctx context.Context, userId int32, saleId int64) (*pb.SaleInfo, error) Clean(ctx context.Context) error }
func NewDatabase ¶ added in v0.55.0
func NewTestDB ¶ added in v0.213.0
func NewTestDB(cl rstore_client.RStoreClient) Database
Click to show internal directories.
Click to hide internal directories.