speed

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package speed owns the cross-surface ACP speed vocabulary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolutionReasonValues

func ResolutionReasonValues() []string

ResolutionReasonValues returns the canonical non-applied reason vocabulary.

func ResolutionStatusValues

func ResolutionStatusValues() []string

ResolutionStatusValues returns the canonical outcome vocabulary.

func ValidateResolution

func ValidateResolution(value Resolution) error

ValidateResolution ensures an outcome uses a canonical status and reason pair.

func Values

func Values() []string

Values returns the canonical speed vocabulary in display order.

Types

type Resolution

type Resolution struct {
	Requested Speed            `json:"requested"`
	Status    ResolutionStatus `json:"status"`
	Reason    ResolutionReason `json:"reason,omitempty"`
}

Resolution records one requested speed and its runtime outcome.

func CloneResolution

func CloneResolution(value *Resolution) *Resolution

CloneResolution returns an independent resolution snapshot.

type ResolutionReason

type ResolutionReason string

ResolutionReason explains why a speed request was not applied.

const (
	ReasonCapabilityAbsent    ResolutionReason = "capability_absent"
	ReasonCapabilityAmbiguous ResolutionReason = "capability_ambiguous"
	ReasonValueAmbiguous      ResolutionReason = "value_ambiguous"
	ReasonProviderRejected    ResolutionReason = "provider_rejected"
)

type ResolutionStatus

type ResolutionStatus string

ResolutionStatus identifies the outcome of applying a speed request.

const (
	ResolutionApplied     ResolutionStatus = "applied"
	ResolutionUnsupported ResolutionStatus = "unsupported"
	ResolutionRejected    ResolutionStatus = "rejected"
)

type Speed

type Speed string

Speed identifies one provider-neutral runtime speed.

const (
	SpeedNormal Speed = "normal"
	SpeedFast   Speed = "fast"
)

func Parse

func Parse(value string) (Speed, error)

Parse returns one canonical speed value.

Jump to

Keyboard shortcuts

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