Documentation ¶
Index ¶
- Constants
- Variables
- type ApiError
- type ApiMetric
- type ApiRequest
- type ApiResult
- type ApiUrl
- type AsyncApiResult
- type AsyncBaseResult
- type BaseRequest
- type Config
- type HttpMetric
- type Metric
- type MetricPublisher
- type MetricSubscriber
- type MetricType
- type OpsGenieClient
- type Process
- type Protocol
- type ProxyConfiguration
- type ResultMetadata
- type SdkMetric
Constants ¶
View Source
const Version = "2.0.0"
Variables ¶
View Source
var AvailableMetricTypes = []MetricType{HTTP, API, SDK}
View Source
var UserAgentHeader string
Functions ¶
This section is empty.
Types ¶
type ApiError ¶
type ApiMetric ¶
type ApiRequest ¶
type AsyncApiResult ¶
type AsyncBaseResult ¶
type AsyncBaseResult struct {
Client *OpsGenieClient
}
func (*AsyncBaseResult) RetrieveStatus ¶
func (ar *AsyncBaseResult) RetrieveStatus(ctx context.Context, request ApiRequest, result ApiResult) error
type BaseRequest ¶
type BaseRequest struct { }
func (*BaseRequest) Metadata ¶
func (r *BaseRequest) Metadata(apiRequest ApiRequest) map[string]interface{}
func (*BaseRequest) RequestParams ¶
func (r *BaseRequest) RequestParams() map[string]string
type Config ¶
type Config struct { ApiKey string OpsGenieAPIURL ApiUrl ProxyConfiguration *ProxyConfiguration RequestTimeout time.Duration HttpClient *http.Client Backoff retryablehttp.Backoff RetryPolicy retryablehttp.CheckRetry RetryCount int LogLevel logrus.Level Logger logrus.FieldLogger // contains filtered or unexported fields }
func (*Config) ConfigureLogLevel ¶
type HttpMetric ¶
type HttpMetric struct { TransactionId string `json:"transactionId"` RetryCount int `json:"retryCount"` Error error `json:"error,omitempty"` Duration int64 `json:"duration"` ResourcePath string `json:"resourcePath"` Status string `json:"status,omitempty"` StatusCode int `json:"statusCode,omitempty"` HttpRequest request `json:"request,omitempty"` }
func (*HttpMetric) Type ¶
func (hm *HttpMetric) Type() string
type MetricPublisher ¶
type MetricPublisher struct { SubscriberMap map[string][]MetricSubscriber // contains filtered or unexported fields }
type MetricSubscriber ¶
type MetricSubscriber struct {
Process Process
}
func (*MetricSubscriber) Register ¶
func (s *MetricSubscriber) Register(metricType MetricType)
type MetricType ¶
type MetricType string
const ( HTTP MetricType = "http" SDK MetricType = "sdk" API MetricType = "api" )
type OpsGenieClient ¶
type OpsGenieClient struct { RetryableClient *retryablehttp.Client Config *Config }
func NewOpsGenieClient ¶
func NewOpsGenieClient(cfg *Config) (*OpsGenieClient, error)
func (*OpsGenieClient) Exec ¶
func (cli *OpsGenieClient) Exec(ctx context.Context, request ApiRequest, result ApiResult) error
type ProxyConfiguration ¶
type ResultMetadata ¶
type ResultMetadata struct { RequestId string `json:"requestId"` ResponseTime float32 `json:"took"` RateLimitState string RateLimitReason string RateLimitPeriod string RetryCount int }
func (*ResultMetadata) Parse ¶
func (rm *ResultMetadata) Parse(response *http.Response, result ApiResult) error
func (*ResultMetadata) ValidateResultMetadata ¶
func (rm *ResultMetadata) ValidateResultMetadata() error
type SdkMetric ¶
type SdkMetric struct { TransactionId string `json:"transactionId"` Duration int64 `json:"duration"` ErrorType string `json:"errorType"` ErrorMessage string `json:"errorMessage"` ResourcePath string `json:"resourcePath"` SdkRequestDetails ApiRequest `json:"sdkRequestDetails"` SdkResultDetails ApiResult `json:"sdkResultDetails"` }
Click to show internal directories.
Click to hide internal directories.