Documentation
¶
Index ¶
- func NewPool(ctx context.Context, cfg config.PostgreSQLConfig) (*pgxpool.Pool, error)
- type ConfigStore
- func (s *ConfigStore) AddDeploy(ctx context.Context, deploy dataplane.DeployEvent) error
- func (s *ConfigStore) DeleteView(ctx context.Context, id string) error
- func (s *ConfigStore) GetConfig(ctx context.Context) (*config.Config, error)
- func (s *ConfigStore) ListDeploys(ctx context.Context, filter dataplane.DeployFilter) ([]dataplane.DeployEvent, error)
- func (s *ConfigStore) ListServices(ctx context.Context) ([]dataplane.ServiceEntry, error)
- func (s *ConfigStore) ListViews(ctx context.Context) ([]dataplane.SavedView, error)
- func (s *ConfigStore) SaveView(ctx context.Context, view dataplane.SavedView) error
- func (s *ConfigStore) SetConfig(ctx context.Context, cfg *config.Config) error
- func (s *ConfigStore) UpsertService(ctx context.Context, svc dataplane.ServiceEntry) error
- type PreferenceStore
- func (s *PreferenceStore) Delete(ctx context.Context, namespace, key string) error
- func (s *PreferenceStore) Get(ctx context.Context, namespace, key string) (json.RawMessage, error)
- func (s *PreferenceStore) ListByNamespace(ctx context.Context, namespace string) (map[string]json.RawMessage, error)
- func (s *PreferenceStore) Set(ctx context.Context, namespace, key string, value json.RawMessage) error
- type SLOStore
- func (s *SLOStore) History(ctx context.Context, limit int) ([]dataplane.SLORuleChange, error)
- func (s *SLOStore) Rules(ctx context.Context) ([]config.SLORule, error)
- func (s *SLOStore) SetRules(ctx context.Context, rules []config.SLORule) error
- func (s *SLOStore) Status(ctx context.Context) (*dataplane.SLOStatus, error)
- type TopologyStore
- func (s *TopologyStore) Downstream(ctx context.Context, service string) ([]string, error)
- func (s *TopologyStore) GetTopology(ctx context.Context) (*dataplane.TopologyGraph, error)
- func (s *TopologyStore) RecordEdge(ctx context.Context, edge dataplane.ObservedEdge) error
- func (s *TopologyStore) Upstream(ctx context.Context, service string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigStore ¶
type ConfigStore struct {
// contains filtered or unexported fields
}
ConfigStore implements dataplane.ConfigStore against PostgreSQL.
func NewConfigStore ¶
func NewConfigStore(pool *pgxpool.Pool) *ConfigStore
NewConfigStore creates a ConfigStore backed by the given pool.
func (*ConfigStore) AddDeploy ¶
func (s *ConfigStore) AddDeploy(ctx context.Context, deploy dataplane.DeployEvent) error
AddDeploy inserts a deploy event. The referenced service is upserted first to satisfy the FK constraint.
func (*ConfigStore) DeleteView ¶
func (s *ConfigStore) DeleteView(ctx context.Context, id string) error
DeleteView removes a saved view by ID.
func (*ConfigStore) GetConfig ¶
GetConfig assembles a Config by reading all key/value pairs from the config table.
func (*ConfigStore) ListDeploys ¶
func (s *ConfigStore) ListDeploys(ctx context.Context, filter dataplane.DeployFilter) ([]dataplane.DeployEvent, error)
ListDeploys returns deploy events with optional service filter and limit.
func (*ConfigStore) ListServices ¶
func (s *ConfigStore) ListServices(ctx context.Context) ([]dataplane.ServiceEntry, error)
ListServices returns all services ordered by name.
func (*ConfigStore) SetConfig ¶
SetConfig stores the config as individual key/value pairs using upsert.
func (*ConfigStore) UpsertService ¶
func (s *ConfigStore) UpsertService(ctx context.Context, svc dataplane.ServiceEntry) error
UpsertService inserts or updates a service entry.
type PreferenceStore ¶
type PreferenceStore struct {
// contains filtered or unexported fields
}
PreferenceStore implements dataplane.PreferenceStore against PostgreSQL.
func NewPreferenceStore ¶
func NewPreferenceStore(pool *pgxpool.Pool) *PreferenceStore
NewPreferenceStore creates a PreferenceStore backed by the given pool.
func (*PreferenceStore) Delete ¶
func (s *PreferenceStore) Delete(ctx context.Context, namespace, key string) error
Delete removes a key from the given namespace.
func (*PreferenceStore) Get ¶
func (s *PreferenceStore) Get(ctx context.Context, namespace, key string) (json.RawMessage, error)
Get returns the value for the given namespace and key.
func (*PreferenceStore) ListByNamespace ¶
func (s *PreferenceStore) ListByNamespace(ctx context.Context, namespace string) (map[string]json.RawMessage, error)
ListByNamespace returns all key-value pairs for the given namespace.
func (*PreferenceStore) Set ¶
func (s *PreferenceStore) Set(ctx context.Context, namespace, key string, value json.RawMessage) error
Set upserts a value for the given namespace and key.
type SLOStore ¶
type SLOStore struct {
// contains filtered or unexported fields
}
SLOStore implements dataplane.SLOStore against PostgreSQL.
func NewSLOStore ¶
NewSLOStore creates an SLOStore backed by the given pool.
type TopologyStore ¶
type TopologyStore struct {
// contains filtered or unexported fields
}
TopologyStore implements dataplane.TopologyStore against PostgreSQL.
func NewTopologyStore ¶
func NewTopologyStore(pool *pgxpool.Pool) *TopologyStore
NewTopologyStore creates a TopologyStore backed by the given pool.
func (*TopologyStore) Downstream ¶
Downstream returns all services that the given service calls.
func (*TopologyStore) GetTopology ¶
func (s *TopologyStore) GetTopology(ctx context.Context) (*dataplane.TopologyGraph, error)
GetTopology returns the full topology graph from services and edges.
func (*TopologyStore) RecordEdge ¶
func (s *TopologyStore) RecordEdge(ctx context.Context, edge dataplane.ObservedEdge) error
RecordEdge upserts an edge between two services. Source and target services are created automatically to satisfy FK constraints.