queries

package
v0.0.0-...-d958ee8 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	ChatID                      int64
	EncryptedPrivateIdentityKey []byte
	EncryptedTitle              []byte
	EncryptedDescription        []byte
}

type CreateChatParams

type CreateChatParams struct {
	EncryptedPrivateIdentityKey []byte
	EncryptedTitle              []byte
	EncryptedDescription        []byte
}

type CreateMessageParams

type CreateMessageParams struct {
	ChatID                     int64
	SequenceNumber             int64
	EncryptedPublicIdentityKey []byte
	EncryptedContent           []byte
	EncryptedCreatedAt         []byte
}

type CreateParticipantParams

type CreateParticipantParams struct {
	ChatID                     int64
	SequenceNumber             int64
	EncryptedPublicIdentityKey []byte
	EncryptedName              []byte
	EncryptedEcdhPublicKey     []byte
	EncryptedMyEcdhPrivateKey  []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 GetChatsRow

type GetChatsRow struct {
	ChatID               int64
	EncryptedTitle       []byte
	EncryptedDescription []byte
}

type Message

type Message struct {
	ChatID                     int64
	SequenceNumber             int64
	EncryptedPublicIdentityKey []byte
	EncryptedContent           []byte
	EncryptedCreatedAt         []byte
}

type Participant

type Participant struct {
	ChatID                     int64
	SequenceNumber             int64
	EncryptedPublicIdentityKey []byte
	EncryptedName              []byte
	EncryptedEcdhPublicKey     []byte
	EncryptedMyEcdhPrivateKey  []byte
}

type Password

type Password struct {
	ID   int64
	Salt []byte
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateChat

func (q *Queries) CreateChat(ctx context.Context, arg CreateChatParams) (int64, error)

func (*Queries) CreateMessage

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

func (*Queries) CreateParticipant

func (q *Queries) CreateParticipant(ctx context.Context, arg CreateParticipantParams) error

func (*Queries) CreatePassword

func (q *Queries) CreatePassword(ctx context.Context, salt []byte) error

func (*Queries) GetChat

func (q *Queries) GetChat(ctx context.Context, chatID int64) (Chat, error)

func (*Queries) GetChats

func (q *Queries) GetChats(ctx context.Context) ([]GetChatsRow, error)

func (*Queries) GetMessages

func (q *Queries) GetMessages(ctx context.Context, chatID int64) ([]Message, error)

func (*Queries) GetNextSequenceNumber

func (q *Queries) GetNextSequenceNumber(ctx context.Context, chatID int64) (int64, error)

func (*Queries) GetParticipants

func (q *Queries) GetParticipants(ctx context.Context, chatID int64) ([]Participant, error)

func (*Queries) GetPassword

func (q *Queries) GetPassword(ctx context.Context) ([]byte, error)

func (*Queries) UpdateChat

func (q *Queries) UpdateChat(ctx context.Context, arg UpdateChatParams) error

func (*Queries) UpdateParticipant

func (q *Queries) UpdateParticipant(ctx context.Context, arg UpdateParticipantParams) error

func (*Queries) WithTx

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

type UpdateChatParams

type UpdateChatParams struct {
	EncryptedTitle       []byte
	EncryptedDescription []byte
	ChatID               int64
}

type UpdateParticipantParams

type UpdateParticipantParams struct {
	EncryptedName             []byte
	EncryptedEcdhPublicKey    []byte
	EncryptedMyEcdhPrivateKey []byte
	ChatID                    int64
	SequenceNumber            int64
}

Jump to

Keyboard shortcuts

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