Documentation
¶
Overview ¶
Package session provides a transient, in-memory store for coordination facts during OODA loop execution. Facts in this store are isolated by SessionID and are NOT persisted to MEB (BadgerDB).
Index ¶
- type SessionFact
- type SessionStore
- func (s *SessionStore) CleanupExpired() int
- func (s *SessionStore) ClearSession(ctx context.Context, sessionID string) error
- func (s *SessionStore) Count(ctx context.Context) int
- func (s *SessionStore) Delete(ctx context.Context, sessionID, key string) error
- func (s *SessionStore) Get(ctx context.Context, sessionID, key string) (*SessionFact, error)
- func (s *SessionStore) GetAll(ctx context.Context, sessionID string) ([]*SessionFact, error)
- func (s *SessionStore) ListSessions(ctx context.Context) ([]string, error)
- func (s *SessionStore) Put(ctx context.Context, sessionID, key string, fact *SessionFact) error
- func (s *SessionStore) SetTTL(ttl time.Duration)
- func (s *SessionStore) ToAtoms(ctx context.Context, sessionID string) ([]core.Atom, error)
- func (s *SessionStore) ToQuads(ctx context.Context, sessionID string) ([]core.Quad, error)
- type TransientFactsStore
- func (t *TransientFactsStore) ClearSession(ctx context.Context, sessionID string) error
- func (t *TransientFactsStore) Delete(ctx context.Context, sessionID, key string) error
- func (t *TransientFactsStore) Get(ctx context.Context, sessionID, key string) (*ports.TransientFact, error)
- func (t *TransientFactsStore) GetAll(ctx context.Context, sessionID string) ([]*ports.TransientFact, error)
- func (t *TransientFactsStore) Put(ctx context.Context, sessionID, key string, fact *ports.TransientFact) error
- func (t *TransientFactsStore) ToAtoms(ctx context.Context, sessionID string) ([]core.Atom, error)
- func (t *TransientFactsStore) ToQuads(ctx context.Context, sessionID string) ([]core.Quad, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionFact ¶
type SessionFact struct {
Subject string
Predicate string
Object string
Graph string
CreatedAt time.Time
TTL time.Duration
}
func NewSessionFact ¶
func NewSessionFact(subject, predicate, object, graph string, ttl time.Duration) *SessionFact
func (*SessionFact) IsExpired ¶
func (f *SessionFact) IsExpired() bool
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
func NewSessionStore ¶
func NewSessionStore() *SessionStore
func (*SessionStore) CleanupExpired ¶
func (s *SessionStore) CleanupExpired() int
func (*SessionStore) ClearSession ¶
func (s *SessionStore) ClearSession(ctx context.Context, sessionID string) error
func (*SessionStore) Delete ¶
func (s *SessionStore) Delete(ctx context.Context, sessionID, key string) error
func (*SessionStore) Get ¶
func (s *SessionStore) Get(ctx context.Context, sessionID, key string) (*SessionFact, error)
func (*SessionStore) GetAll ¶
func (s *SessionStore) GetAll(ctx context.Context, sessionID string) ([]*SessionFact, error)
func (*SessionStore) ListSessions ¶
func (s *SessionStore) ListSessions(ctx context.Context) ([]string, error)
func (*SessionStore) Put ¶
func (s *SessionStore) Put(ctx context.Context, sessionID, key string, fact *SessionFact) error
func (*SessionStore) SetTTL ¶
func (s *SessionStore) SetTTL(ttl time.Duration)
type TransientFactsStore ¶
type TransientFactsStore struct {
// contains filtered or unexported fields
}
func NewTransientFactsStore ¶
func NewTransientFactsStore() *TransientFactsStore
func (*TransientFactsStore) ClearSession ¶
func (t *TransientFactsStore) ClearSession(ctx context.Context, sessionID string) error
func (*TransientFactsStore) Delete ¶
func (t *TransientFactsStore) Delete(ctx context.Context, sessionID, key string) error
func (*TransientFactsStore) Get ¶
func (t *TransientFactsStore) Get(ctx context.Context, sessionID, key string) (*ports.TransientFact, error)
func (*TransientFactsStore) GetAll ¶
func (t *TransientFactsStore) GetAll(ctx context.Context, sessionID string) ([]*ports.TransientFact, error)
func (*TransientFactsStore) Put ¶
func (t *TransientFactsStore) Put(ctx context.Context, sessionID, key string, fact *ports.TransientFact) error
Click to show internal directories.
Click to hide internal directories.