Documentation
¶
Index ¶
- Constants
- Variables
- func AttributeValues(code, attr, token string, limit *int32) ([]string, string, error)
- func FileKind(arn, format string) (string, string, string, string, error)
- func Products(code, version, token string, limit *int32, filters []Filter) ([]string, string, error)
- func RenderFile(code, ver, region, kind string) ([]byte, string, bool)
- type Filter
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) ServePriceListFile(c *echo.Context) error
- type PriceListInfo
- type Provider
- type ServiceInfo
Constants ¶
const (
// FilePathPattern is the route that serves price list files.
FilePathPattern = "/_gopherstack/pricing/offers/v1.0/aws/:service/:version/:region/:file"
)
Variables ¶
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 ¶
AttributeValues lists the distinct values of an attribute.
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 ¶
ChaosOperations lists the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions lists the regions this handler serves; Global Accelerator is homed in one region.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name from X-Amz-Target.
func (*Handler) ExtractResource ¶
ExtractResource returns the operation name; the API has no single resource key.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists every routed operation.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches the AWSPriceListService X-Amz-Target prefix.
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 ¶
func (p *Provider) Init(_ *service.AppContext) (service.Registerable, error)
Init builds the handler; the catalog is embedded and stateless.
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.