Versions in this module Expand all Collapse all v0 v0.0.3 Jul 28, 2026 Changes in this version + type Analyses interface + type AnalysesReader interface + GetAnalysis func(ctx context.Context, arg *GetAnalysisParams, storeOptions ...QueryOption) (*Analysis, error) + GetTenantUserAnalysis func(ctx context.Context, arg *GetTenantUserAnalysisShardParams, ...) (*GetTenantUserAnalysisRow, error) + type AnalysesWriter interface + type Analysis struct + ActiveWindow pgtype.Range[pgtype.Timestamptz] + Description *string + ID int64 + Source netip.Addr + State NullAnalysisState + TenantID int64 + type AnalysisState string + const AnalysisStateComplete + const AnalysisStatePending + func (e *AnalysisState) Scan(src interface{}) error + type CopyUsersParams struct + ID int64 + Name string + TenantID int64 + type CreateUserParams struct + ID int64 + Name string + TenantID int64 + type DBTX interface + CopyFrom func(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error) + Exec func(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query func(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow func(context.Context, string, ...interface{}) pgx.Row + type GetAnalysisParams struct + ID int64 + TenantID int64 + type GetTenantUserAnalysisParams struct + AnalysisID int64 + UserID int64 + type GetTenantUserAnalysisRow struct + AnalysisID int64 + UserID int64 + type GetTenantUserAnalysisShardParams struct + AnalysisID int64 + TenantID int64 + UserID int64 + type GetUserParams struct + ID int64 + TenantID int64 + type ListP2PMessageIDsByChatParams struct + CreatedSince pgtype.Timestamptz + LastID interface{} + Limit int32 + PeerID int64 + UserID int64 + type ListP2PMessageIDsByChatShardParams struct + CreatedSince pgtype.Timestamptz + InGroup bool + LastID interface{} + Limit int32 + PeerID int64 + ToUserOrGroupID int64 + UserID int64 + type ListP2PMessagesByChatParams struct + CreatedSince pgtype.Timestamptz + LastID interface{} + Limit int32 + PeerID int64 + UserID int64 + type ListP2PMessagesByChatShardParams struct + CreatedSince pgtype.Timestamptz + InGroup bool + LastID interface{} + Limit int32 + PeerID int64 + ToUserOrGroupID int64 + UserID int64 + type Message struct + CreatedAt pgtype.Timestamptz + DeletedAt pgtype.Timestamptz + ID interface{} + InGroup bool + ToUserOrGroupID int64 + UserID int64 + type MessageInbox struct + ID int64 + ToUserOrGroupID *int64 + type NullAnalysisState struct + AnalysisState AnalysisState + Valid bool + func (ns *NullAnalysisState) Scan(value interface{}) error + func (ns NullAnalysisState) Value() (driver.Value, error) + type Querier interface + CopyUsers func(ctx context.Context, arg []*CopyUsersParams) (int64, error) + CreateUser func(ctx context.Context, arg *CreateUserParams) (*User, error) + DeleteAllUsers func(ctx context.Context) error + DeleteAllUsersByName func(ctx context.Context, name string) (int64, error) + GetAnalysis func(ctx context.Context, arg *GetAnalysisParams) (*Analysis, error) + GetTenantUserAnalysis func(ctx context.Context, arg *GetTenantUserAnalysisParams) (*GetTenantUserAnalysisRow, error) + GetUser func(ctx context.Context, arg *GetUserParams) (*User, error) + ListAllUsers func(ctx context.Context) ([]*User, error) + ListP2PMessageIDsByChat func(ctx context.Context, arg *ListP2PMessageIDsByChatParams) ([]interface{}, error) + ListP2PMessagesByChat func(ctx context.Context, arg *ListP2PMessagesByChatParams) ([]*Message, error) + UpdateUserName func(ctx context.Context, arg *UpdateUserNameParams) (*User, error) + type Queries struct + func New(db DBTX) *Queries + func (q *Queries) CopyUsers(ctx context.Context, arg []*CopyUsersParams) (int64, error) + func (q *Queries) CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error) + func (q *Queries) DeleteAllUsers(ctx context.Context) error + func (q *Queries) DeleteAllUsersByName(ctx context.Context, name string) (int64, error) + func (q *Queries) GetAnalysis(ctx context.Context, arg *GetAnalysisParams) (*Analysis, error) + func (q *Queries) GetTenantUserAnalysis(ctx context.Context, arg *GetTenantUserAnalysisParams) (*GetTenantUserAnalysisRow, error) + func (q *Queries) GetUser(ctx context.Context, arg *GetUserParams) (*User, error) + func (q *Queries) ListAllUsers(ctx context.Context) ([]*User, error) + func (q *Queries) ListP2PMessageIDsByChat(ctx context.Context, arg *ListP2PMessageIDsByChatParams) ([]interface{}, error) + func (q *Queries) ListP2PMessagesByChat(ctx context.Context, arg *ListP2PMessagesByChatParams) ([]*Message, error) + func (q *Queries) UpdateUserName(ctx context.Context, arg *UpdateUserNameParams) (*User, error) + func (q *Queries) WithTx(tx pgx.Tx) *Queries + type QueryMessage interface + type QueryMessageReader interface + ListP2PMessageIDsByChat func(ctx context.Context, arg *ListP2PMessageIDsByChatShardParams, ...) ([]interface{}, error) + ListP2PMessagesByChat func(ctx context.Context, arg *ListP2PMessagesByChatShardParams, ...) ([]*Message, error) + type QueryMessageWriter interface + type QueryOption func(*queryOptions) + func ReadFromPrimary() QueryOption + func WithTx(tx pgx.Tx) QueryOption + type ShardResolver interface + Messagekey func(userID int64, toUserOrGroupID int64, inGroup bool) SK + Tenant func(tenantID int64) SK + type ShardedOption func(*shardedOptions) + func WithReplicaSet(name string, primary DBTX, replicas ...DBTX) ShardedOption + func WithVShardMapping(mainReplicaSet string, vshards []uint64, mirrorReplicaSets ...string) ShardedOption + type SingletonOption func(*singletonConfig) + func WithDatabaseName(name string) SingletonOption + func WithReadReplicas(databases ...DBTX) SingletonOption + func WithWriteMirrors(databases ...DBTX) SingletonOption + type Store interface + Analyses func() Analyses + QueryMessage func() QueryMessage + Users func() Users + func NewStore(ctx context.Context, topology Topology, options ...StoreOption) (Store, error) + type StoreOption func(*storeOptions) + func WithLogger(logger *slog.Logger) StoreOption + func WithMeterProvider(provider metric.MeterProvider) StoreOption + func WithTracerProvider(provider trace.TracerProvider) StoreOption + type Topology interface + func Sharded[SK any](numVShards uint64, shardHasher pgmesh.ShardHasher[SK], ...) Topology + func Singleton(primary DBTX, options ...SingletonOption) Topology + type UpdateUserNameParams struct + ID int64 + Name string + TenantID int64 + type User struct + ID int64 + Name string + TenantID int64 + type Users interface + type UsersReader interface + GetUser func(ctx context.Context, arg *GetUserParams, storeOptions ...QueryOption) (*User, error) + ListAllUsers func(ctx context.Context, storeOptions ...QueryOption) ([]*User, error) + type UsersWriter interface + CopyUsers func(ctx context.Context, arg []*CopyUsersParams, storeOptions ...QueryOption) (int64, error) + CreateUser func(ctx context.Context, arg *CreateUserParams, storeOptions ...QueryOption) (*User, error) + DeleteAllUsers func(ctx context.Context, storeOptions ...QueryOption) error + DeleteAllUsersByName func(ctx context.Context, name string, storeOptions ...QueryOption) (int64, error) + UpdateUserName func(ctx context.Context, arg *UpdateUserNameParams, storeOptions ...QueryOption) (*User, error)