merger

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Merger

type Merger interface {
	MergeResponses([][]byte) ([]byte, error)
}

Merger represents logic for merging response bodies.

type Noop

type Noop struct{}

Noop is an implementation of the Merger interface which does not actually merge responses, but just returns an arbitrary response(the first in the list). It can be used for write requests where the response is either empty or inconsequential.

func (Noop) MergeResponses

func (Noop) MergeResponses(in [][]byte) ([]byte, error)

type V2AlertGroups added in v1.10.0

type V2AlertGroups struct{}

V2AlertGroups implements the Merger interface for GET /v2/alerts/groups. It returns the union of alert groups over all the responses. When the same alert exists in the same group for multiple responses, the instance of that alert with the most recent UpdatedAt timestamp is returned in that group within the response.

func (V2AlertGroups) MergeResponses added in v1.10.0

func (V2AlertGroups) MergeResponses(in [][]byte) ([]byte, error)

type V2Alerts added in v1.10.0

type V2Alerts struct{}

V2Alerts implements the Merger interface for GET /v2/alerts. It returns the union of alerts over all the responses. When the same alert exists in multiple responses, the instance of that alert with the most recent UpdatedAt timestamp is returned in the response.

func (V2Alerts) MergeResponses added in v1.10.0

func (V2Alerts) MergeResponses(in [][]byte) ([]byte, error)

type V2SilenceID added in v1.10.0

type V2SilenceID struct{}

V2SilenceID implements the Merger interface for GET /v2/silence/{id}. It returns the most recently updated silence (newest UpdatedAt timestamp).

func (V2SilenceID) MergeResponses added in v1.10.0

func (V2SilenceID) MergeResponses(in [][]byte) ([]byte, error)

type V2Silences added in v1.10.0

type V2Silences struct{}

V2Silences implements the Merger interface for GET /v2/silences. It returns the union of silences over all the responses. When a silence with the same ID exists in multiple responses, the silence most recently updated silence is returned (newest UpdatedAt timestamp).

func (V2Silences) MergeResponses added in v1.10.0

func (V2Silences) MergeResponses(in [][]byte) ([]byte, error)

Jump to

Keyboard shortcuts

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