db

package
v0.0.0-...-f6e517b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethod

type AuthMethod struct {
	ID         int64
	Userid     []byte
	Created    int64
	Provider   string
	Identifier string
	Secret     string
}

type CreateSessionParams

type CreateSessionParams struct {
	ID      []byte
	Created int64
	Updated int64
	Expires int64
	Data    []byte
}

type CreateUserParams

type CreateUserParams struct {
	ID      []byte
	Created int64
	Email   string
	Name    string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Permission

type Permission struct {
	ID   int64
	Name string
}

type Provider

type Provider struct {
	ID   int64
	Type string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CleanupSessions

func (q *Queries) CleanupSessions(ctx context.Context, expires int64) error

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id []byte) error

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id []byte) (Session, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id []byte) (User, error)

func (*Queries) UpdateSessionData

func (q *Queries) UpdateSessionData(ctx context.Context, arg UpdateSessionDataParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Session

type Session struct {
	ID      []byte
	Created int64
	Updated int64
	Expires int64
	Data    []byte
}

type UpdateSessionDataParams

type UpdateSessionDataParams struct {
	Updated int64
	Expires int64
	Data    []byte
	ID      []byte
}

type User

type User struct {
	ID      []byte
	Created int64
	Email   string
	Name    string
}

type UserPermission

type UserPermission struct {
	ID         int64
	Userid     []byte
	Created    int64
	Permission string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL