merged from gramsrv upstream
This commit is contained in:
parent
79c64ee916
commit
21a0856587
651 changed files with 54774 additions and 4590 deletions
28
internal/store/active_channel_ids_cache.go
Normal file
28
internal/store/active_channel_ids_cache.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package store
|
||||
|
||||
import "context"
|
||||
|
||||
// ActiveChannelIDsPageKey identifies one immutable page of the durable
|
||||
// owner-scoped active membership read model. Generation is the exact
|
||||
// channel_active_memberships hash, or the documented missing-generation
|
||||
// sentinel used before an owner has any membership row.
|
||||
type ActiveChannelIDsPageKey struct {
|
||||
UserID int64
|
||||
Generation int64
|
||||
AfterChannelID int64
|
||||
Limit int
|
||||
}
|
||||
|
||||
// ActiveChannelIDsPageCache is a rebuildable shared L2. Redis errors are
|
||||
// returned so callers cannot silently turn an outage into a PostgreSQL
|
||||
// stampede.
|
||||
type ActiveChannelIDsPageCache interface {
|
||||
GetActiveChannelIDsPage(context.Context, ActiveChannelIDsPageKey) ([]int64, bool, error)
|
||||
PutActiveChannelIDsPage(context.Context, ActiveChannelIDsPageKey, []int64) error
|
||||
}
|
||||
|
||||
// ActiveChannelIDsPageLoader is the bounded authoritative cold source used
|
||||
// only after a shared-cache miss.
|
||||
type ActiveChannelIDsPageLoader interface {
|
||||
ListActiveChannelIDsForUser(context.Context, int64, int64, int) ([]int64, error)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue