sqlc

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationCode

type AuthorizationCode struct {
	ID        string
	UserID    string
	ClientID  string
	Scopes    string
	Os        sql.NullString
	Browser   sql.NullString
	ExpiresAt sql.NullTime
}

type AuthorizationHistory

type AuthorizationHistory struct {
	UserID       string
	ClientID     string
	AuthorizedAt time.Time
}

type Client

type Client struct {
	ID                   string
	SecretHash           string
	Name                 string
	PictureUrl           sql.NullString
	AuthCallbackUrls     string
	LogoutCallbackUrls   string
	BackchannelLogoutUrl sql.NullString
	TokenExpiration      int64
	CreatedAt            time.Time
}

type CreateAuthzCodeParams

type CreateAuthzCodeParams struct {
	ID        string
	UserID    string
	ClientID  string
	Scopes    string
	Os        sql.NullString
	Browser   sql.NullString
	ExpiresAt sql.NullTime
}

type CreateAuthzHistoryParams

type CreateAuthzHistoryParams struct {
	UserID   string
	ClientID string
}

type CreateClientParams

type CreateClientParams struct {
	ID                   string
	SecretHash           string
	Name                 string
	AuthCallbackUrls     string
	LogoutCallbackUrls   string
	PictureUrl           sql.NullString
	BackchannelLogoutUrl sql.NullString
	TokenExpiration      int64
}

type CreateSessionParams

type CreateSessionParams struct {
	ID        string
	UserID    string
	ClientID  sql.NullString
	ExpiresAt time.Time
	Os        sql.NullString
	Browser   sql.NullString
}

type CreateUserParams

type CreateUserParams struct {
	ID             string
	Email          string
	HashedPassword sql.NullString
	AvatarUrl      sql.NullString
}

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 GetAuthzHistoryParams

type GetAuthzHistoryParams struct {
	UserID   string
	ClientID string
}

type GetClientByNameForUnmatchingIDParams

type GetClientByNameForUnmatchingIDParams struct {
	Name string
	ID   string
}

type GetSessionWithClientForUserIDRow

type GetSessionWithClientForUserIDRow struct {
	ID         string
	CreatedAt  time.Time
	ExpiresAt  time.Time
	Os         sql.NullString
	Browser    sql.NullString
	ClientName sql.NullString
}

type GetSessionWithClientRow

type GetSessionWithClientRow struct {
	ID                   string
	ClientID             string
	ClientName           string
	LogoutCallbackUrls   string
	BackchannelLogoutUrl sql.NullString
}

type GetSessionWithOptionalClientRow

type GetSessionWithOptionalClientRow struct {
	ID                   string
	ClientID             sql.NullString
	ClientName           sql.NullString
	LogoutCallbackUrls   sql.NullString
	BackchannelLogoutUrl sql.NullString
}

type GetSessionWithUserRow

type GetSessionWithUserRow struct {
	ID        string
	ExpiresAt time.Time
	UserID    string
	Email     string
	AvatarUrl sql.NullString
	IsAdmin   bool
}

type GetUserAndClientCountRow

type GetUserAndClientCountRow struct {
	UserCount   int64
	ClientCount int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAuthzCode

func (q *Queries) CreateAuthzCode(ctx context.Context, arg CreateAuthzCodeParams) (sql.Result, error)

func (*Queries) CreateAuthzHistory

func (q *Queries) CreateAuthzHistory(ctx context.Context, arg CreateAuthzHistoryParams) (sql.Result, error)

func (*Queries) CreateClient

func (q *Queries) CreateClient(ctx context.Context, arg CreateClientParams) (sql.Result, error)

func (*Queries) CreateSession

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

func (*Queries) CreateUser

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

func (*Queries) DeleteAuthzCode

func (q *Queries) DeleteAuthzCode(ctx context.Context, id string) error

func (*Queries) DeleteClient

func (q *Queries) DeleteClient(ctx context.Context, id string) error

func (*Queries) DeleteExpiredAuthzCode

func (q *Queries) DeleteExpiredAuthzCode(ctx context.Context) error

func (*Queries) DeleteExpiredSessions

func (q *Queries) DeleteExpiredSessions(ctx context.Context) error

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id string) error

func (*Queries) GetAuthzCode

func (q *Queries) GetAuthzCode(ctx context.Context, id string) (AuthorizationCode, error)

func (*Queries) GetAuthzHistory

func (q *Queries) GetAuthzHistory(ctx context.Context, arg GetAuthzHistoryParams) (AuthorizationHistory, error)

func (*Queries) GetClient

func (q *Queries) GetClient(ctx context.Context, id string) (Client, error)

func (*Queries) GetClientByName

func (q *Queries) GetClientByName(ctx context.Context, name string) (Client, error)

func (*Queries) GetClientByNameForUnmatchingID

func (q *Queries) GetClientByNameForUnmatchingID(ctx context.Context, arg GetClientByNameForUnmatchingIDParams) (Client, error)

func (*Queries) GetClients

func (q *Queries) GetClients(ctx context.Context) ([]Client, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id string) (Session, error)

func (*Queries) GetSessionWithClient

func (q *Queries) GetSessionWithClient(ctx context.Context, id string) (GetSessionWithClientRow, error)

func (*Queries) GetSessionWithClientForUserID

func (q *Queries) GetSessionWithClientForUserID(ctx context.Context, userID string) ([]GetSessionWithClientForUserIDRow, error)

func (*Queries) GetSessionWithOptionalClient

func (q *Queries) GetSessionWithOptionalClient(ctx context.Context, id string) (GetSessionWithOptionalClientRow, error)

func (*Queries) GetSessionWithUser

func (q *Queries) GetSessionWithUser(ctx context.Context, id string) (GetSessionWithUserRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id string) (User, error)

func (*Queries) GetUserAndClientCount

func (q *Queries) GetUserAndClientCount(ctx context.Context) (GetUserAndClientCountRow, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context) ([]User, error)

func (*Queries) UpdateClient

func (q *Queries) UpdateClient(ctx context.Context, arg UpdateClientParams) error

func (*Queries) UpdateUserAvatar

func (q *Queries) UpdateUserAvatar(ctx context.Context, arg UpdateUserAvatarParams) error

func (*Queries) UpdateUserPasswordHash

func (q *Queries) UpdateUserPasswordHash(ctx context.Context, arg UpdateUserPasswordHashParams) error

func (*Queries) WithTx

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

type Session

type Session struct {
	ID        string
	UserID    string
	ClientID  sql.NullString
	CreatedAt time.Time
	ExpiresAt time.Time
	Os        sql.NullString
	Browser   sql.NullString
}

type UpdateClientParams

type UpdateClientParams struct {
	Name                 string
	AuthCallbackUrls     string
	LogoutCallbackUrls   string
	PictureUrl           sql.NullString
	BackchannelLogoutUrl sql.NullString
	TokenExpiration      int64
	ID                   string
}

type UpdateUserAvatarParams

type UpdateUserAvatarParams struct {
	AvatarUrl sql.NullString
	ID        string
}

type UpdateUserPasswordHashParams

type UpdateUserPasswordHashParams struct {
	HashedPassword sql.NullString
	ID             string
}

type User

type User struct {
	ID             string
	Email          string
	AvatarUrl      sql.NullString
	HashedPassword sql.NullString
	IsAdmin        bool
	CreatedAt      time.Time
}

Jump to

Keyboard shortcuts

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