Versions in this module Expand all Collapse all v0 v0.2.0 Jun 8, 2024 Changes in this version + var ErrMissingUser = errors.New("no user found") + func PublicKeySha(key string) string + type DB struct + func NewTursoDB(dbURL string) (*DB, error) + func (me *DB) AddUserPublicKey(userID int, key string) error + func (me *DB) CheckUserInfo(email string, username string) error + func (me *DB) CreateSession(email string, host string) (string, error) + func (me *DB) CreateUser(key string, email string, username string) (*User, error) + func (me *DB) DeleteUserPublicKey(userID int, key string) error + func (me *DB) GetSession(sessionID string) (*Session, error) + func (me *DB) GetUserWithEmail(email string) (*User, error) + func (me *DB) GetUserWithName(name string) (*User, error) + func (me *DB) SetUserName(publicID string, name string) (*User, error) + func (me *DB) UserForKey(key string) (*User, error) + func (me *DB) UserFromContext(ctx ssh.Context) (*User, error) + func (me *DB) WrapTransaction(f func(tx *sql.Tx) error) error + type PublicKey struct + CreatedAt *time.Time + ID int + Key string + UserID int + type Session struct + Email string + ExpiresAt time.Time + Host string + ID string + type User struct + CreatedAt *time.Time + Email string + ID int + Name string + PublicID string + PublicKey *PublicKey