userdb

package
v0.0.0-...-10d9413 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ID      int64
	Channel string
	Title   string
	Default bool
}

type CreateUserParams

type CreateUserParams struct {
	ID         pgtype.UUID
	Username   string
	GivenName  string
	FamilyName string
	Enabled    bool
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ChanListByUserID

func (q *Queries) ChanListByUserID(ctx context.Context, userID pgtype.UUID) ([]Channel, error)

func (*Queries) CreateUser

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

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) UserCanPublish

func (q *Queries) UserCanPublish(ctx context.Context, arg UserCanPublishParams) (int64, error)

func (*Queries) UserCanSubscribe

func (q *Queries) UserCanSubscribe(ctx context.Context, arg UserCanSubscribeParams) (int64, error)

func (*Queries) UserListByChanID

func (q *Queries) UserListByChanID(ctx context.Context, chanID int64) ([]User, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID         pgtype.UUID
	Username   string
	GivenName  string
	FamilyName string
	Enabled    bool
}

type UserCanPublishParams

type UserCanPublishParams struct {
	ID      pgtype.UUID
	Channel string
}

type UserCanSubscribeParams

type UserCanSubscribeParams struct {
	ID      pgtype.UUID
	Channel string
}

type UserChannel

type UserChannel struct {
	UserID     pgtype.UUID
	ChanID     int64
	CanPublish bool
}

Jump to

Keyboard shortcuts

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