Help us shape the future of Go! Take the 2026 Go Developer Survey

pricing

package
v1.8.3 Latest Latest
Warning

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

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

README

Pricing

Parity grade: B · SDK aws-sdk-go-v2/service/pricing@v1.49.4 · last audited 2026-10-18 (4ae40e79e)

Coverage

Metric Value
PARITY entries audited 5 (5 ok)
Feature families 2 (1 ok, 1 partial)
Known gaps 4
Deferred items 0
Resource leaks clean
Known gaps
  • Catalog: only five services and six regions; DescribeServices does not list the other ~200 AWS service codes
  • Catalog: prices are illustrative, not the live AWS price feed; there is a single published version (20261001000000)
  • Reserved: only Standard 1yr/3yr No Upfront terms; no partial/all upfront, convertible class or Savings Plans (ComputeSavingsPlans price lists return ResourceNotFoundException)
  • AccessDeniedException, ThrottlingException, InternalErrorException, ExpiredNextTokenException: never raised

More

Documentation

Index

Constants

View Source
const (

	// FilePathPattern is the route that serves price list files.
	FilePathPattern = "/_gopherstack/pricing/offers/v1.0/aws/:service/:version/:region/:file"
)

Variables

View Source
var (
	ErrNotFound         = errors.New("not found")
	ErrResourceNotFound = errors.New("resource not found")
	ErrInvalidParameter = errors.New("invalid parameter")
	ErrInvalidNextToken = errors.New("invalid next token")
)

Sentinels, one per exception in the pinned SDK's error set that this service raises.

Functions

func AttributeValues

func AttributeValues(code, attr, token string, limit *int32) ([]string, string, error)

AttributeValues lists the distinct values of an attribute.

func FileKind

func FileKind(arn, format string) (string, string, string, string, error)

FileKind resolves a price list ARN and file format to a download path suffix.

func Products

func Products(code, version, token string, limit *int32, filters []Filter) ([]string, string, error)

Products returns the PriceList elements matching every filter.

func RenderFile

func RenderFile(code, ver, region, kind string) ([]byte, string, bool)

RenderFile returns the price list file body and its content type; ok is false when it does not exist.

Types

type Filter

type Filter struct {
	Field string `json:"Field"`
	Type  string `json:"Type"`
	Value string `json:"Value"`
}

Filter is a GetProducts filter.

type Handler

type Handler struct{}

Handler serves the Price List awsjson1.1 API.

func NewHandler

func NewHandler() *Handler

NewHandler builds the handler over the embedded catalog.

func (*Handler) ChaosOperations

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

ChaosOperations lists the fault-injectable operations.

func (*Handler) ChaosRegions

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

ChaosRegions lists the regions this handler serves; Global Accelerator is homed in one region.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase service name for fault rules.

func (*Handler) ExtractOperation

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

ExtractOperation returns the operation name from X-Amz-Target.

func (*Handler) ExtractResource

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

ExtractResource returns the operation name; the API has no single resource key.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations lists every routed operation.

func (*Handler) Handler

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

Handler returns the echo handler.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset is a no-op: the catalog is immutable.

func (*Handler) RouteMatcher

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

RouteMatcher matches the AWSPriceListService X-Amz-Target prefix.

func (*Handler) ServePriceListFile

func (h *Handler) ServePriceListFile(c *echo.Context) error

ServePriceListFile serves a price list file at FilePathPattern.

type PriceListInfo

type PriceListInfo struct {
	CurrencyCode string   `json:"CurrencyCode"`
	PriceListArn string   `json:"PriceListArn"`
	RegionCode   string   `json:"RegionCode"`
	FileFormats  []string `json:"FileFormats"`
}

PriceListInfo is one ListPriceLists element.

func PriceLists

func PriceLists(
	code, cur, regionCode string, effective time.Time, token string, limit *int32,
) ([]PriceListInfo, string, error)

PriceLists returns the price lists of a service effective at the given time.

type Provider

type Provider struct{}

Provider implements service.Provider for the AWS Price List API.

func (*Provider) Init

Init builds the handler; the catalog is embedded and stateless.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ServiceInfo

type ServiceInfo struct {
	ServiceCode    string   `json:"ServiceCode"`
	AttributeNames []string `json:"AttributeNames"`
}

ServiceInfo describes one catalog service.

func DescribeServices

func DescribeServices(code, version, token string, limit *int32) ([]ServiceInfo, string, error)

DescribeServices lists catalog services, or the one named by code.

Jump to

Keyboard shortcuts

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