product

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 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"`
	OperationGroup   *OperationGroup `json:"operationGroup,omitempty"`
	Proxies          []string        `json:"proxies"`
	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) UnmarshalJSON added in v1.3.0

func (p *APIProduct) UnmarshalJSON(data []byte) error

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 AuthorizedOperation added in v1.3.0

type AuthorizedOperation struct {
	ID            string
	QuotaLimit    int64
	QuotaInterval int64
	QuotaTimeUnit string
}

AuthorizedOperation is the result of Authorize including Quotas

type Manager

type Manager interface {
	Products() ProductsNameMap
	Authorize(authContext *auth.Context, api, path, method string) []AuthorizedOperation
	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 Operation added in v1.3.0

type Operation struct {
	Methods  []string `json:"methods"`
	Resource string   `json:"resource"`
}

An Operation represents methods on a Resource

type OperationConfig added in v1.3.0

type OperationConfig struct {
	APISource  string      `json:"apiSource"`
	Attributes []Attribute `json:"attributes,omitempty"`
	Operations []Operation `json:"operations"`
	Quota      *Quota      `json:"quota"`
	// contains filtered or unexported fields
}

An OperationConfig is a group of Operations

func (*OperationConfig) UnmarshalJSON added in v1.3.0

func (oc *OperationConfig) UnmarshalJSON(data []byte) error

type OperationGroup added in v1.3.0

type OperationGroup struct {
	OperationConfigType string            `json:"operationConfigType"`
	OperationConfigs    []OperationConfig `json:"operationConfigs,omitempty"`
}

An OperationGroup holds OperationConfigs

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 ProductsNameMap added in v1.3.0

type ProductsNameMap map[string]*APIProduct

ProductsNameMap is a map of API Product name to API Product

type Quota added in v1.3.0

type Quota struct {
	Interval    string `json:"interval,omitempty"`
	Limit       string `json:"limit,omitempty"`
	TimeUnit    string `json:"timeUnit,omitempty"`
	IntervalInt int64
	LimitInt    int64
}

A Quota is attached to an OperationConfig

func (*Quota) UnmarshalJSON added in v1.3.0

func (q *Quota) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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