product

package
v0.0.3-dev Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const TargetsAttr = "apigee-remote-service-targets"

TargetsAttr is the name of the Product attribute that lists the targets it binds to (comma delim)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIProduct

type APIProduct struct {
	Attributes []Attribute `json:"attributes,omitempty"`
	// CreatedAt        int64       `json:"createdAt,omitempty"`
	CreatedBy    string   `json:"createdBy,omitempty"`
	Description  string   `json:"description,omitempty"`
	DisplayName  string   `json:"displayName,omitempty"`
	Environments []string `json:"environments,omitempty"`
	// LastModifiedAt   int64       `json:"lastModifiedAt,omitempty"`
	LastModifiedBy   string   `json:"lastModifiedBy,omitempty"`
	Name             string   `json:"name,omitempty"`
	QuotaLimit       string   `json:"quota,omitempty"`
	QuotaInterval    string   `json:"quotaInterval,omitempty"`
	QuotaTimeUnit    string   `json:"quotaTimeUnit,omitempty"`
	Resources        []string `json:"apiResources"`
	Scopes           []string `json:"scopes"`
	Targets          []string
	QuotaLimitInt    int64
	QuotaIntervalInt int64
	// contains filtered or unexported fields
}

An APIProduct is an Apigee API product. See the Apigee docs for details: https://docs.apigee.com/api-platform/publish/what-api-product

func (*APIProduct) GetBoundTargets

func (p *APIProduct) GetBoundTargets() []string

GetBoundTargets returns an array of target names bound to this product

func (*APIProduct) GetTargetsAttribute

func (p *APIProduct) GetTargetsAttribute() *Attribute

GetTargetsAttribute returns a pointer to the target attribute or nil

type APIResponse

type APIResponse struct {
	APIProducts []APIProduct `json:"apiProduct"`
}

APIResponse is the response from the Apigee products API

type Attribute

type Attribute struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

An Attribute is a name-value-pair attribute of an API product.

type Manager

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

A Manager wraps all things related to a set of API products.

func NewManager

func NewManager(options Options) (*Manager, error)

NewManager creates a new product.Manager. Call Close() when done.

func (*Manager) Close

func (p *Manager) Close()

Close shuts down the manager.

func (*Manager) Products

func (p *Manager) Products() ProductsMap

Products atomically gets a mapping of name => APIProduct.

func (*Manager) Resolve

func (p *Manager) Resolve(ac *auth.Context, api, path string) []*APIProduct

Resolve determines the valid products for a given API.

type Options

type Options struct {
	// Client is a configured HTTPClient
	Client *http.Client
	// BaseURL of the Apigee runtime service proxy
	BaseURL *url.URL
	// RefreshRate determines how often the products are refreshed
	RefreshRate time.Duration
	// Key is provisioning key
	Key string
	// Secret is provisioning secret
	Secret string
}

Options allows us to specify options for how this product manager will run.

type ProductsMap

type ProductsMap map[string]*APIProduct

ProductsMap is a map of API Product name to API Product

Jump to

Keyboard shortcuts

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