pgquery

package
v0.0.0-...-e777c55 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserParams

type CreateUserParams struct {
	LoginID    string      `json:"login_id"`
	Password   string      `json:"password"`
	Name       string      `json:"name"`
	CreatedBy  pgtype.UUID `json:"created_by"`
	FromSystem bool        `json:"from_system"`
}

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 MChannel

type MChannel struct {
	ID                 uuid.UUID        `json:"id"`
	Name               string           `json:"name"`
	AdminGroupID       uuid.UUID        `json:"admin_group_id"`
	ConnectableGroupID uuid.UUID        `json:"connectable_group_id"`
	LastActivityAt     pgtype.Timestamp `json:"last_activity_at"`
	CreatedBy          pgtype.UUID      `json:"created_by"`
	UpdatedBy          pgtype.UUID      `json:"updated_by"`
	CreatedAt          time.Time        `json:"created_at"`
	UpdatedAt          time.Time        `json:"updated_at"`
}

type MGroup

type MGroup struct {
	ID          uuid.UUID   `json:"id"`
	Name        string      `json:"name"`
	IsOpen      bool        `json:"is_open"`
	IsPrimitive bool        `json:"is_primitive"`
	IsPersonal  bool        `json:"is_personal"`
	CreatedBy   pgtype.UUID `json:"created_by"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
}

type MRole

type MRole struct {
	ID         uuid.UUID `json:"id"`
	Name       string    `json:"name"`
	Detail     string    `json:"detail"`
	CategoryID uuid.UUID `json:"category_id"`
}

type MRoleCategory

type MRoleCategory struct {
	ID     uuid.UUID `json:"id"`
	Name   string    `json:"name"`
	Detail string    `json:"detail"`
}

type MStorage

type MStorage struct {
	ID        uuid.UUID   `json:"id"`
	Name      string      `json:"name"`
	Prefix    string      `json:"prefix"`
	CreatedBy pgtype.UUID `json:"created_by"`
	CreatedAt time.Time   `json:"created_at"`
	UpdatedAt time.Time   `json:"updated_at"`
}

type MStorageAccessPermission

type MStorageAccessPermission struct {
	ID   uuid.UUID `json:"id"`
	Mode string    `json:"mode"`
}

type MUser

type MUser struct {
	ID             uuid.UUID        `json:"id"`
	LoginID        string           `json:"login_id"`
	Password       string           `json:"password"`
	Name           string           `json:"name"`
	LastLoggedInAt pgtype.Timestamp `json:"last_logged_in_at"`
	CreatedBy      pgtype.UUID      `json:"created_by"`
	FromSystem     bool             `json:"from_system"`
	CreatedAt      time.Time        `json:"created_at"`
	UpdatedAt      time.Time        `json:"updated_at"`
}

type MUserPermission

type MUserPermission struct {
	ID         uuid.UUID `json:"id"`
	Name       string    `json:"name"`
	Detail     string    `json:"detail"`
	CategoryID uuid.UUID `json:"category_id"`
}

type MUserPermissionCategory

type MUserPermissionCategory struct {
	ID     uuid.UUID `json:"id"`
	Name   string    `json:"name"`
	Detail string    `json:"detail"`
}

type Querier

type Querier interface {
	CreateUser(ctx context.Context, arg CreateUserParams) (MUser, error)
	DeleteUser(ctx context.Context, id uuid.UUID) error
	FindUser(ctx context.Context, id uuid.UUID) (MUser, error)
	FindUserForLogin(ctx context.Context, loginID string) (MUser, error)
	GetUsers(ctx context.Context) ([]MUser, error)
	GetUsersFromName(ctx context.Context, dollar_1 pgtype.Text) ([]MUser, error)
	UpdateUserLoggedAt(ctx context.Context, id uuid.UUID) (MUser, error)
	UpdateUserName(ctx context.Context, arg UpdateUserNameParams) (MUser, error)
	UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (MUser, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateUser

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

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id uuid.UUID) error

func (*Queries) FindUser

func (q *Queries) FindUser(ctx context.Context, id uuid.UUID) (MUser, error)

func (*Queries) FindUserForLogin

func (q *Queries) FindUserForLogin(ctx context.Context, loginID string) (MUser, error)

func (*Queries) GetUsers

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

func (*Queries) GetUsersFromName

func (q *Queries) GetUsersFromName(ctx context.Context, dollar_1 pgtype.Text) ([]MUser, error)

func (*Queries) UpdateUserLoggedAt

func (q *Queries) UpdateUserLoggedAt(ctx context.Context, id uuid.UUID) (MUser, error)

func (*Queries) UpdateUserName

func (q *Queries) UpdateUserName(ctx context.Context, arg UpdateUserNameParams) (MUser, error)

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (MUser, error)

func (*Queries) WithTx

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

type TChat

type TChat struct {
	ID        uuid.UUID   `json:"id"`
	Content   string      `json:"content"`
	ChannelID uuid.UUID   `json:"channel_id"`
	UserID    pgtype.UUID `json:"user_id"`
	PostedAt  time.Time   `json:"posted_at"`
}

type TGroupInvite

type TGroupInvite struct {
	UserID     uuid.UUID          `json:"user_id"`
	GroupID    uuid.UUID          `json:"group_id"`
	IsValid    bool               `json:"is_valid"`
	InvitedBy  pgtype.UUID        `json:"invited_by"`
	CanceledBy pgtype.UUID        `json:"canceled_by"`
	InvitedAt  time.Time          `json:"invited_at"`
	CanceledAt pgtype.Timestamptz `json:"canceled_at"`
}

type TGroupStoragePermission

type TGroupStoragePermission struct {
	StorageID     uuid.UUID   `json:"storage_id"`
	GroupID       uuid.UUID   `json:"group_id"`
	AttachedBy    pgtype.UUID `json:"attached_by"`
	LastChangedBy pgtype.UUID `json:"last_changed_by"`
	AttachedAt    time.Time   `json:"attached_at"`
	LastChangedAt time.Time   `json:"last_changed_at"`
}

type TUserChannel

type TUserChannel struct {
	UserID         uuid.UUID          `json:"user_id"`
	ChannelID      uuid.UUID          `json:"channel_id"`
	ConnectedAt    time.Time          `json:"connected_at"`
	DisconnectedAt pgtype.Timestamptz `json:"disconnected_at"`
}

type TUserGroup

type TUserGroup struct {
	ID      int32     `json:"id"`
	UserID  uuid.UUID `json:"user_id"`
	GroupID uuid.UUID `json:"group_id"`
	IsValid bool      `json:"is_valid"`
	AddedAt time.Time `json:"added_at"`
}

type TUserGroupPermission

type TUserGroupPermission struct {
	UserGroupID  int32       `json:"user_group_id"`
	PermissionID uuid.UUID   `json:"permission_id"`
	AttachedBy   pgtype.UUID `json:"attached_by"`
	AttachedAt   time.Time   `json:"attached_at"`
}

type TUserRole

type TUserRole struct {
	UserID     uuid.UUID   `json:"user_id"`
	RoleID     uuid.UUID   `json:"role_id"`
	AttachedBy pgtype.UUID `json:"attached_by"`
	FromSystem bool        `json:"from_system"`
	AttachedAt time.Time   `json:"attached_at"`
}

type UpdateUserNameParams

type UpdateUserNameParams struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	ID       uuid.UUID `json:"id"`
	Password string    `json:"password"`
}

Jump to

Keyboard shortcuts

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