Documentation ¶
Index ¶
- func NewMetricsClient(ctx context.Context, cfg CloudConfig) (telemetry.MetricsClient, error)
- type BootstrapConfig
- type Client
- type CloudConfig
- type MetricsConfig
- type MockClient
- func (_m *MockClient) DiscoverServers(ctx context.Context) ([]string, error)
- func (_m *MockClient) EXPECT() *MockClient_Expecter
- func (_m *MockClient) FetchBootstrap(ctx context.Context) (*BootstrapConfig, error)
- func (_m *MockClient) FetchTelemetryConfig(ctx context.Context) (*TelemetryConfig, error)
- func (_m *MockClient) PushServerStatus(ctx context.Context, status *ServerStatus) error
- type MockClient_DiscoverServers_Call
- func (_c *MockClient_DiscoverServers_Call) Return(_a0 []string, _a1 error) *MockClient_DiscoverServers_Call
- func (_c *MockClient_DiscoverServers_Call) Run(run func(ctx context.Context)) *MockClient_DiscoverServers_Call
- func (_c *MockClient_DiscoverServers_Call) RunAndReturn(run func(context.Context) ([]string, error)) *MockClient_DiscoverServers_Call
- type MockClient_Expecter
- func (_e *MockClient_Expecter) DiscoverServers(ctx interface{}) *MockClient_DiscoverServers_Call
- func (_e *MockClient_Expecter) FetchBootstrap(ctx interface{}) *MockClient_FetchBootstrap_Call
- func (_e *MockClient_Expecter) FetchTelemetryConfig(ctx interface{}) *MockClient_FetchTelemetryConfig_Call
- func (_e *MockClient_Expecter) PushServerStatus(ctx interface{}, status interface{}) *MockClient_PushServerStatus_Call
- type MockClient_FetchBootstrap_Call
- func (_c *MockClient_FetchBootstrap_Call) Return(_a0 *BootstrapConfig, _a1 error) *MockClient_FetchBootstrap_Call
- func (_c *MockClient_FetchBootstrap_Call) Run(run func(ctx context.Context)) *MockClient_FetchBootstrap_Call
- func (_c *MockClient_FetchBootstrap_Call) RunAndReturn(run func(context.Context) (*BootstrapConfig, error)) *MockClient_FetchBootstrap_Call
- type MockClient_FetchTelemetryConfig_Call
- func (_c *MockClient_FetchTelemetryConfig_Call) Return(_a0 *TelemetryConfig, _a1 error) *MockClient_FetchTelemetryConfig_Call
- func (_c *MockClient_FetchTelemetryConfig_Call) Run(run func(ctx context.Context)) *MockClient_FetchTelemetryConfig_Call
- func (_c *MockClient_FetchTelemetryConfig_Call) RunAndReturn(run func(context.Context) (*TelemetryConfig, error)) *MockClient_FetchTelemetryConfig_Call
- type MockClient_PushServerStatus_Call
- func (_c *MockClient_PushServerStatus_Call) Return(_a0 error) *MockClient_PushServerStatus_Call
- func (_c *MockClient_PushServerStatus_Call) Run(run func(ctx context.Context, status *ServerStatus)) *MockClient_PushServerStatus_Call
- func (_c *MockClient_PushServerStatus_Call) RunAndReturn(run func(context.Context, *ServerStatus) error) *MockClient_PushServerStatus_Call
- type MockCloudCfg
- type RefreshConfig
- type ServerACLInfo
- type ServerAutopilot
- type ServerRaft
- type ServerStatus
- type ServerTLSInfo
- type TelemetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetricsClient ¶
func NewMetricsClient(ctx context.Context, cfg CloudConfig) (telemetry.MetricsClient, error)
NewMetricsClient returns a configured MetricsClient. The current implementation uses otlpClient to provide retry functionality.
Types ¶
type BootstrapConfig ¶
type Client ¶
type Client interface { FetchBootstrap(ctx context.Context) (*BootstrapConfig, error) FetchTelemetryConfig(ctx context.Context) (*TelemetryConfig, error) PushServerStatus(ctx context.Context, status *ServerStatus) error DiscoverServers(ctx context.Context) ([]string, error) }
Client interface exposes HCP operations that can be invoked by Consul
type CloudConfig ¶
type CloudConfig interface { HCPConfig(opts ...hcpcfg.HCPConfigOption) (hcpcfg.HCPConfig, error) Resource() (resource.Resource, error) }
cloudConfig represents cloud config for TLS abstracted in an interface for easy testing.
type MetricsConfig ¶
MetricsConfig holds metrics specific configuration within TelemetryConfig.
type MockClient ¶
MockClient is an autogenerated mock type for the Client type
func NewMockClient ¶
func NewMockClient(t mockConstructorTestingTNewMockClient) *MockClient
NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockClient) DiscoverServers ¶
func (_m *MockClient) DiscoverServers(ctx context.Context) ([]string, error)
DiscoverServers provides a mock function with given fields: ctx
func (*MockClient) EXPECT ¶
func (_m *MockClient) EXPECT() *MockClient_Expecter
func (*MockClient) FetchBootstrap ¶
func (_m *MockClient) FetchBootstrap(ctx context.Context) (*BootstrapConfig, error)
FetchBootstrap provides a mock function with given fields: ctx
func (*MockClient) FetchTelemetryConfig ¶
func (_m *MockClient) FetchTelemetryConfig(ctx context.Context) (*TelemetryConfig, error)
FetchTelemetryConfig provides a mock function with given fields: ctx
func (*MockClient) PushServerStatus ¶
func (_m *MockClient) PushServerStatus(ctx context.Context, status *ServerStatus) error
PushServerStatus provides a mock function with given fields: ctx, status
type MockClient_DiscoverServers_Call ¶
MockClient_DiscoverServers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DiscoverServers'
func (*MockClient_DiscoverServers_Call) Return ¶
func (_c *MockClient_DiscoverServers_Call) Return(_a0 []string, _a1 error) *MockClient_DiscoverServers_Call
func (*MockClient_DiscoverServers_Call) Run ¶
func (_c *MockClient_DiscoverServers_Call) Run(run func(ctx context.Context)) *MockClient_DiscoverServers_Call
func (*MockClient_DiscoverServers_Call) RunAndReturn ¶
func (_c *MockClient_DiscoverServers_Call) RunAndReturn(run func(context.Context) ([]string, error)) *MockClient_DiscoverServers_Call
type MockClient_Expecter ¶
type MockClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClient_Expecter) DiscoverServers ¶
func (_e *MockClient_Expecter) DiscoverServers(ctx interface{}) *MockClient_DiscoverServers_Call
DiscoverServers is a helper method to define mock.On call
- ctx context.Context
func (*MockClient_Expecter) FetchBootstrap ¶
func (_e *MockClient_Expecter) FetchBootstrap(ctx interface{}) *MockClient_FetchBootstrap_Call
FetchBootstrap is a helper method to define mock.On call
- ctx context.Context
func (*MockClient_Expecter) FetchTelemetryConfig ¶
func (_e *MockClient_Expecter) FetchTelemetryConfig(ctx interface{}) *MockClient_FetchTelemetryConfig_Call
FetchTelemetryConfig is a helper method to define mock.On call
- ctx context.Context
func (*MockClient_Expecter) PushServerStatus ¶
func (_e *MockClient_Expecter) PushServerStatus(ctx interface{}, status interface{}) *MockClient_PushServerStatus_Call
PushServerStatus is a helper method to define mock.On call
- ctx context.Context
- status *ServerStatus
type MockClient_FetchBootstrap_Call ¶
MockClient_FetchBootstrap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchBootstrap'
func (*MockClient_FetchBootstrap_Call) Return ¶
func (_c *MockClient_FetchBootstrap_Call) Return(_a0 *BootstrapConfig, _a1 error) *MockClient_FetchBootstrap_Call
func (*MockClient_FetchBootstrap_Call) Run ¶
func (_c *MockClient_FetchBootstrap_Call) Run(run func(ctx context.Context)) *MockClient_FetchBootstrap_Call
func (*MockClient_FetchBootstrap_Call) RunAndReturn ¶
func (_c *MockClient_FetchBootstrap_Call) RunAndReturn(run func(context.Context) (*BootstrapConfig, error)) *MockClient_FetchBootstrap_Call
type MockClient_FetchTelemetryConfig_Call ¶
MockClient_FetchTelemetryConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchTelemetryConfig'
func (*MockClient_FetchTelemetryConfig_Call) Return ¶
func (_c *MockClient_FetchTelemetryConfig_Call) Return(_a0 *TelemetryConfig, _a1 error) *MockClient_FetchTelemetryConfig_Call
func (*MockClient_FetchTelemetryConfig_Call) Run ¶
func (_c *MockClient_FetchTelemetryConfig_Call) Run(run func(ctx context.Context)) *MockClient_FetchTelemetryConfig_Call
func (*MockClient_FetchTelemetryConfig_Call) RunAndReturn ¶
func (_c *MockClient_FetchTelemetryConfig_Call) RunAndReturn(run func(context.Context) (*TelemetryConfig, error)) *MockClient_FetchTelemetryConfig_Call
type MockClient_PushServerStatus_Call ¶
MockClient_PushServerStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushServerStatus'
func (*MockClient_PushServerStatus_Call) Return ¶
func (_c *MockClient_PushServerStatus_Call) Return(_a0 error) *MockClient_PushServerStatus_Call
func (*MockClient_PushServerStatus_Call) Run ¶
func (_c *MockClient_PushServerStatus_Call) Run(run func(ctx context.Context, status *ServerStatus)) *MockClient_PushServerStatus_Call
func (*MockClient_PushServerStatus_Call) RunAndReturn ¶
func (_c *MockClient_PushServerStatus_Call) RunAndReturn(run func(context.Context, *ServerStatus) error) *MockClient_PushServerStatus_Call
type MockCloudCfg ¶
func (MockCloudCfg) HCPConfig ¶
func (m MockCloudCfg) HCPConfig(opts ...hcpcfg.HCPConfigOption) (hcpcfg.HCPConfig, error)
type RefreshConfig ¶
RefreshConfig contains configuration for the periodic fetch of configuration from HCP.
type ServerACLInfo ¶
type ServerACLInfo struct {
Enabled bool
}
type ServerAutopilot ¶
type ServerRaft ¶
type ServerStatus ¶
type ServerStatus struct { ID string Name string Version string LanAddress string GossipPort int RPCPort int Datacenter string Autopilot ServerAutopilot Raft ServerRaft TLS ServerTLSInfo ACL ServerACLInfo ScadaStatus string }
type ServerTLSInfo ¶
type TelemetryConfig ¶
type TelemetryConfig struct { MetricsConfig *MetricsConfig RefreshConfig *RefreshConfig }
TelemetryConfig contains configuration for telemetry data forwarded by Consul servers to the HCP Telemetry gateway.
func (*TelemetryConfig) MetricsEnabled ¶
func (t *TelemetryConfig) MetricsEnabled() bool
MetricsEnabled returns true if metrics export is enabled, i.e. a valid metrics endpoint exists.