models

package
v0.84.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MPL-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package models defines sdk.Client API request and response models. deprecated: models defined here will be moved to sdk/endpoints.

Index

Constants

View Source
const (
	ReplayStatusFailed    = "failed"
	ReplayStatusCompleted = "completed"
)

Variants of ReplayStatus.Status.

View Source
const (
	ReplayDataSourceTypeInvalid              = "datasource_type_invalid"
	ReplayProjectDoesNotExist                = "project_does_not_exist"
	ReplayDataSourceDoesNotExist             = "data_source_does_not_exist"
	ReplayIntegrationDoesNotSupportReplay    = "integration_does_not_support_replay"
	ReplayAgentVersionDoesNotSupportReplay   = "agent_version_does_not_support_replay"
	ReplayMaxHistoricalDataRetrievalTooLow   = "max_historical_data_retrieval_too_low"
	ReplayConcurrentReplayRunsLimitExhausted = "concurrent_replay_runs_limit_exhausted"
	ReplayUnknownAgentVersion                = "unknown_agent_version"
)

Variants of ReplayAvailability.Reason.

View Source
const (
	DurationUnitMinute = "Minute"
	DurationUnitHour   = "Hour"
	DurationUnitDay    = "Day"
)

Variables

View Source
var ErrInvalidReplayDurationUnit = errors.Errorf(
	"invalid duration unit, available units are: %v", allowedDurationUnit)

Functions

func ValidateReplayDurationUnit

func ValidateReplayDurationUnit(unit string) error

ValidateReplayDurationUnit check if given string is allowed period unit.

Types

type Replay

type Replay struct {
	Project  string         `json:"project"`
	Slo      string         `json:"slo"`
	Duration ReplayDuration `json:"duration"`
}

Replay Struct used for posting replay entity.

func ParseJSONToReplayStruct

func ParseJSONToReplayStruct(data io.Reader) (Replay, error)

ParseJSONToReplayStruct parse raw json into v1alpha.Replay struct with validation.

func (Replay) Validate

func (r Replay) Validate() error

type ReplayAvailability

type ReplayAvailability struct {
	Available bool   `json:"available"`
	Reason    string `json:"reason,omitempty"`
}

type ReplayDuration

type ReplayDuration struct {
	Unit  string `json:"unit"`
	Value int    `json:"value"`
}

func (ReplayDuration) Duration

func (d ReplayDuration) Duration() (time.Duration, error)

Duration converts unit and value to time.Duration.

type ReplayStatus

type ReplayStatus struct {
	Status    string `json:"status"`
	Unit      string `json:"unit"`
	Value     int    `json:"value"`
	StartTime string `json:"startTime,omitempty"`
}

type ReplayWithStatus

type ReplayWithStatus struct {
	Project string       `json:"project"`
	Slo     string       `json:"slo"`
	Status  ReplayStatus `json:"status"`
}

ReplayWithStatus used for returning Replay data with status.

Jump to

Keyboard shortcuts

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