models

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MPL-2.0 Imports: 7 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 ToProcessStatus added in v0.89.0

func ToProcessStatus(status ReplayStatus) slo.ProcessStatus

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"`
	TimeRange ReplayTimeRange  `json:"timeRange,omitempty"`
	SourceSLO *ReplaySourceSLO `json:"sourceSlo,omitempty"`
}

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 govy.

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 ReplaySourceSLO added in v0.88.0

type ReplaySourceSLO struct {
	Slo           string                `json:"slo"`
	Project       string                `json:"project"`
	ObjectivesMap []ReplaySourceSLOItem `json:"objectivesMap"`
}

type ReplaySourceSLOItem added in v0.88.0

type ReplaySourceSLOItem struct {
	Source string `json:"source"`
	Target string `json:"target"`
}

type ReplayStatus

type ReplayStatus struct {
	Source      string `json:"source"`
	Status      string `json:"status"`
	TriggeredBy string `json:"triggeredBy"`
	Unit        string `json:"unit"`
	Value       int    `json:"value"`
	StartTime   string `json:"startTime"`
}

type ReplayTimeRange added in v0.85.0

type ReplayTimeRange struct {
	StartDate time.Time `json:"startDate,omitempty"`
	EndDate   time.Time `json:"endDate,omitempty"` // not supported yet
}

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