queries

package
v0.0.0-...-9dd808c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressLog

type AddressLog struct {
	Address               string
	InboxID               []byte
	AssociationSequenceID sql.NullInt64
	RevocationSequenceID  sql.NullInt64
}

type CreateOrUpdateInstallationParams

type CreateOrUpdateInstallationParams struct {
	ID         []byte
	CreatedAt  int64
	UpdatedAt  int64
	KeyPackage []byte
}

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 FetchKeyPackagesRow

type FetchKeyPackagesRow struct {
	ID         []byte
	KeyPackage []byte
}

type GetAddressLogsRow

type GetAddressLogsRow struct {
	Address               string
	InboxID               string
	AssociationSequenceID sql.NullInt64
}

type GetAllInboxLogsRow

type GetAllInboxLogsRow struct {
	SequenceID          int64
	InboxID             string
	IdentityUpdateProto []byte
}

type GetInboxLogFilteredRow

type GetInboxLogFilteredRow struct {
	SequenceID          int64
	InboxID             string
	IdentityUpdateProto []byte
	ServerTimestampNs   int64
}

type GroupMessage

type GroupMessage struct {
	ID              int64
	CreatedAt       time.Time
	GroupID         []byte
	Data            []byte
	GroupIDDataHash []byte
}

type InboxLog

type InboxLog struct {
	SequenceID          int64
	InboxID             []byte
	ServerTimestampNs   int64
	IdentityUpdateProto []byte
}

type InboxLogFilter

type InboxLogFilter struct {
	InboxId    string `json:"inbox_id"`
	SequenceId int64  `json:"sequence_id"`
}

type InboxLogFilterList

type InboxLogFilterList []InboxLogFilter

func (*InboxLogFilterList) ToSql

func (f *InboxLogFilterList) ToSql() (json.RawMessage, error)

type InsertAddressLogParams

type InsertAddressLogParams struct {
	Address               string
	InboxID               string
	AssociationSequenceID sql.NullInt64
	RevocationSequenceID  sql.NullInt64
}

type InsertGroupMessageParams

type InsertGroupMessageParams struct {
	GroupID         []byte
	Data            []byte
	GroupIDDataHash []byte
}

type InsertInboxLogParams

type InsertInboxLogParams struct {
	InboxID             string
	ServerTimestampNs   int64
	IdentityUpdateProto []byte
}

type InsertWelcomeMessageParams

type InsertWelcomeMessageParams struct {
	InstallationKey         []byte
	Data                    []byte
	InstallationKeyDataHash []byte
	HpkePublicKey           []byte
}

type Installation

