Documentation ¶
Index ¶
- Constants
- func NewReconciler(db Database, cf API, olderThan time.Duration) recon.Reconciler
- type API
- type App
- type AppInfo
- type CF
- type CFInfo
- type CFLogin
- type CfCli
- type Database
- type Instance
- type Instances
- type MongoLogin
- type Org
- type OrgInfo
- type Provider
- type Route
- type Routes
- type Space
- type SpaceInfo
Constants ¶
View Source
const ( ReconcileOrganizations recon.Type = "organizations" ReconcileSpaces recon.Type = "spaces" ReconcileApps recon.Type = "apps" )
View Source
const CFGuid = "main"
Variables ¶
This section is empty.
Functions ¶
func NewReconciler ¶
NewReconciler fetches new reconciliation work from the database and updates the corresponding item via the CloudFoundry API.
It returns true, if there was work to be done and false, if there was no open reconciliation work.
Types ¶
type API ¶
type API interface { ListOrgs() ([]Org, error) ListSpaces(orgGuid string) ([]Space, error) ListApps(spaceGuid string) ([]App, error) GetRoutes(appId string) (Routes, error) GetInstances(appId string) (Instances, error) }
API is an abstraction around the CloudFoundry functionality.
func NewDefaultApi ¶
type CfCli ¶
type CfCli interface { ListOrgs() ([]cf.Org, error) GetOrgByGuid(guid string) (cf.Org, error) GetSpaceByGuid(guid string) (cf.Space, error) ListSpacesByOrgGuid(orgGuid string) ([]cf.Space, error) ListAppsBySpaceGuid(spaceGuid string) ([]cf.App, error) GetAppRoutes(appGuid string) ([]cf.Route, error) GetAppInstances(guid string) (map[string]cf.AppInstance, error) }
CfCli is a wrapper interface for the official cloudfoundry client extracting the needed functions.
type Database ¶
type Database interface { AcceptReconcileJob(olderThan time.Duration) (reconciliation.Job, bool) UpsertOrgs(cfGuid string, orgs []Org) error UpsertOrgSpaces(orgGuid string, spaces []Space) error UpsertSpaceApps(spaceGuid string, apps []App) error DeleteOrg(guid string) (bool, error) DeleteSpace(guid string) (bool, error) DeleteApp(guid string) (bool, error) ListApps() ([]App, error) GetApp(id string) (App, error) Cached(id string, duration time.Duration, cached interface{}, f func() (interface{}, error)) (interface{}, error) }
func NewMongoDatabase ¶
func NewMongoDatabase(l MongoLogin) (Database, error)
type MongoLogin ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func (*Provider) GetAppInstances ¶
func (p *Provider) GetAppInstances(id string) (sdk.AppInstances, error)
func (*Provider) GetAppRouting ¶
func (p *Provider) GetAppRouting(id string) (sdk.AppRouting, error)
Click to show internal directories.
Click to hide internal directories.