internal

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 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 Analysis

type Analysis struct {
	ID           int64
	TenantID     int64
	Description  *string
	State        NullAnalysisState
	Source       netip.Addr
	ActiveWindow pgtype.Range[pgtype.Timestamptz]
}

type AnalysisState

type AnalysisState string
const (
	AnalysisStatePending  AnalysisState = "pending"
	AnalysisStateComplete AnalysisState = "complete"
)

func (*AnalysisState) Scan

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

type CopyUsersParams

type CopyUsersParams struct {
	ID       int64
	TenantID int64
	Name     string
}

type CreateUserParams

type CreateUserParams struct {
	ID       int64
	TenantID int64
	Name     string
}

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
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type GetAnalysisParams

type GetAnalysisParams struct {
	TenantID int64
	ID       int64
}

type GetTenantUserAnalysisParams

type GetTenantUserAnalysisParams struct {
	UserID     int64
	AnalysisID int64
}

type GetTenantUserAnalysisRow

type GetTenantUserAnalysisRow struct {
	UserID     int64
	AnalysisID int64
}

type GetUserParams

type GetUserParams struct {
	TenantID int64
	ID       int64
}

type ListP2PMessageIDsByChatParams

type ListP2PMessageIDsByChatParams struct {
	Limit        int32
	UserID       int64
	PeerID       int64
	CreatedSince pgtype.Timestamptz
	LastID       interface{}
}

type ListP2PMessagesByChatParams

type ListP2PMessagesByChatParams struct {
	Limit        int32
	UserID       int64
	PeerID       int64
	CreatedSince pgtype.Timestamptz
	LastID       interface{}
}

type Message

type Message struct {
	ID              interface{}
	UserID          int64
	ToUserOrGroupID int64
	InGroup         bool
	CreatedAt       pgtype.Timestamptz
	DeletedAt       pgtype.Timestamptz
}

type MessageInbox

type MessageInbox struct {
	ID              int64
	ToUserOrGroupID *int64
}

type NullAnalysisState

type NullAnalysisState struct {
	AnalysisState AnalysisState
	Valid         bool // Valid is true if AnalysisState is not NULL
}

func (*NullAnalysisState) Scan

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

Scan implements the Scanner interface.

func (NullAnalysisState) Value

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

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	// kind: write
	// shard: tenantKey(tenant_id)
	// store: Users
	CopyUsers(ctx context.Context, arg []*CopyUsersParams) (int64, error)
	// kind: write
	// shard: tenantKey(tenant_id)
	// store: Users
	CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error)
	// kind: write
	// shard: all()
	// store: Users
	DeleteAllUsers(ctx context.Context) error
	// kind: write
	// shard: all()
	// store: Users
	DeleteAllUsersByName(ctx context.Context, name string) (int64, error)
	// kind: read
	// shard: tenantKey(tenant_id)
	// store: Analyses
	GetAnalysis(ctx context.Context, arg *GetAnalysisParams) (*Analysis, error)
	// kind: read
	// shard: tenantKey(tenant_id)
	// store: Analyses
	GetTenantUserAnalysis(ctx context.Context, arg *GetTenantUserAnalysisParams) (*GetTenantUserAnalysisRow, error)
	// kind: read
	// shard: tenantKey(tenant_id)
	// store: Users
	GetUser(ctx context.Context, arg *GetUserParams) (*User, error)
	// kind: read
	// shard: all()
	// store: Users
	ListAllUsers(ctx context.Context) ([]*User, error)
	// kind: read
	// shard: messageKey(user_id, to_user_or_group_id, in_group)
	// store: QueryMessage
	ListP2PMessageIDsByChat(ctx context.Context, arg *ListP2PMessageIDsByChatParams) ([]interface{}, error)
	// kind: read
	// shard: messageKey(user_id, to_user_or_group_id, in_group)
	// store: QueryMessage
	ListP2PMessagesByChat(ctx context.Context, arg *ListP2PMessagesByChatParams) ([]*Message, error)
	// kind: read
	// shard: tenantKey(tenant_id)
	// store: Users
	ListUsersByIDs(ctx context.Context, ids []int64) ([]*User, error)
	// kind: write
	// shard: tenantKey(tenant_id)
	// store: Users
	UpdateUserName(ctx context.Context, arg *UpdateUserNameParams) (*User, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CopyUsers

func (q *Queries) CopyUsers(ctx context.Context, arg []*CopyUsersParams) (int64, error)

kind: write shard: tenantKey(tenant_id) store: Users

func (*Queries) CreateUser

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

kind: write shard: tenantKey(tenant_id) store: Users

func (*Queries) DeleteAllUsers

func (q *Queries) DeleteAllUsers(ctx context.Context) error

kind: write shard: all() store: Users

func (*Queries) DeleteAllUsersByName

func (q *Queries) DeleteAllUsersByName(ctx context.Context, name string) (int64, error)

kind: write shard: all() store: Users

func (*Queries) GetAnalysis

func (q *Queries) GetAnalysis(ctx context.Context, arg *GetAnalysisParams) (*Analysis, error)

kind: read shard: tenantKey(tenant_id) store: Analyses

func (*Queries) GetTenantUserAnalysis

func (q *Queries) GetTenantUserAnalysis(ctx context.Context, arg *GetTenantUserAnalysisParams) (*GetTenantUserAnalysisRow, error)

kind: read shard: tenantKey(tenant_id) store: Analyses

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, arg *GetUserParams) (*User, error)

kind: read shard: tenantKey(tenant_id) store: Users

func (*Queries) ListAllUsers

func (q *Queries) ListAllUsers(ctx context.Context) ([]*User, error)

kind: read shard: all() store: Users

func (*Queries) ListP2PMessageIDsByChat

func (q *Queries) ListP2PMessageIDsByChat(ctx context.Context, arg *ListP2PMessageIDsByChatParams) ([]interface{}, error)

kind: read shard: messageKey(user_id, to_user_or_group_id, in_group) store: QueryMessage

func (*Queries) ListP2PMessagesByChat

func (q *Queries) ListP2PMessagesByChat(ctx context.Context, arg *ListP2PMessagesByChatParams) ([]*Message, error)

kind: read shard: messageKey(user_id, to_user_or_group_id, in_group) store: QueryMessage

func (*Queries) ListUsersByIDs

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

kind: read shard: tenantKey(tenant_id) store: Users

func (*Queries) UpdateUserName

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

kind: write shard: tenantKey(tenant_id) store: Users

func (*Queries) WithTx

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

type UpdateUserNameParams

type UpdateUserNameParams struct {
	TenantID int64
	ID       int64
	Name     string
}

type User

type User struct {
	ID       int64
	TenantID int64
	Name     string
}

Jump to

Keyboard shortcuts

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