Documentation ¶
Index ¶
- Variables
- func ResolveDiff(update *pb.RecordUpdate) []string
- type ChangeProcessor
- type DB
- func (d *DB) Clean(ctx context.Context) error
- func (d *DB) DeletePrintMove(ctx context.Context, userId int32, iid int64) error
- func (d *DB) DeleteRecord(ctx context.Context, userid int32, iid int64) error
- func (d *DB) DeleteSale(ctx context.Context, userid int32, saleid int64) error
- func (d *DB) DeleteUser(ctx context.Context, id string) error
- func (d *DB) DeleteWantlist(ctx context.Context, userid int32, name string) error
- func (d *DB) GenerateToken(ctx context.Context, token, secret string) (*pb.StoredUser, error)
- func (d *DB) GetIntent(ctx context.Context, userid int32, iid int64) (*pb.Intent, error)
- func (d *DB) GetLatestSnapshot(ctx context.Context, userid int32, org string) (*pb.OrganisationSnapshot, error)
- func (d *DB) GetMasterWant(ctx context.Context, userid int32, wid int64) (*pb.Want, error)
- func (d *DB) GetMasterWants(ctx context.Context, userid int32) ([]*pb.Want, 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) GetWant(ctx context.Context, userid int32, wid int64) (*pb.Want, error)
- func (d *DB) GetWantUpdates(ctx context.Context, userid int32, wid int64) ([]*pb.Update, 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) LoadMoveQuota(ctx context.Context, userId int32) (*pb.MoveQuota, error)
- func (d *DB) LoadPrintMoves(ctx context.Context, userId int32) ([]*pb.PrintMove, error)
- func (d *DB) LoadSnapshot(ctx context.Context, user *pb.StoredUser, org string, name string) (*pb.OrganisationSnapshot, error)
- func (d *DB) LoadSnapshotHash(ctx context.Context, user *pb.StoredUser, org string, hash string) (*pb.OrganisationSnapshot, error)
- func (d *DB) LoadWantlist(ctx context.Context, userId int32, 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) SaveMoveQuota(ctx context.Context, userId int32, mh *pb.MoveQuota) error
- func (d *DB) SavePrintMove(ctx context.Context, userId int32, m *pb.PrintMove) 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, reason string) 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 ChangeProcessor ¶ added in v0.744.0
type DB ¶ added in v0.67.0
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeletePrintMove ¶ added in v0.744.0
func (*DB) DeleteRecord ¶ added in v0.249.0
func (*DB) DeleteSale ¶ added in v0.532.0
func (*DB) DeleteUser ¶ added in v0.67.0
func (*DB) DeleteWantlist ¶ added in v0.968.0
func (*DB) GenerateToken ¶ added in v0.67.0
func (*DB) GetLatestSnapshot ¶ added in v0.229.0
func (*DB) GetMasterWant ¶ added in v0.852.0
func (*DB) GetMasterWants ¶ added in v0.667.0
func (*DB) GetRecords ¶ added in v0.79.0
func (*DB) GetUpdates ¶ added in v0.213.0
func (*DB) GetWantUpdates ¶ added in v0.630.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) LoadMoveQuota ¶ added in v0.353.0
func (*DB) LoadPrintMoves ¶ added in v0.744.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) LoadSnapshotHash ¶ added in v0.860.0
func (d *DB) LoadSnapshotHash(ctx context.Context, user *pb.StoredUser, org string, hash 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) SaveMoveQuota ¶ added in v0.353.0
func (*DB) SavePrintMove ¶ added in v0.744.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.StoredUser, 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, name string) (*pb.OrganisationSnapshot, error) LoadSnapshotHash(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, userid int32, org string) (*pb.OrganisationSnapshot, error) GetWant(ctx context.Context, userid int32, wid int64) (*pb.Want, error) GetMasterWant(ctx context.Context, userid int32, mid int64) (*pb.Want, error) GetWantUpdates(ctx context.Context, userid int32, wid int64) ([]*pb.Update, error) GetWants(ctx context.Context, userid int32) ([]*pb.Want, error) GetMasterWants(ctx context.Context, userid int32) ([]*pb.Want, error) SaveWant(ctx context.Context, userid int32, want *pb.Want, reason string) error SaveWantlist(ctx context.Context, userid int32, wantlist *pb.Wantlist) error LoadWantlist(ctx context.Context, userid int32, name string) (*pb.Wantlist, error) GetWantlists(ctx context.Context, userId int32) ([]*pb.Wantlist, error) DeleteWantlist(ctx context.Context, userid int32, name string) error SaveSale(ctx context.Context, userId int32, sale *pb.SaleInfo) error DeleteSale(ctx context.Context, userId int32, saleid int64) 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 LoadMoveQuota(ctx context.Context, userId int32) (*pb.MoveQuota, error) SaveMoveQuota(ctx context.Context, userId int32, mh *pb.MoveQuota) error SavePrintMove(ctx context.Context, userId int32, m *pb.PrintMove) error DeletePrintMove(ctx context.Context, userId int32, iid int64) error LoadPrintMoves(ctx context.Context, userId int32) ([]*pb.PrintMove, 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.