Documentation
¶
Index ¶
- type ConfigStore
- func (s *ConfigStore) AddDeploy(_ context.Context, deploy dataplane.DeployEvent) error
- func (s *ConfigStore) DeleteView(_ context.Context, id string) error
- func (s *ConfigStore) GetConfig(_ context.Context) (*config.Config, error)
- func (s *ConfigStore) ListDeploys(_ context.Context, filter dataplane.DeployFilter) ([]dataplane.DeployEvent, error)
- func (s *ConfigStore) ListServices(_ context.Context) ([]dataplane.ServiceEntry, error)
- func (s *ConfigStore) ListViews(_ context.Context) ([]dataplane.SavedView, error)
- func (s *ConfigStore) SaveView(_ context.Context, view dataplane.SavedView) error
- func (s *ConfigStore) SetConfig(_ context.Context, cfg *config.Config) error
- func (s *ConfigStore) UpsertService(_ context.Context, svc dataplane.ServiceEntry) error
- type MetricStore
- func (s *MetricStore) Percentiles(_ context.Context, service, action string, window time.Duration) (*dataplane.LatencyPercentiles, error)
- func (s *MetricStore) Record(_ context.Context, service, action string, latencyMs float64, statusCode int) error
- func (s *MetricStore) ServiceStats(_ context.Context, service string, window time.Duration) (*dataplane.ServiceMetrics, error)
- type PreferenceStore
- func (s *PreferenceStore) Delete(_ context.Context, namespace, key string) error
- func (s *PreferenceStore) Get(_ context.Context, namespace, key string) (json.RawMessage, error)
- func (s *PreferenceStore) ListByNamespace(_ context.Context, namespace string) (map[string]json.RawMessage, error)
- func (s *PreferenceStore) Set(_ context.Context, namespace, key string, value json.RawMessage) error
- type RequestStore
- type SLOStore
- func (s *SLOStore) History(_ context.Context, _ int) ([]dataplane.SLORuleChange, error)
- func (s *SLOStore) Rules(_ context.Context) ([]config.SLORule, error)
- func (s *SLOStore) SetRules(_ context.Context, rules []config.SLORule) error
- func (s *SLOStore) Status(_ context.Context) (*dataplane.SLOStatus, error)
- type TopologyStore
- func (s *TopologyStore) Downstream(_ context.Context, service string) ([]string, error)
- func (s *TopologyStore) GetTopology(_ context.Context) (*dataplane.TopologyGraph, error)
- func (s *TopologyStore) RecordEdge(_ context.Context, edge dataplane.ObservedEdge) error
- func (s *TopologyStore) Upstream(_ context.Context, service string) ([]string, error)
- type TraceStore
- func (s *TraceStore) Get(_ context.Context, traceID string) (*dataplane.TraceContext, error)
- func (s *TraceStore) Search(_ context.Context, filter dataplane.TraceFilter) ([]dataplane.TraceSummary, error)
- func (s *TraceStore) Timeline(_ context.Context, traceID string) ([]dataplane.TimelineSpan, error)
- func (s *TraceStore) WriteSpans(_ context.Context, spans []*dataplane.Span) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigStore ¶
type ConfigStore struct {
// contains filtered or unexported fields
}
ConfigStore satisfies the dataplane.ConfigStore interface using in-memory storage for config, deploys, saved views, and services.
func NewConfigStore ¶
func NewConfigStore(cfg *config.Config) *ConfigStore
NewConfigStore creates a ConfigStore with optional initial config.
func (*ConfigStore) AddDeploy ¶
func (s *ConfigStore) AddDeploy(_ context.Context, deploy dataplane.DeployEvent) error
AddDeploy appends a deploy event.
func (*ConfigStore) DeleteView ¶
func (s *ConfigStore) DeleteView(_ context.Context, id string) error
DeleteView removes the saved view with the given ID.
func (*ConfigStore) ListDeploys ¶
func (s *ConfigStore) ListDeploys(_ context.Context, filter dataplane.DeployFilter) ([]dataplane.DeployEvent, error)
ListDeploys returns deploy events matching the filter.
func (*ConfigStore) ListServices ¶
func (s *ConfigStore) ListServices(_ context.Context) ([]dataplane.ServiceEntry, error)
ListServices returns all registered services.
func (*ConfigStore) UpsertService ¶
func (s *ConfigStore) UpsertService(_ context.Context, svc dataplane.ServiceEntry) error
UpsertService adds or updates a service entry (matched by Name).
type MetricStore ¶
type MetricStore struct {
// contains filtered or unexported fields
}
MetricStore wraps gateway.RequestStats and RequestLog to satisfy the dataplane.MetricReader and dataplane.MetricWriter interfaces for local mode.
func NewMetricStore ¶
func NewMetricStore(stats *gateway.RequestStats, log *gateway.RequestLog) *MetricStore
NewMetricStore creates a MetricStore.
func (*MetricStore) Percentiles ¶
func (s *MetricStore) Percentiles(_ context.Context, service, action string, window time.Duration) (*dataplane.LatencyPercentiles, error)
Percentiles returns latency percentiles for a service/action over the given window.
func (*MetricStore) Record ¶
func (s *MetricStore) Record(_ context.Context, service, action string, latencyMs float64, statusCode int) error
Record records a metric sample and increments the request counter.
func (*MetricStore) ServiceStats ¶
func (s *MetricStore) ServiceStats(_ context.Context, service string, window time.Duration) (*dataplane.ServiceMetrics, error)
ServiceStats returns aggregate metrics for a service over the given window.
type PreferenceStore ¶
type PreferenceStore struct {
// contains filtered or unexported fields
}
PreferenceStore satisfies the dataplane.PreferenceStore interface using in-memory storage.
func NewPreferenceStore ¶
func NewPreferenceStore() *PreferenceStore
NewPreferenceStore creates an empty in-memory PreferenceStore.
func (*PreferenceStore) Delete ¶
func (s *PreferenceStore) Delete(_ context.Context, namespace, key string) error
Delete removes a key from the given namespace.
func (*PreferenceStore) Get ¶
func (s *PreferenceStore) Get(_ context.Context, namespace, key string) (json.RawMessage, error)
Get returns the value for the given namespace and key. Returns ErrNotFound if the key does not exist.
func (*PreferenceStore) ListByNamespace ¶
func (s *PreferenceStore) ListByNamespace(_ context.Context, namespace string) (map[string]json.RawMessage, error)
ListByNamespace returns all key-value pairs for the given namespace. Returns an empty map if the namespace does not exist.
func (*PreferenceStore) Set ¶
func (s *PreferenceStore) Set(_ context.Context, namespace, key string, value json.RawMessage) error
Set upserts a value for the given namespace and key.
type RequestStore ¶
type RequestStore struct {
// contains filtered or unexported fields
}
RequestStore wraps gateway.RequestLog to satisfy the dataplane.RequestReader and dataplane.RequestWriter interfaces for local (in-memory) mode.
func NewRequestStore ¶
func NewRequestStore(log *gateway.RequestLog) *RequestStore
NewRequestStore creates a RequestStore wrapping the given gateway.RequestLog.
func (*RequestStore) GetByID ¶
func (s *RequestStore) GetByID(_ context.Context, id string) (*dataplane.RequestEntry, error)
GetByID returns the request entry with the given ID.
func (*RequestStore) Query ¶
func (s *RequestStore) Query(_ context.Context, filter dataplane.RequestFilter) ([]dataplane.RequestEntry, error)
Query returns request entries matching the filter.
func (*RequestStore) Write ¶
func (s *RequestStore) Write(_ context.Context, entry dataplane.RequestEntry) error
Write adds a request entry to the log.
type SLOStore ¶
type SLOStore struct {
// contains filtered or unexported fields
}
SLOStore wraps gateway.SLOEngine to satisfy the dataplane.SLOStore interface for local (in-memory) mode.
func NewSLOStore ¶
NewSLOStore creates an SLOStore wrapping the given gateway.SLOEngine.
type TopologyStore ¶
type TopologyStore struct {
// contains filtered or unexported fields
}
TopologyStore satisfies the dataplane.TopologyStore interface using in-memory slices for nodes and edges.
func NewTopologyStore ¶
func NewTopologyStore() *TopologyStore
NewTopologyStore creates an empty TopologyStore.
func (*TopologyStore) Downstream ¶
Downstream returns all services that the given service calls.
func (*TopologyStore) GetTopology ¶
func (s *TopologyStore) GetTopology(_ context.Context) (*dataplane.TopologyGraph, error)
GetTopology returns the full topology graph.
func (*TopologyStore) RecordEdge ¶
func (s *TopologyStore) RecordEdge(_ context.Context, edge dataplane.ObservedEdge) error
RecordEdge upserts an edge. If an edge with the same Source, Target, and EdgeType already exists, its RequestCount is incremented. Otherwise, a new edge is appended and nodes are created as needed.
type TraceStore ¶
type TraceStore struct {
// contains filtered or unexported fields
}
TraceStore wraps gateway.TraceStore to satisfy the dataplane.TraceReader and dataplane.TraceWriter interfaces for local (in-memory) mode.
func NewTraceStore ¶
func NewTraceStore(store *gateway.TraceStore) *TraceStore
NewTraceStore creates a TraceStore wrapping the given gateway.TraceStore.
func (*TraceStore) Get ¶
func (s *TraceStore) Get(_ context.Context, traceID string) (*dataplane.TraceContext, error)
Get returns the trace with the given ID, converting from gateway types.
func (*TraceStore) Search ¶
func (s *TraceStore) Search(_ context.Context, filter dataplane.TraceFilter) ([]dataplane.TraceSummary, error)
Search returns recent traces matching the filter.
func (*TraceStore) Timeline ¶
func (s *TraceStore) Timeline(_ context.Context, traceID string) ([]dataplane.TimelineSpan, error)
Timeline returns a flattened waterfall view of the trace.
func (*TraceStore) WriteSpans ¶
WriteSpans writes spans to the underlying trace store.