Back to godoc.org

Package rps

v0.0.0-...-e0434a4
Latest Go to latest

The latest major version is .

Published: Jun 30, 2019 | License: Apache-2.0 | Module: github.com/atlassian/voyager

Index

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
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier