Versions in this module Expand all Collapse all v0 v0.2.7 Sep 28, 2024 Changes in this version + const EMAIL_VERIFICATION_CODE_ALPHABET + const EMAIL_VERIFICATION_CODE_LENGTH + const O_DELETE + const O_DELETE_INGRIDIENT + const O_GRANT_SHARE + const O_NO_PERMS + const O_OWNER + const O_RENAME_BENTO + const O_RENAME_INGRIDIENT + const O_REVOKE_SHARE + const O_SHARE + const O_WRITE + const O_WRITE_INGRIDIENT + const PG_ERR_UNIQUE_VIOLATION + const S_ALL + const S_DELETE + const S_DELETE_INGRIDIENT + const S_RENAME_BENTO + const S_RENAME_INGRIDIENT + const S_REVOKE_SHARE + const S_SHARE + const S_WRITE + const S_WRITE_INGRIDIENT + var TextToBinPerms map[string]int = map[string]int + func Close() error + func Connect(dbUrl string) error + func DeleteBentoPermissionById(permsId int64) error + func DeleteEmailVerificationWithUserId(uid string) (sql.Result, error) + func DeleteIngridient(bentoId, name string) error + func DeleteTokensOwnedByUser(tx *sql.Tx, userId string) (sql.Result, error) + func ExistsBentoPermissionByUserBentoId(userId, bentoId string) (bool, error) + func ExistsUserWithEmail(email string) (bool, error) + func IsTokenValid(tokenId, tokenType string) error + func Ping() error + func RenameIngridient(bentoId, oldName, newName string) error + func ReseasonIngridient(bentoId, name, value string) error + func Rollback(tx *sql.Tx, requestId string) error + func SaveBentoEntryBatch(entries []BentoEntry) error + func StartTx() (*sql.Tx, error) + type Bento struct + CreatedAt time.Time + Id string + Name string + OwnerId string + PubKey string + UpdatedAt time.Time + func GetBentoWithId(id string) (*Bento, error) + func NewBentoTx(tx *sql.Tx, name, ownerId, pubKey string) (*Bento, error) + func (b *Bento) Delete(tx *sql.Tx) (sql.Result, error) + func (b *Bento) Rename(newName string) error + func (b *Bento) VerifySignature(signature string, challenge string) error + type BentoEntry struct + BentoId string + CreatedAt time.Time + Id int64 + Name string + UpdatedAt time.Time + Value string + func GetEntriesForBento(bentoId string) ([]BentoEntry, error) + func NewBentoEntry(name, value, bentoId string) BentoEntry + type BentoPermission struct + BentoId string + CreatedAt time.Time + Id int64 + Permissions int + UpdatedAt time.Time + UserId string + func GetBentoPermissionByUserBentoId(userId, bentoId string) (*BentoPermission, error) + func NewBentoPermissionTx(tx *sql.Tx, userId, bentoId string, permissions int) (*BentoPermission, error) + type EmailVerification struct + Code string + CreatedAt time.Time + ExpiresAt time.Time + Id int64 + UserId string + func GetEmailVerificationWithCode(code string) (*EmailVerification, error) + func NewEmailVerification(userId string) (*EmailVerification, error) + func (ev *EmailVerification) Delete(tx *sql.Tx) (sql.Result, error) + func (ev *EmailVerification) Update(tx *sql.Tx) (sql.Result, error) + type Model interface + Delete func(tx *sql.Tx) (sql.Result, error) + Update func(tx *sql.Tx) (sql.Result, error) + type PasswordResetCode struct + Code string + CreatedAt time.Time + ExpiresAt time.Time + Id int64 + UpdatedAt time.Time + UserId string + func GetPasswordResetCodeByUserId(uid string) (*PasswordResetCode, error) + func NewOrUpdatePasswordResetCode(uid string) (*PasswordResetCode, error) + func (p *PasswordResetCode) Delete(tx *sql.Tx) (sql.Result, error) + type User struct + CreatedAt time.Time + Email string + EmailVerified bool + Id string + Name string + Password string + UpdatedAt time.Time + func GetUserWithEmail(email string) (*User, error) + func GetUserWithEmailAndPassword(email, password string) (*User, error) + func GetUserWithId(id string) (*User, error) + func NewUser(email, password, name string) (*User, error) + func (u *User) Delete(tx *sql.Tx) (sql.Result, error) + func (u *User) SetEmailVerifiedTx(tx *sql.Tx, v bool) (sql.Result, error) + func (u *User) Update(tx *sql.Tx) (sql.Result, error) v0.2.6-alpha.1 Sep 19, 2024 v0.2.6-alpha.0 Sep 19, 2024 v0.2.5-alpha.1 Sep 18, 2024 v0.2.5-alpha Sep 18, 2024 v0.2.4-alpha.1 Jul 30, 2024 v0.2.4-alpha Jul 30, 2024 v0.2.3-alpha Jul 29, 2024 v0.2.2-alpha.1 Jul 23, 2024 v0.2.2-alpha Jul 23, 2024 v0.2.1-alpha.1 Jul 23, 2024 v0.2.1-alpha Jul 23, 2024 v0.2.0-alpha.3 Jul 17, 2024 v0.2.0-alpha.2 Jul 17, 2024 v0.2.0-alpha.1 Jul 16, 2024 v0.2.0-alpha Jul 16, 2024