Documentation
¶
Index ¶
- Constants
- func GetSyncID(ctx context.Context) string
- func SetSyncIDInContext(ctx context.Context, syncID string) context.Context
- type SessionStore
- type SessionStoreBag
- type SessionStoreBinder
- type SessionStoreConstructor
- type SessionStoreConstructorOption
- type SessionStoreKey
- type SessionStoreOption
- type SyncIDKey
- type UnbindSessionStore
Constants ¶
View Source
const MaxKeysPerRequest = 100
View Source
const MaxSessionStoreSizeLimit = 4132864
The default gRPC message size limit is 4MB (we subtract 60KB for general overhead, which is overkill). Unfortunately, this layer has to be aware of the size limit to avoid exceeding the size limit because the client does not know the size of the items it requests.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SessionStore ¶
type SessionStore interface {
Get(ctx context.Context, key string, opt ...SessionStoreOption) ([]byte, bool, error)
GetMany(ctx context.Context, keys []string, opt ...SessionStoreOption) (map[string][]byte, []string, error)
Set(ctx context.Context, key string, value []byte, opt ...SessionStoreOption) error
SetMany(ctx context.Context, values map[string][]byte, opt ...SessionStoreOption) error
Delete(ctx context.Context, key string, opt ...SessionStoreOption) error
Clear(ctx context.Context, opt ...SessionStoreOption) error
GetAll(ctx context.Context, pageToken string, opt ...SessionStoreOption) (map[string][]byte, string, error)
}
type SessionStoreBag ¶
type SessionStoreBinder ¶ added in v0.41.0
type SessionStoreBinder interface {
BindSessionStore(ctx context.Context, syncID string, store SessionStore) (UnbindSessionStore, error)
}
SessionStoreBinder routes session requests that carry syncID to store until the returned UnbindSessionStore runs.
type SessionStoreConstructor ¶
type SessionStoreConstructor func(ctx context.Context, opt ...SessionStoreConstructorOption) (SessionStore, error)
type SessionStoreKey ¶
type SessionStoreKey struct{}
type SessionStoreOption ¶
type SessionStoreOption func(ctx context.Context, bag *SessionStoreBag) error
func WithPageToken ¶ added in v0.5.3
func WithPageToken(pageToken string) SessionStoreOption
func WithPrefix ¶ added in v0.5.0
func WithPrefix(prefix string) SessionStoreOption
func WithSyncID ¶
func WithSyncID(syncID string) SessionStoreOption
WithSyncID returns a SessionCacheOption that sets the sync ID for the operation.
type SyncIDKey ¶
type SyncIDKey struct{}
SyncIDKey is the context key for storing the current sync ID.
type UnbindSessionStore ¶ added in v0.41.0
UnbindSessionStore removes the binding, then waits until requests already using the store finish or ctx ends.
Click to show internal directories.
Click to hide internal directories.