product

package
v0.0.0-...-dcd54df Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ServicesAttr = "istio-services"

ServicesAttr is the name of the Product attribute that lists the Istio services 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) GetBoundServices

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

GetBoundServices returns an array of service names bound to this product

func (*APIProduct) GetServicesAttribute

func (p *APIProduct) GetServicesAttribute() *Attribute

GetServicesAttribute returns a pointer the services 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(env adapter.Env, 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 customer 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