product

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 16 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 interface {
	Products() ProductsMap
	Resolve(ac *auth.Context, api, path string) []*APIProduct
	Close()
}

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.

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
	// Org is organization
	Org string
	// Env is environment
	Env 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