Documentation ¶
Index ¶
- Variables
- func PublicKeySha(key string) string
- type DB
- 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
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMissingUser = errors.New("no user found")
)
Functions ¶
func PublicKeySha ¶
PublicKeySha returns the SHA for a public key in hex format.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func NewTursoDB ¶
func (*DB) CreateUser ¶
func (*DB) SetUserName ¶
SetUserName sets a user name for the given user id.
func (*DB) UserForKey ¶
UserForKey returns the user for the given key, or optionally creates a new user with it.
Click to show internal directories.
Click to hide internal directories.