Documentation
¶
Overview ¶
Package state defines the plugin-scoped state store facade (design §8, tasks 4.1, 6–6.1).
Index ¶
- Variables
- type DisabledStore
- func (DisabledStore) Delete(context.Context, Scope, string, string) error
- func (DisabledStore) Get(context.Context, Scope, string, string, any) (bool, error)
- func (DisabledStore) InspectTTL(context.Context, Scope, string, string) (time.Duration, bool, error)
- func (DisabledStore) Put(context.Context, Scope, string, string, any, time.Duration) error
- type Scope
- type Store
Constants ¶
This section is empty.
Variables ¶
var ErrMissingExecutionContext = errors.New("lipsdk/state: missing execution context for this scope")
ErrMissingExecutionContext means the context has no execution views attached (or required ids are empty) for request/session/principal scoped operations (tasks 6–6.1).
var ErrMissingPrincipal = errors.New("lipsdk/state: principal scope requires authenticated principal id")
ErrMissingPrincipal means principal-scoped operations were called without a non-empty principal id (tasks 6–6.1).
var ErrNotConfigured = errors.New("lipsdk/state: state store not configured")
ErrNotConfigured means no state service is bound for this execution snapshot (task 4.1).
Functions ¶
This section is empty.
Types ¶
type DisabledStore ¶
type DisabledStore struct{}
DisabledStore is a placeholder binding that rejects all mutating use until core wiring exists.
func (DisabledStore) InspectTTL ¶
type Store ¶
type Store interface {
Get(ctx context.Context, scope Scope, ns, key string, out any) (found bool, err error)
Put(ctx context.Context, scope Scope, ns, key string, value any, ttl time.Duration) error
Delete(ctx context.Context, scope Scope, ns, key string) error
InspectTTL(ctx context.Context, scope Scope, ns, key string) (ttl time.Duration, found bool, err error)
}
Store is the narrow plugin-facing state API (design §8).
func BindPlugin ¶
BindPlugin returns a Store that prefixes the namespace segment with pluginID so keys from different plugins cannot collide when they share logical namespace names (R6, tasks 6–6.1). pluginID must be non-empty after trimming; otherwise returns DisabledStore.