Documentation
¶
Index ¶
- func ApplyAll(cfg *config.Config, cmd *cli.Command)
- func Names() []string
- func PluginFlags(cfg *config.Config) []cli.Flag
- func Register(p Plugin)
- func WithEntriesCacheContext(ctx context.Context, c MemoryEntriesCache) context.Context
- type CachedMemoryEntries
- type Loader
- type MemoryEntriesCache
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginFlags ¶
PluginFlags returns CLI flags contributed by all registered cache plugins.
func WithEntriesCacheContext ¶
func WithEntriesCacheContext(ctx context.Context, c MemoryEntriesCache) context.Context
WithEntriesCacheContext returns a new context carrying the given MemoryEntriesCache.
Types ¶
type CachedMemoryEntries ¶
CachedMemoryEntries holds cached context entries for a conversation/client pair.
type Loader ¶
type Loader func(ctx context.Context) (MemoryEntriesCache, error)
Loader creates a cache from config.
type MemoryEntriesCache ¶
type MemoryEntriesCache interface {
Available() bool
Get(ctx context.Context, conversationID uuid.UUID, clientID string) (*CachedMemoryEntries, error)
Set(ctx context.Context, conversationID uuid.UUID, clientID string, entries CachedMemoryEntries, ttl time.Duration) error
Remove(ctx context.Context, conversationID uuid.UUID, clientID string) error
}
MemoryEntriesCache caches context entries for sync operations.
func EntriesCacheFromContext ¶
func EntriesCacheFromContext(ctx context.Context) MemoryEntriesCache
EntriesCacheFromContext retrieves the MemoryEntriesCache from the context. Returns nil if none was set.
Click to show internal directories.
Click to hide internal directories.