Documentation ¶
Index ¶
- Constants
- Variables
- type RedisSynHeartStore
- func (r *RedisSynHeartStore) Close() error
- func (r *RedisSynHeartStore) DelR(ctx context.Context, key string) error
- func (r *RedisSynHeartStore) DeleteAgentStatus(ctx context.Context, agentId string) error
- func (r *RedisSynHeartStore) DeleteAllTestRunInfo(ctx context.Context, pluginId string) error
- func (r *RedisSynHeartStore) DeleteTestConfig(ctx context.Context, configId string) error
- func (r *RedisSynHeartStore) FetchAllAgentStatus(ctx context.Context) (map[string]common.AgentStatus, error)
- func (r *RedisSynHeartStore) FetchAllPluginStatus(ctx context.Context) (map[string]string, error)
- func (r *RedisSynHeartStore) FetchAllTestConfigSummary(ctx context.Context) (map[string]common.SyntestConfigSummary, error)
- func (r *RedisSynHeartStore) FetchAllTestRunStatus(ctx context.Context) (map[string]string, error)
- func (r *RedisSynHeartStore) FetchLastFailedTestRun(ctx context.Context, pluginId string) (proto.TestRun, error)
- func (r *RedisSynHeartStore) FetchLatestTestRun(ctx context.Context, pluginId string) (proto.TestRun, error)
- func (r *RedisSynHeartStore) FetchPluginHealthStatus(ctx context.Context, pluginId string) (common.PluginState, error)
- func (r *RedisSynHeartStore) FetchPluginLastUnhealthyStatus(ctx context.Context, pluginId string) (common.PluginState, error)
- func (r *RedisSynHeartStore) FetchTestConfig(ctx context.Context, testConfigId string) (proto.SynTestConfig, error)
- func (r *RedisSynHeartStore) FetchTestConfigStatus(ctx context.Context, configId string) (common.SyntestConfigStatus, error)
- func (r *RedisSynHeartStore) GetR(ctx context.Context, key string) (string, error)
- func (r *RedisSynHeartStore) HDelR(ctx context.Context, key string, field string) error
- func (r *RedisSynHeartStore) HGetAllR(ctx context.Context, key string) (map[string]string, error)
- func (r *RedisSynHeartStore) HSetR(ctx context.Context, key string, field string, val string) error
- func (r *RedisSynHeartStore) NewAgentEvent(ctx context.Context, event string) error
- func (r *RedisSynHeartStore) Ping(ctx context.Context) error
- func (r *RedisSynHeartStore) PublishR(ctx context.Context, channel string, msg string) error
- func (r *RedisSynHeartStore) SetR(ctx context.Context, key string, val interface{}, expiration time.Duration) error
- func (r *RedisSynHeartStore) SubscribeToAgentEvents(ctx context.Context, channelSize int, agentChan chan<- string) error
- func (r *RedisSynHeartStore) SubscribeToConfigEvents(ctx context.Context, channelSize int, pluginName chan<- string) error
- func (r *RedisSynHeartStore) SubscribeToTestRunEvents(ctx context.Context, channelSize int, testChan chan<- string) error
- func (r *RedisSynHeartStore) UpdatePluginStatus(ctx context.Context, pluginId string, status string) error
- func (r *RedisSynHeartStore) UpdateTestRunStatus(ctx context.Context, pluginId string, passRatio float64) error
- func (r *RedisSynHeartStore) WriteAgentStatus(ctx context.Context, agentId string, status common.AgentStatus) error
- func (r *RedisSynHeartStore) WritePluginHealthStatus(ctx context.Context, pluginId string, pluginState common.PluginState) error
- func (r *RedisSynHeartStore) WriteTestConfig(ctx context.Context, config proto.SynTestConfig, raw string) error
- func (r *RedisSynHeartStore) WriteTestConfigStatus(ctx context.Context, configId string, status common.SyntestConfigStatus) error
- func (r *RedisSynHeartStore) WriteTestRun(ctx context.Context, pluginId string, testRun proto.TestRun) error
- type SynHeartStore
- type SynHeartStoreConfig
Constants ¶
View Source
const ( SynTestsBase = "syntest-plugins" AllTestRunStatus = SynTestsBase + "/all/testRunStatus" // ui needs this AllPluginStatus = SynTestsBase + "/all/pluginStatus" PluginLatestHealthFmt = SynTestsBase + "/%s/latestHealth" PluginLastUnhealthyFmt = SynTestsBase + "/%s/lastUnhealthy" TestRunLatestFmt = SynTestsBase + "/%s/latestRun" TestRunLastFailedFmt = SynTestsBase + "/%s/lastFailedRun" ConfigBase = "configs" ConfigSynTestsSummary = ConfigBase + "/syntests/summary" ConfigSynTestJsonFmt = ConfigBase + "/syntest/%s/json" ConfigSynTestRawFmt = ConfigBase + "/syntest/%s/raw" ConfigSynTestStatusFmt = ConfigBase + "/syntest/%s/status" AgentsAll = "agents/all" SynTestChannel = "syntests" ConfigChannel = "config" AgentChannel = "agent" )
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type RedisSynHeartStore ¶
type RedisSynHeartStore struct {
// contains filtered or unexported fields
}
func NewRedisSynHeartStore ¶
func NewRedisSynHeartStore(config SynHeartStoreConfig, log hclog.Logger) RedisSynHeartStore
func (*RedisSynHeartStore) Close ¶
func (r *RedisSynHeartStore) Close() error
func (*RedisSynHeartStore) DelR ¶
func (r *RedisSynHeartStore) DelR(ctx context.Context, key string) error
Deletes key and val
func (*RedisSynHeartStore) DeleteAgentStatus ¶
func (r *RedisSynHeartStore) DeleteAgentStatus(ctx context.Context, agentId string) error
func (*RedisSynHeartStore) DeleteAllTestRunInfo ¶
func (r *RedisSynHeartStore) DeleteAllTestRunInfo(ctx context.Context, pluginId string) error
func (*RedisSynHeartStore) DeleteTestConfig ¶
func (r *RedisSynHeartStore) DeleteTestConfig(ctx context.Context, configId string) error
func (*RedisSynHeartStore) FetchAllAgentStatus ¶
func (r *RedisSynHeartStore) FetchAllAgentStatus(ctx context.Context) (map[string]common.AgentStatus, error)
func (*RedisSynHeartStore) FetchAllPluginStatus ¶
func (*RedisSynHeartStore) FetchAllTestConfigSummary ¶
func (r *RedisSynHeartStore) FetchAllTestConfigSummary(ctx context.Context) (map[string]common.SyntestConfigSummary, error)
func (*RedisSynHeartStore) FetchAllTestRunStatus ¶
func (*RedisSynHeartStore) FetchLastFailedTestRun ¶
func (*RedisSynHeartStore) FetchLatestTestRun ¶
func (*RedisSynHeartStore) FetchPluginHealthStatus ¶
func (r *RedisSynHeartStore) FetchPluginHealthStatus(ctx context.Context, pluginId string) (common.PluginState, error)
func (*RedisSynHeartStore) FetchPluginLastUnhealthyStatus ¶
func (r *RedisSynHeartStore) FetchPluginLastUnhealthyStatus(ctx context.Context, pluginId string) (common.PluginState, error)
func (*RedisSynHeartStore) FetchTestConfig ¶
func (r *RedisSynHeartStore) FetchTestConfig(ctx context.Context, testConfigId string) (proto.SynTestConfig, error)
func (*RedisSynHeartStore) FetchTestConfigStatus ¶
func (r *RedisSynHeartStore) FetchTestConfigStatus(ctx context.Context, configId string) (common.SyntestConfigStatus, error)
func (*RedisSynHeartStore) NewAgentEvent ¶
func (r *RedisSynHeartStore) NewAgentEvent(ctx context.Context, event string) error
func (*RedisSynHeartStore) SetR ¶
func (r *RedisSynHeartStore) SetR(ctx context.Context, key string, val interface{}, expiration time.Duration) error
Writes value to a key
func (*RedisSynHeartStore) SubscribeToAgentEvents ¶
func (*RedisSynHeartStore) SubscribeToConfigEvents ¶
func (*RedisSynHeartStore) SubscribeToTestRunEvents ¶
func (*RedisSynHeartStore) UpdatePluginStatus ¶
func (*RedisSynHeartStore) UpdateTestRunStatus ¶
func (*RedisSynHeartStore) WriteAgentStatus ¶
func (r *RedisSynHeartStore) WriteAgentStatus(ctx context.Context, agentId string, status common.AgentStatus) error
func (*RedisSynHeartStore) WritePluginHealthStatus ¶
func (r *RedisSynHeartStore) WritePluginHealthStatus(ctx context.Context, pluginId string, pluginState common.PluginState) error
func (*RedisSynHeartStore) WriteTestConfig ¶
func (r *RedisSynHeartStore) WriteTestConfig(ctx context.Context, config proto.SynTestConfig, raw string) error
func (*RedisSynHeartStore) WriteTestConfigStatus ¶
func (r *RedisSynHeartStore) WriteTestConfigStatus(ctx context.Context, configId string, status common.SyntestConfigStatus) error
func (*RedisSynHeartStore) WriteTestRun ¶
type SynHeartStore ¶
type SynHeartStore interface { // TestRun functions SubscribeToTestRunEvents(ctx context.Context, channelSize int, pluginId chan<- string) error WriteTestRun(ctx context.Context, pluginId string, testRun proto.TestRun) error FetchLatestTestRun(ctx context.Context, pluginId string) (proto.TestRun, error) FetchLastFailedTestRun(ctx context.Context, pluginId string) (proto.TestRun, error) FetchAllTestRunStatus(ctx context.Context) (map[string]string, error) DeleteAllTestRunInfo(ctx context.Context, pluginId string) error // Plugin health status functions WritePluginHealthStatus(ctx context.Context, pluginId string, state common.PluginState) error FetchPluginHealthStatus(ctx context.Context, pluginId string) (common.PluginState, error) FetchPluginLastUnhealthyStatus(ctx context.Context, pluginId string) (common.PluginState, error) FetchAllPluginStatus(ctx context.Context) (map[string]string, error) // Test config functions SubscribeToConfigEvents(ctx context.Context, channelSize int, configChan chan<- string) error WriteTestConfig(ctx context.Context, config proto.SynTestConfig, raw string) error FetchTestConfig(ctx context.Context, configId string) (proto.SynTestConfig, error) DeleteTestConfig(ctx context.Context, configId string) error WriteTestConfigStatus(ctx context.Context, configId string, status common.SyntestConfigStatus) error FetchTestConfigStatus(ctx context.Context, configId string) (common.SyntestConfigStatus, error) FetchAllTestConfigSummary(ctx context.Context) (map[string]common.SyntestConfigSummary, error) // Agent functions FetchAllAgentStatus(ctx context.Context) (map[string]common.AgentStatus, error) WriteAgentStatus(ctx context.Context, agentId string, status common.AgentStatus) error DeleteAgentStatus(ctx context.Context, agentId string) error SubscribeToAgentEvents(ctx context.Context, channelSize int, configChan chan<- string) error NewAgentEvent(ctx context.Context, event string) error Close() error Ping(ctx context.Context) error }
Interface that a storage for Synthetic Heart must implement
func NewSynHeartStore ¶
func NewSynHeartStore(config SynHeartStoreConfig, log hclog.Logger) (SynHeartStore, error)
type SynHeartStoreConfig ¶
Click to show internal directories.
Click to hide internal directories.