client

package
v0.0.0-...-221c3f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureThreadWindsCredentials

func ConfigureThreadWindsCredentials(ctx context.Context, deps *ClientDependencies, twConfig *ThreadWindsConfig) error

Types

type BackendClient

type BackendClient struct {
	// contains filtered or unexported fields
}

func NewBackendClient

func NewBackendClient(cfg *config.TWConfig) *BackendClient

func (*BackendClient) GetIncidentAlerts

func (c *BackendClient) GetIncidentAlerts(ctx context.Context, incidentID int64) ([]*models.IncidentAlert, error)

func (*BackendClient) GetRecentIncidents

func (c *BackendClient) GetRecentIncidents(ctx context.Context) ([]*models.Incident, error)

func (*BackendClient) GetThreadWindsConfig

func (c *BackendClient) GetThreadWindsConfig(ctx context.Context) (*ThreadWindsConfig, error)

func (*BackendClient) SaveThreadWindsCredentials

func (c *BackendClient) SaveThreadWindsCredentials(ctx context.Context, apiKey, apiSecret string, keyID, secretID int64) error

type ClientDependencies

type ClientDependencies struct {
	Backend     *BackendClient
	CM          *CustomersManagerClient
	ThreadWinds *ThreadWindsClient
	OpenSearch  *OpenSearchClient
}

func NewClientDependencies

func NewClientDependencies(cfg *config.TWConfig) (*ClientDependencies, error)

type ConfigParameter

type ConfigParameter struct {
	ID                   int64  `json:"id"`
	SectionID            int64  `json:"sectionId"`
	ConfParamShort       string `json:"confParamShort"`
	ConfParamLarge       string `json:"confParamLarge,omitempty"`
	ConfParamDescription string `json:"confParamDescription,omitempty"`
	ConfParamValue       string `json:"confParamValue"`
	ConfParamRequired    bool   `json:"confParamRequired,omitempty"`
	ConfParamDatatype    string `json:"confParamDatatype,omitempty"`
}

type CustomersManagerClient

type CustomersManagerClient struct {
	Server      string `yaml:"server"`
	InstanceID  string `yaml:"instance_id"`
	InstanceKey string `yaml:"instance_key"`
}

func (*CustomersManagerClient) LoadInstanceConfig

func (c *CustomersManagerClient) LoadInstanceConfig() error

func (*CustomersManagerClient) RegisterUserReporter

func (c *CustomersManagerClient) RegisterUserReporter() (*RegistrationResponse, error)

type OpenSearchClient

type OpenSearchClient struct {
	// contains filtered or unexported fields
}

func NewOpenSearchClient

func NewOpenSearchClient(cfg *config.TWConfig) (*OpenSearchClient, error)

func (*OpenSearchClient) GetAlertByID

func (c *OpenSearchClient) GetAlertByID(ctx context.Context, alertID string) (*models.Alert, error)

type RegistrationResponse

type RegistrationResponse struct {
	APIKey    string `json:"api_key"`
	APISecret string `json:"api_secret"`
}

type ThreadWindsClient

type ThreadWindsClient struct {
	// contains filtered or unexported fields
}

func NewThreadWindsClient

func NewThreadWindsClient(cfg *config.TWConfig) *ThreadWindsClient

func (*ThreadWindsClient) IngestBatch

func (c *ThreadWindsClient) IngestBatch(ctx context.Context, entityBatch []*entities.Entity) error

func (*ThreadWindsClient) UpdateCredentials

func (c *ThreadWindsClient) UpdateCredentials(apiKey, apiSecret string)

type ThreadWindsConfig

type ThreadWindsConfig struct {
	APIKey    string
	APISecret string
	Enabled   string
	KeyID     int64
	SecretID  int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL