database

package
v0.0.0-...-1329338 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMessageParams

type CreateMessageParams struct {
	FromPvtID  int32         `json:"from_pvt_id"`
	ToPvtID    int32         `json:"to_pvt_id"`
	MssgStatus MessageStatus `json:"mssg_status"`
	CreatedAt  time.Time     `json:"created_at"`
	UpdatedAt  time.Time     `json:"updated_at"`
}

type CreateMessageTextParams

type CreateMessageTextParams struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type CreateMessageTypeParams

type CreateMessageTypeParams struct {
	MssgID       int64       `json:"mssg_id"`
	MssgType     MessageType `json:"mssg_type"`
	AttachMssgID pgtype.Int8 `json:"attach_mssg_id"`
}

type CreateUserParams

type CreateUserParams struct {
	Username     string    `json:"username"`
	DisplayName  string    `json:"display_name"`
	Password     []byte    `json:"password"`
	PasswordSalt []byte    `json:"password_salt"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

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 GetMessageByIdPublicRow

type GetMessageByIdPublicRow struct {
	MssgID       int64         `json:"mssg_id"`
	FromUserID   pgtype.UUID   `json:"from_user_id"`
	ToUserID     pgtype.UUID   `json:"to_user_id"`
	MssgStatus   MessageStatus `json:"mssg_status"`
	CreatedAt    time.Time     `json:"created_at"`
	UpdatedAt    time.Time     `json:"updated_at"`
	MssgType     MessageType   `json:"mssg_type"`
	AttachMssgID pgtype.Int8   `json:"attach_mssg_id"`
	MssgBody     string        `json:"mssg_body"`
}

type GetMessageByIdRow

type GetMessageByIdRow struct {
	MssgID       int64         `json:"mssg_id"`
	FromPvtID    int32         `json:"from_pvt_id"`
	ToPvtID      int32         `json:"to_pvt_id"`
	MssgStatus   MessageStatus `json:"mssg_status"`
	CreatedAt    time.Time     `json:"created_at"`
	UpdatedAt    time.Time     `json:"updated_at"`
	MssgType     MessageType   `json:"mssg_type"`
	AttachMssgID pgtype.Int8   `json:"attach_mssg_id"`
	MssgBody     string        `json:"mssg_body"`
}

type GetUserByNameAndUuidParams

type GetUserByNameAndUuidParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	Username string      `json:"username"`
}

type MessageMetum

type MessageMetum struct {
	MssgID     int64         `json:"mssg_id"`
	FromPvtID  int32         `json:"from_pvt_id"`
	ToPvtID    int32         `json:"to_pvt_id"`
	MssgStatus MessageStatus `json:"mssg_status"`
	CreatedAt  time.Time     `json:"created_at"`
	UpdatedAt  time.Time     `json:"updated_at"`
}

type MessageStatus

type MessageStatus string
const (
	MessageStatusSent      MessageStatus = "sent"
	MessageStatusDelivered MessageStatus = "delivered"
	MessageStatusRead      MessageStatus = "read"
)

func (*MessageStatus) Scan

func (e *MessageStatus) Scan(src interface{}) error

type MessageText

type MessageText struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText0

type MessageText0 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText1

type MessageText1 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText2

type MessageText2 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText3

type MessageText3 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText4

type MessageText4 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText5

type MessageText5 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText6

type MessageText6 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText7

type MessageText7 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText8

type MessageText8 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageText9

type MessageText9 struct {
	MssgID   int64  `json:"mssg_id"`
	MssgBody string `json:"mssg_body"`
}

type MessageType

type MessageType string
const (
	MessageTypeNormal   MessageType = "normal"
	MessageTypeReply    MessageType = "reply"
	MessageTypeReaction MessageType = "reaction"
)

func (*MessageType) Scan

func (e *MessageType) Scan(src interface{}) error

type MessageTypeMetum

type MessageTypeMetum struct {
	MssgID       int64       `json:"mssg_id"`
	MssgType     MessageType `json:"mssg_type"`
	AttachMssgID pgtype.Int8 `json:"attach_mssg_id"`
}

type NullMessageStatus

type NullMessageStatus struct {
	MessageStatus MessageStatus `json:"message_status"`
	Valid         bool          `json:"valid"` // Valid is true if MessageStatus is not NULL
}

func (*NullMessageStatus) Scan

func (ns *NullMessageStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullMessageStatus) Value

func (ns NullMessageStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullMessageType

type NullMessageType struct {
	MessageType MessageType `json:"message_type"`
	Valid       bool        `json:"valid"` // Valid is true if MessageType is not NULL
}

func (*NullMessageType) Scan

func (ns *NullMessageType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullMessageType) Value

func (ns NullMessageType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateMessage

func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (MessageMetum, error)

func (*Queries) CreateMessageText

func (q *Queries) CreateMessageText(ctx context.Context, arg CreateMessageTextParams) (MessageText, error)

func (*Queries) CreateMessageType

func (q *Queries) CreateMessageType(ctx context.Context, arg CreateMessageTypeParams) (MessageTypeMetum, error)

func (*Queries) CreateUser

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

func (*Queries) DeleteUserDetails

func (q *Queries) DeleteUserDetails(ctx context.Context, pvtID int32) (User, error)

func (*Queries) GetMessageById

func (q *Queries) GetMessageById(ctx context.Context, mssgID int64) (GetMessageByIdRow, error)

func (*Queries) GetMessageByIdPublic

func (q *Queries) GetMessageByIdPublic(ctx context.Context, mssgID int64) (GetMessageByIdPublicRow, error)

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, pvtID int32) (User, error)

func (*Queries) GetUserByName

func (q *Queries) GetUserByName(ctx context.Context, username string) (User, error)

func (*Queries) GetUserByNameAndUuid

func (q *Queries) GetUserByNameAndUuid(ctx context.Context, arg GetUserByNameAndUuidParams) (User, error)

func (*Queries) GetUserByUuid

func (q *Queries) GetUserByUuid(ctx context.Context, userID pgtype.UUID) (User, error)

func (*Queries) UpdateLoggedInTime

func (q *Queries) UpdateLoggedInTime(ctx context.Context, arg UpdateLoggedInTimeParams) error

func (*Queries) UpdateUserDetails

func (q *Queries) UpdateUserDetails(ctx context.Context, arg UpdateUserDetailsParams) (User, error)

func (*Queries) WithTx

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

type UpdateLoggedInTimeParams

type UpdateLoggedInTimeParams struct {
	LastLoggedIn pgtype.Timestamp `json:"last_logged_in"`
	PvtID        int32            `json:"pvt_id"`
}

type UpdateUserDetailsParams

type UpdateUserDetailsParams struct {
	Username    string    `json:"username"`
	DisplayName string    `json:"display_name"`
	Password    []byte    `json:"password"`
	UpdatedAt   time.Time `json:"updated_at"`
	PvtID       int32     `json:"pvt_id"`
}

type User

type User struct {
	PvtID        int32            `json:"pvt_id"`
	UserID       pgtype.UUID      `json:"user_id"`
	Username     string           `json:"username"`
	DisplayName  string           `json:"display_name"`
	Password     []byte           `json:"password"`
	PasswordSalt []byte           `json:"password_salt"`
	CreatedAt    time.Time        `json:"created_at"`
	UpdatedAt    time.Time        `json:"updated_at"`
	LastLoggedIn pgtype.Timestamp `json:"last_logged_in"`
}

Jump to

Keyboard shortcuts

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