merger

package
v1.9.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 4 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 V1Alerts

type V1Alerts struct{}

V1Alerts implements the Merger interface for GET /v1/alerts. It returns the union of alerts over all the responses. When the same alert exists in multiple responses, the alert instance in the earliest response is returned in the final response. We cannot use the UpdatedAt timestamp as for V2Alerts, because the v1 API does not provide it.

func (V1Alerts) MergeResponses

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

Jump to

Keyboard shortcuts

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