Documentation
¶
Index ¶
- type DBTX
- type Family
- type InsertFamilyParams
- type InsertSecretParams
- type InsertSubjectParams
- type InsertUserParams
- type Querier
- type Queries
- func (q *Queries) InsertFamily(ctx context.Context, arg InsertFamilyParams) error
- func (q *Queries) InsertSecret(ctx context.Context, arg InsertSecretParams) error
- func (q *Queries) InsertSubject(ctx context.Context, arg InsertSubjectParams) error
- func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) error
- func (q *Queries) InvalidateUser(ctx context.Context, subject string) error
- func (q *Queries) SelectFamily(ctx context.Context, arg SelectFamilyParams) (bool, error)
- func (q *Queries) SelectPasswordByUsername(ctx context.Context, username string) (string, error)
- func (q *Queries) SelectSecret(ctx context.Context, subject string) (string, error)
- func (q *Queries) SelectSubjectByUsername(ctx context.Context, username string) (string, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SQLiteDB
- func (s *SQLiteDB) Close() error
- func (s *SQLiteDB) InsertFamily(userId, family string, value bool) error
- func (s *SQLiteDB) InsertSecret(userId, secret string) error
- func (s *SQLiteDB) InsertSubject(username string, subject string) error
- func (s *SQLiteDB) InsertUser(username string, password string) error
- func (s *SQLiteDB) InvalidateUser(userId string) error
- func (s *SQLiteDB) NewUserId() (string, error)
- func (s *SQLiteDB) SelectFamily(userId, family string) bool
- func (s *SQLiteDB) SelectPasswordByUsername(username string) (string, error)
- func (s *SQLiteDB) SelectSecret(userId string) (string, error)
- func (s *SQLiteDB) SelectSubjectByUsername(username string) (string, error)
- type Secret
- type SelectFamilyParams
- type Subject
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InsertFamilyParams ¶
type InsertSecretParams ¶
type InsertSubjectParams ¶
type InsertUserParams ¶
type Querier ¶
type Querier interface {
//InsertFamily
//
// INSERT OR REPLACE INTO families (subject, family, valid) VALUES (?, ?, ?)
InsertFamily(ctx context.Context, arg InsertFamilyParams) error
//InsertSecret
//
// INSERT OR REPLACE INTO secrets (subject, secret) VALUES (?, ?)
InsertSecret(ctx context.Context, arg InsertSecretParams) error
//InsertSubject
//
// INSERT INTO subjects (username, subject) VALUES (?, ?)
InsertSubject(ctx context.Context, arg InsertSubjectParams) error
//InsertUser
//
// INSERT INTO users (username, password) VALUES (?, ?)
InsertUser(ctx context.Context, arg InsertUserParams) error
//InvalidateUser
//
// UPDATE families SET valid = FALSE WHERE subject = ?
InvalidateUser(ctx context.Context, subject string) error
//SelectFamily
//
// SELECT valid FROM families WHERE subject = ? AND family = ?
SelectFamily(ctx context.Context, arg SelectFamilyParams) (bool, error)
//SelectPasswordByUsername
//
// SELECT password FROM users WHERE username = ?
SelectPasswordByUsername(ctx context.Context, username string) (string, error)
//SelectSecret
//
// SELECT secret FROM secrets WHERE subject = ?
SelectSecret(ctx context.Context, subject string) (string, error)
//SelectSubjectByUsername
//
// SELECT subject FROM subjects WHERE username = ?
SelectSubjectByUsername(ctx context.Context, username string) (string, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) InsertFamily ¶
func (q *Queries) InsertFamily(ctx context.Context, arg InsertFamilyParams) error
InsertFamily
INSERT OR REPLACE INTO families (subject, family, valid) VALUES (?, ?, ?)
func (*Queries) InsertSecret ¶
func (q *Queries) InsertSecret(ctx context.Context, arg InsertSecretParams) error
InsertSecret
INSERT OR REPLACE INTO secrets (subject, secret) VALUES (?, ?)
func (*Queries) InsertSubject ¶
func (q *Queries) InsertSubject(ctx context.Context, arg InsertSubjectParams) error
InsertSubject
INSERT INTO subjects (username, subject) VALUES (?, ?)
func (*Queries) InsertUser ¶
func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) error
InsertUser
INSERT INTO users (username, password) VALUES (?, ?)
func (*Queries) SelectFamily ¶
SelectFamily
SELECT valid FROM families WHERE subject = ? AND family = ?
func (*Queries) SelectPasswordByUsername ¶
SelectPasswordByUsername
SELECT password FROM users WHERE username = ?
func (*Queries) SelectSubjectByUsername ¶
SelectSubjectByUsername
SELECT subject FROM subjects WHERE username = ?
type SQLiteDB ¶
type SQLiteDB struct {
// contains filtered or unexported fields
}
func NewSQLiteDB ¶
func (*SQLiteDB) InsertFamily ¶
func (*SQLiteDB) InsertSecret ¶
func (*SQLiteDB) InsertSubject ¶
func (*SQLiteDB) InvalidateUser ¶
func (*SQLiteDB) SelectFamily ¶
func (*SQLiteDB) SelectPasswordByUsername ¶
type SelectFamilyParams ¶
Click to show internal directories.
Click to hide internal directories.