type Installation struct {
	ID         []byte
	CreatedAt  int64
	UpdatedAt  int64
	KeyPackage []byte
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateOrUpdateInstallation

func (q *Queries) CreateOrUpdateInstallation(ctx context.Context, arg CreateOrUpdateInstallationParams) error

func (*Queries) FetchKeyPackages

func (q *Queries) FetchKeyPackages(ctx context.Context, installationIds [][]byte) ([]FetchKeyPackagesRow, error)

func (*Queries) GetAddressLogs

func (q *Queries) GetAddressLogs(ctx context.Context, addresses []string) ([]GetAddressLogsRow, error)

func (*Queries) GetAllGroupMessages

func (q *Queries) GetAllGroupMessages(ctx context.Context) ([]GroupMessage, error)

func (*Queries) GetAllInboxLogs

func (q *Queries) GetAllInboxLogs(ctx context.Context, inboxID string) ([]GetAllInboxLogsRow, error)

func (*Queries) GetAllWelcomeMessages

func (q *Queries) GetAllWelcomeMessages(ctx context.Context) ([]WelcomeMessage, error)

func (*Queries) GetInboxLogFiltered

func (q *Queries) GetInboxLogFiltered(ctx context.Context, filters json.RawMessage) ([]GetInboxLogFilteredRow, error)

func (*Queries) GetInstallation

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

func (*Queries) InsertAddressLog

func (q *Queries) InsertAddressLog(ctx context.Context, arg InsertAddressLogParams) (AddressLog, error)

func (*Queries) InsertGroupMessage

func (q *Queries) InsertGroupMessage(ctx context.Context, arg InsertGroupMessageParams) (GroupMessage, error)

func (*Queries) InsertInboxLog

func (q *Queries) InsertInboxLog(ctx context.Context, arg InsertInboxLogParams) (int64, error)

func (*Queries) InsertWelcomeMessage

func (q *Queries) InsertWelcomeMessage(ctx context.Context, arg InsertWelcomeMessageParams) (WelcomeMessage, error)

func (*Queries) LockInboxLog

func (q *Queries) LockInboxLog(ctx context.Context, inboxID string) error

func (*Queries) QueryGroupMessages

func (q *Queries) QueryGroupMessages(ctx context.Context, arg QueryGroupMessagesParams) ([]GroupMessage, error)

func (*Queries) QueryGroupMessagesWithCursorAsc

func (q *Queries) QueryGroupMessagesWithCursorAsc(ctx context.Context, arg QueryGroupMessagesWithCursorAscParams) ([]GroupMessage, error)

func (*Queries) QueryGroupMessagesWithCursorDesc

func (q *Queries) QueryGroupMessagesWithCursorDesc(ctx context.Context, arg QueryGroupMessagesWithCursorDescParams) ([]GroupMessage, error)

func (*Queries) QueryWelcomeMessages

func (q *Queries) QueryWelcomeMessages(ctx context.Context, arg QueryWelcomeMessagesParams) ([]WelcomeMessage, error)

func (*Queries) QueryWelcomeMessagesWithCursorAsc

func (q *Queries) QueryWelcomeMessagesWithCursorAsc(ctx context.Context, arg QueryWelcomeMessagesWithCursorAscParams) ([]WelcomeMessage, error)

func (*Queries) QueryWelcomeMessagesWithCursorDesc

func (q *Queries) QueryWelcomeMessagesWithCursorDesc(ctx context.Context, arg QueryWelcomeMessagesWithCursorDescParams) ([]WelcomeMessage, error)

func (*Queries) RevokeAddressFromLog

func (q *Queries) RevokeAddressFromLog(ctx context.Context, arg RevokeAddressFromLogParams) error

func (*Queries) WithTx

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

type QueryGroupMessagesParams

type QueryGroupMessagesParams struct {
	GroupID  []byte
	SortDesc bool
	Numrows  int32
}

type QueryGroupMessagesWithCursorAscParams

type QueryGroupMessagesWithCursorAscParams struct {
	GroupID []byte
	Cursor  int64
	Numrows int32
}

type QueryGroupMessagesWithCursorDescParams

type QueryGroupMessagesWithCursorDescParams struct {
	GroupID []byte
	Cursor  int64
	Numrows int32
}

type QueryWelcomeMessagesParams

type QueryWelcomeMessagesParams struct {
	InstallationKey []byte
	SortDesc        bool
	Numrows         int32
}

type QueryWelcomeMessagesWithCursorAscParams

type QueryWelcomeMessagesWithCursorAscParams struct {
	InstallationKey []byte
	Cursor          int64
	Numrows         int32
}

type QueryWelcomeMessagesWithCursorDescParams

type QueryWelcomeMessagesWithCursorDescParams struct {
	InstallationKey []byte
	Cursor          int64
	Numrows         int32
}

type RevokeAddressFromLogParams

type RevokeAddressFromLogParams struct {
	RevocationSequenceID sql.NullInt64
	Address              string
	InboxID              string
}

type WelcomeMessage

type WelcomeMessage struct {
	ID                      int64
	CreatedAt               time.Time
	InstallationKey         []byte
	Data                    []byte
	HpkePublicKey           []byte
	InstallationKeyDataHash []byte
}

Jump to

Keyboard shortcuts

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