rps

package
v0.0.0-...-e0434a4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache caches its single 'list' operation indefinitely. The theory is that we only look up instances that should be migrated, and since we 'restart' svccatadmission frequently we should never be too out of date. Also, we're unlikely to ever care about resources created in the last few days, because there won't be anything meaningful to migrate (i.e. users won't want to move them), and the failure mode is simply a rejection. We could have a smarter cache that remembers the time (but, more complexity we don't need?) or retry if unknown UUID (but most likely scenario is a _bad_ UUID, which could lead to the user hammering the Dynamo table and exhausting the RCU, which is what we want to avoid).

func NewRPSCache

func NewRPSCache(logger *zap.Logger, client Client) *Cache

func (*Cache) GetServiceFor

func (r *Cache) GetServiceFor(ctx context.Context, instanceID string) (voyager.ServiceName, error)

type Client

type Client interface {
	ListOSBResources(ctx context.Context) ([]OSBResource, error)
}

type ClientImpl

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

func NewRPSClient

func NewRPSClient(logger *zap.Logger, httpClient *http.Client, asap pkiutil.ASAP, baseURL *url.URL) *ClientImpl

func (*ClientImpl) ListOSBResources

func (c *ClientImpl) ListOSBResources(ctx context.Context) ([]OSBResource, error)

type OSBResource

type OSBResource struct {
	ServiceID  voyager.ServiceName `json:"serviceId"`
	InstanceID string              `json:"instanceId"`
}

type ServiceMetadata

type ServiceMetadata struct {
	Name         string
	BusinessUnit string
	Owner        string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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