internal/sessionstoreLegend: Type, Function, Method
Package: package sessionstore // import "github.com/smysnk/sikuligo/internal/sessionstore"
APISessionAPISessionStartInputClientSessionClientSessionStartInputInteractionInteractionInputMethodMetricsStoreStore.CloseStore.CountAPISessionsStore.CountClientSessionsStore.CountInteractionsStore.EndAPISessionStore.EndClientSessionStore.LatestAPISessionStore.ListClientSessionsByAPIStore.ListInteractionsByClientStore.ListRecentAPISessionsStore.MethodMetricsByAPISessionStore.RecordInteractionStore.StartAPISessionStore.StartClientSessionAPISessiontype APISession struct {APISessionStartInputtype APISessionStartInput struct {ClientSessiontype ClientSession struct {ClientSessionStartInputtype ClientSessionStartInput struct {Interactiontype Interaction struct {InteractionInputtype InteractionInput struct {MethodMetricstype MethodMetrics struct {Storetype Store struct {OpenSQLitefunc OpenSQLite(path string) (*Store, error)StoreStore.Closefunc (s *Store) Close() errorStore.CountAPISessionsfunc (s *Store) CountAPISessions(ctx context.Context) (int64, error)Store.CountClientSessionsfunc (s *Store) CountClientSessions(ctx context.Context) (int64, error)Store.CountInteractionsfunc (s *Store) CountInteractions(ctx context.Context) (int64, error)Store.EndAPISessionfunc (s *Store) EndAPISession(ctx context.Context, apiSessionID uint, endedAt time.Time) errorStore.EndClientSessionfunc (s *Store) EndClientSession(ctx context.Context, clientSessionID uint, endedAt time.Time) errorStore.LatestAPISessionfunc (s *Store) LatestAPISession(ctx context.Context) (APISession, bool, error)APISessionStore.ListClientSessionsByAPIfunc (s *Store) ListClientSessionsByAPI(ctx context.Context, apiSessionID uint) ([]ClientSession, error)ClientSessionStore.ListInteractionsByClientfunc (s *Store) ListInteractionsByClient(ctx context.Context, clientSessionID uint, limit int) ([]Interaction, error)InteractionStore.ListRecentAPISessionsfunc (s *Store) ListRecentAPISessions(ctx context.Context, limit int) ([]APISession, error)APISessionStore.MethodMetricsByAPISessionfunc (s *Store) MethodMetricsByAPISession(ctx context.Context, apiSessionID uint) ([]MethodMetrics, error)MethodMetricsStore.RecordInteractionfunc (s *Store) RecordInteraction(ctx context.Context, in InteractionInput) errorInteractionInputStore.StartAPISessionfunc (s *Store) StartAPISession(ctx context.Context, in APISessionStartInput) (APISession, error)APISession, APISessionStartInputStore.StartClientSessionfunc (s *Store) StartClientSession(ctx context.Context, in ClientSessionStartInput) (ClientSession, error)ClientSession, ClientSessionStartInputpackage sessionstore // import "github.com/smysnk/sikuligo/internal/sessionstore"
TYPES
type APISession struct {
ID uint `gorm:"primaryKey"`
SessionKey string
PID int
GRPCListenAddr string
AdminListenAddr string
StartedAt time.Time
EndedAt *time.Time
}
type APISessionStartInput struct {
PID int
GRPCListenAddr string
AdminListenAddr string
}
type ClientSession struct {
ID uint `gorm:"primaryKey"`
APISessionID uint
SessionKey string
ConnectionID string
RemoteAddr string
LocalAddr string
StartedAt time.Time
EndedAt *time.Time
LastSeenAt time.Time
}
type ClientSessionStartInput struct {
APISessionID uint
ConnectionID string
RemoteAddr string
LocalAddr string
}
type Interaction struct {
ID uint `gorm:"primaryKey"`
APISessionID uint
ClientSessionID uint
Method string
TraceID string
GRPCCode string
DurationMS int64
StartedAt time.Time
CompletedAt time.Time
}
type InteractionInput struct {
APISessionID uint
ClientSessionID uint
Method string
TraceID string
GRPCCode string
DurationMS int64
StartedAt time.Time
CompletedAt time.Time
}
type MethodMetrics struct {
Method string
Requests uint64
Errors uint64
AuthFailures uint64
AvgDuration float64
MaxDuration int64
LastCode string
LastTraceID string
LastSeen time.Time
}
type Store struct {
// Has unexported fields.
}
func OpenSQLite(path string) (*Store, error)
func (s *Store) Close() error
func (s *Store) CountAPISessions(ctx context.Context) (int64, error)
func (s *Store) CountClientSessions(ctx context.Context) (int64, error)
func (s *Store) CountInteractions(ctx context.Context) (int64, error)
func (s *Store) EndAPISession(ctx context.Context, apiSessionID uint, endedAt time.Time) error
func (s *Store) EndClientSession(ctx context.Context, clientSessionID uint, endedAt time.Time) error
func (s *Store) LatestAPISession(ctx context.Context) (APISession, bool, error)
func (s *Store) ListClientSessionsByAPI(ctx context.Context, apiSessionID uint) ([]ClientSession, error)
func (s *Store) ListInteractionsByClient(ctx context.Context, clientSessionID uint, limit int) ([]Interaction, error)
func (s *Store) ListRecentAPISessions(ctx context.Context, limit int) ([]APISession, error)
func (s *Store) MethodMetricsByAPISession(ctx context.Context, apiSessionID uint) ([]MethodMetrics, error)
func (s *Store) RecordInteraction(ctx context.Context, in InteractionInput) error
func (s *Store) StartAPISession(ctx context.Context, in APISessionStartInput) (APISession, error)
func (s *Store) StartClientSession(ctx context.Context, in ClientSessionStartInput) (ClientSession, error)