forecast

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 22 Imported by: 0

README

Forecast

Parity grade: A · SDK aws-sdk-go-v2/service/forecast@v1.44.4 · last audited 2026-10-07 (15d6ce54c)

Coverage

Metric Value
PARITY entries audited 21 (21 ok)
Feature families 7 (7 ok)
Known gaps 1
Deferred items 0
Resource leaks clean
Known gaps
  • ListExplainabilityExports Filters Key ResourceArn is left unapplied: ExplainabilityExportSummary has no ResourceArn and the SDK does not say whether it means the export's ExplainabilityArn or that explainability's ResourceArn.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested Forecast resource is absent.
	ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a Forecast resource name already exists.
	ErrAlreadyExists = awserr.New("ResourceAlreadyExistsException", awserr.ErrConflict)
	// ErrValidation is returned when a Forecast request is invalid.
	ErrValidation = awserr.New("InvalidInputException", awserr.ErrInvalidParameter)
	// ErrInvalidNextToken is returned when a List* NextToken cannot be decoded.
	// Real Amazon Forecast models InvalidNextTokenException on every List operation.
	ErrInvalidNextToken = awserr.New("InvalidNextTokenException", awserr.ErrInvalidParameter)
	// ErrResourceInUse is returned when a Delete* operation targets a resource
	// that is not yet in a deletable state (e.g. still CREATE_PENDING). Real
	// Amazon Forecast models ResourceInUseException on every Delete operation
	// (e.g. "You can delete only predictor that have a status of ACTIVE or
	// CREATE_FAILED", per the DeletePredictor API doc).
	ErrResourceInUse = awserr.New("ResourceInUseException", awserr.ErrConflict)
	// ErrTagLimitExceeded is returned when TagResource would leave a resource
	// with more tags than the documented per-resource maximum (see
	// maxTagsPerResource in tags.go). Documentation-sourced, not SDK-verified.
	ErrTagLimitExceeded = awserr.New("LimitExceededException", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("forecast: nil AppContext")

ErrNilAppContext is returned when Init receives nil context.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Backend *InMemoryBackend
	// contains filtered or unexported fields
}

Handler serves Amazon Forecast JSON protocol operations.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates Forecast HTTP handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns supported fault injection operations.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns regions handled by instance.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns fault injection service identifier.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts operation from Forecast target.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(_ *echo.Context) string

ExtractResource returns no generic resource identifier.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations reports implemented Amazon Forecast operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns Echo handler.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns Forecast header match priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns service registry name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all backend state for the /_gopherstack/reset test hook.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher matches Forecast target requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend. Handler previously had no Snapshot/Restore of its own -- and neither did InMemoryBackend -- so cli.go's generic setupPersistence never picked Forecast up at all: dead wiring, with no persistence underneath it either. This delegation (matching the cleanrooms/codecommit/codepipeline/emr/ workmail pattern) is what wires Forecast into persistence for the first time.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend stores Amazon Forecast state with concurrency-safe transitions.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend returns a stateful Amazon Forecast backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns backend account.

func (*InMemoryBackend) DeleteResourceTree

func (b *InMemoryBackend) DeleteResourceTree(targetARN string) error

DeleteResourceTree deletes a resource and all dependent child resources transitively, mirroring AWS Forecast behavior.

func (*InMemoryBackend) GetAccuracyMetrics

func (b *InMemoryBackend) GetAccuracyMetrics(predictorArn string) (map[string]any, error)

GetAccuracyMetrics returns deterministic backtest accuracy metrics for a predictor, modeled on the AWS Forecast GetAccuracyMetrics response shape (PredictorEvaluationResults -> TestWindows -> Metrics with RMSE, weighted quantile losses, and WAPE/MAPE/MASE error metrics). Values are derived from a stable hash of the predictor ARN so repeated calls return identical numbers, which is what a Terraform/SDK client comparing state expects. This exceeds LocalStack, which returns no evaluation results at all.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)

ListTagsForResource lists tags for a resource. Real Amazon Forecast returns ResourceNotFoundException when resourceARN does not identify an existing resource.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns backend region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory Forecast state. It supports the /_gopherstack/reset test hook so suites start from a clean slate.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) SetCreateDelay

func (b *InMemoryBackend) SetCreateDelay(d time.Duration)

SetCreateDelay keeps new resources in CREATE_PENDING then CREATE_IN_PROGRESS for d before they turn ACTIVE (default 0: ACTIVE on the second Describe).

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error

TagResource adds tags to a resource. Real Amazon Forecast returns ResourceNotFoundException when resourceARN does not identify an existing resource -- TagResource does not silently create tag state for ARNs no resource ever owned.

The limit applies to the resource's resulting tag set, not the incoming request: re-tagging an existing key updates its value without counting as a new tag, so a resource already at 50 tags can still have a tag updated.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error

UntagResource removes tags from a resource. Real Amazon Forecast returns ResourceNotFoundException when resourceARN does not identify an existing resource.

func (*InMemoryBackend) UpdateResourceStatus

func (b *InMemoryBackend) UpdateResourceStatus(resourceARN, newStatus string) error

UpdateResourceStatus handles StopResource and ResumeResource.

type MonitorEvaluation

type MonitorEvaluation struct {
	CreationTime    time.Time `json:"CreationTime"`
	EvaluationTime  time.Time `json:"EvaluationTime"`
	PredictorEvent  any       `json:"PredictorEvent,omitempty"`
	Message         string    `json:"Message,omitempty"`
	MonitorArn      string    `json:"MonitorArn"`
	MonitorName     string    `json:"MonitorName"`
	ResourceArn     string    `json:"ResourceArn,omitempty"`
	Status          string    `json:"Status"`
	EvaluationState string    `json:"EvaluationState"`
	MetricResults   []any     `json:"MetricResults"`
}

MonitorEvaluation represents one completed evaluation emitted by a predictor monitor.

type Provider

type Provider struct{}

Provider initializes Amazon Forecast.

func (*Provider) Init

Init initializes Amazon Forecast backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns provider name.

type Resource

type Resource struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	Data      map[string]any
	ARN       string
	Name      string
	Status    string
	Message   string
	Kind      resourceKind
}

Resource stores one Forecast API object with AWS response-shaped attributes.

Jump to

Keyboard shortcuts

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