Versions in this module Expand all Collapse all v0 v0.0.7 Aug 3, 2026 v0.0.6 Aug 1, 2026 Changes in this version type UsersWriter + CopyUsersAsync func(ctx context.Context, arg []*CopyUsersT) *pgmesh.Future[int64] v0.0.5 Jul 31, 2026 Changes in this version + type Analyses interface + type AnalysesReader interface + GetAnalysis func(ctx context.Context, arg *GetAnalysisT, storeOptions ...QueryOption) (*Analysis, error) + GetTenantUserAnalysis func(ctx context.Context, arg *GetTenantUserAnalysisT, storeOptions ...QueryOption) (*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 CopyUsersT struct + ID int64 + Name string + type CreateUserParams struct + ID int64 + Name string + TenantID int64 + type CreateUserT struct + ID int64 + Name string + 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 GetAnalysisT struct + ID int64 + type GetTenantUserAnalysisParams struct + AnalysisID int64 + UserID int64 + type GetTenantUserAnalysisRow struct + AnalysisID int64 + UserID int64 + type GetTenantUserAnalysisT struct + AnalysisID int64 + UserID int64 + type GetUserParams struct + ID int64 + TenantID int64 + type GetUserT struct + ID int64 + type ListP2PMessageIDsByChatParams struct + CreatedSince pgtype.Timestamptz + LastID interface{} + Limit int32 + PeerID int64 + UserID int64 + type ListP2PMessageIDsByChatT struct + CreatedSince pgtype.Timestamptz + LastID interface{} + Limit int32 + PeerID int64 + type ListP2PMessagesByChatParams struct + CreatedSince pgtype.Timestamptz + LastID interface{} + Limit int32 + PeerID int64 + UserID int64 + type ListP2PMessagesByChatT struct + CreatedSince pgtype.Timestamptz + LastID interface{} + Limit int32 + PeerID int64 + type ListUsersByIDsT struct + ID 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 MessageKey struct + InGroup bool + ToUserOrGroupID int64 + UserID 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) + ListUsersByIDs func(ctx context.Context, ids []int64) ([]*User, 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) ListUsersByIDs(ctx context.Context, ids []int64) ([]*User, 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 *ListP2PMessageIDsByChatT, ...) ([]interface{}, error) + ListP2PMessagesByChat func(ctx context.Context, arg *ListP2PMessagesByChatT, storeOptions ...QueryOption) ([]*Message, error) + type QueryMessageWriter interface + type QueryOption func(*queryOptions) + func ReadFromPrimary() QueryOption + func WithTx(tx pgx.Tx) QueryOption + type ShardResolver interface + MessageKey func(key MessageKey) SK + TenantKey func(key TenantKey) 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 WithAnalysesFactory(createAnalyses func(Analyses) Analyses) StoreOption + func WithCopyUsersBatching(config pgmesh.CopyBatchConfig) StoreOption + func WithLogger(logger *slog.Logger) StoreOption + func WithMeterProvider(provider metric.MeterProvider) StoreOption + func WithQueryMessageFactory(createQueryMessage func(QueryMessage) QueryMessage) StoreOption + func WithTracerProvider(provider trace.TracerProvider) StoreOption + func WithUsersFactory(createUsers func(Users) Users) StoreOption + type TenantKey struct + TenantID int64 + 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 UpdateUserNameT struct + ID int64 + Name string + type User struct + ID int64 + Name string + TenantID int64 + type Users interface + type UsersReader interface + GetUser func(ctx context.Context, arg *GetUserT, storeOptions ...QueryOption) (*User, error) + ListAllUsers func(ctx context.Context, storeOptions ...QueryOption) ([]*User, error) + ListUsersByIDs func(ctx context.Context, arg []*ListUsersByIDsT, storeOptions ...QueryOption) ([]*User, error) + type UsersWriter interface + CopyUsers func(ctx context.Context, arg []*CopyUsersT, storeOptions ...QueryOption) (int64, error) + CreateUser func(ctx context.Context, arg *CreateUserT, storeOptions ...QueryOption) (*User, error) + DeleteAllUsers func(ctx context.Context, storeOptions ...QueryOption) error + DeleteAllUsersByName func(ctx context.Context, name string, storeOptions ...QueryOption) (int64, error) + EnqueueCopyUsers func(ctx context.Context, arg []*CopyUsersT) *pgmesh.Future[int64] + FlushCopyUsers func(ctx context.Context) error + UpdateUserName func(ctx context.Context, arg *UpdateUserNameT, storeOptions ...QueryOption) (*User, error)