seeker

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInstance added in v0.2.0

type AppInstance struct {
	Host string
	Port int
}

AppInstance has information from the CF API about an application

type AppMeta added in v0.2.0

type AppMeta struct {
	Name string
	GUID string
}

AppMeta has information about the pushed application itself, universal to all its instances

type Output added in v1.1.0

type Output interface {
	ReceiveJSON([]byte) error
}

Output is an output struct that knows how to take json and turn it into the fields of itself

type Seeker

type Seeker struct {
	CF *cfclient.Client
	// contains filtered or unexported fields
}

Seeker has constructs and functions necessary to find app locations in Cloud Foundry

func NewSeeker

func NewSeeker(conf *config.Config) (ret *Seeker, err error)

NewSeeker returns a NewSeeker with a client configured with the information in the given Config object

func (*Seeker) BOSHConfigured added in v0.3.0

func (s *Seeker) BOSHConfigured() bool

BOSHConfigured returns true if the attached configuration has all the keys required to attempt a connection to BOSH. False otherwise.

func (*Seeker) ByGUID

func (s *Seeker) ByGUID(appGUID string) (string, error)

ByGUID checks that the given appGUID is set, returning an error if not, and then passes through the given GUID, dereferenced.

func (*Seeker) ByOrgSpaceAndName

func (s *Seeker) ByOrgSpaceAndName(org, space, app string) (retGUID string, err error)

ByOrgSpaceAndName checks that the given variables are set, erroring if any of them are not, and then looks up the GUID of the app using the CF API.

func (*Seeker) FindInstances added in v0.2.0

func (s *Seeker) FindInstances(guid string, inputErr error) (meta *AppMeta, inst []AppInstance, err error)

FindInstances takes the App GUID given and queries the CF API to get the IP addresses of the VMs and listening ports on which the instances of the application are located and returns those. If inputErr is non-nil, the function will bail early with the given error.

func (*Seeker) GetVMWithIP

func (s *Seeker) GetVMWithIP(ip string) (vm *VMInfo, err error)

GetVMWithIP searches the BOSH director for the VM with the IP you've given An error is returned if a problem is encountered while contacting the BOSH director. If the VM simply could not be found in the configured deployments, no error is returned, but vm will be nil.

func (*Seeker) InvalidateAll added in v0.2.0

func (s *Seeker) InvalidateAll()

InvalidateAll wipes the entire cache

func (*Seeker) SetTTL added in v0.2.0

func (s *Seeker) SetTTL(ttl time.Duration)

SetTTL sets how long (in seconds) before cache entries are wiped.

type VMCache added in v0.2.0

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

VMCache contains the fields needed for caching VM information

type VMInfo

type VMInfo struct {
	JobName        string
	DeploymentName string
	IP             string
	Index          int
}

VMInfo contains information about a VM...

Jump to

Keyboard shortcuts

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