Documentation ¶
Index ¶
- type BackendPool
- type BackendServices
- type Backends
- func (b *Backends) Add(port int64) error
- func (b *Backends) Delete(port int64) (err error)
- func (b *Backends) GC(svcNodePorts []int64) error
- func (b *Backends) Get(port int64) (*compute.BackendService, error)
- func (b *Backends) List() ([]interface{}, error)
- func (b *Backends) Shutdown() error
- func (b *Backends) Status(name string) string
- func (b *Backends) Sync(svcNodePorts []int64) error
- type FakeBackendServices
- func (f *FakeBackendServices) CreateBackendService(be *compute.BackendService) error
- func (f *FakeBackendServices) DeleteBackendService(name string) error
- func (f *FakeBackendServices) GetBackendService(name string) (*compute.BackendService, error)
- func (f *FakeBackendServices) GetHealth(name, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
- func (f *FakeBackendServices) ListBackendServices() (*compute.BackendServiceList, error)
- func (f *FakeBackendServices) UpdateBackendService(be *compute.BackendService) error
- type FakeHealthChecks
- type HealthChecker
- type SingleHealthCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendPool ¶
type BackendPool interface { Add(port int64) error Get(port int64) (*compute.BackendService, error) Delete(port int64) error Sync(ports []int64) error GC(ports []int64) error Shutdown() error Status(name string) string List() ([]interface{}, error) }
BackendPool is an interface to manage a pool of kubernetes nodePort services as gce backendServices, and sync them through the BackendServices interface.
type BackendServices ¶
type BackendServices interface { GetBackendService(name string) (*compute.BackendService, error) UpdateBackendService(bg *compute.BackendService) error CreateBackendService(bg *compute.BackendService) error DeleteBackendService(name string) error ListBackendServices() (*compute.BackendServiceList, error) GetHealth(name, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error) }
BackendServices is an interface for managing gce backend services.
type Backends ¶
type Backends struct {
// contains filtered or unexported fields
}
Backends implements BackendPool.
func NewBackendPool ¶
func NewBackendPool( cloud BackendServices, healthChecker healthchecks.HealthChecker, nodePool instances.NodePool, namer utils.Namer, ignorePorts []int64, resyncWithCloud bool) *Backends
NewBackendPool returns a new backend pool. - cloud: implements BackendServices and syncs backends with a cloud provider - healthChecker: is capable of producing health checks for backends. - nodePool: implements NodePool, used to create/delete new instance groups. - namer: procudes names for backends. - ignorePorts: is a set of ports to avoid syncing/GCing. - resyncWithCloud: if true, periodically syncs with cloud resources.
func (*Backends) Get ¶
func (b *Backends) Get(port int64) (*compute.BackendService, error)
Get returns a single backend.
func (*Backends) Shutdown ¶
Shutdown deletes all backends and the default backend. This will fail if one of the backends is being used by another resource.
type FakeBackendServices ¶
type FakeBackendServices struct {
// contains filtered or unexported fields
}
FakeBackendServices fakes out GCE backend services.
func NewFakeBackendServices ¶
func NewFakeBackendServices() *FakeBackendServices
NewFakeBackendServices creates a new fake backend services manager.
func (*FakeBackendServices) CreateBackendService ¶
func (f *FakeBackendServices) CreateBackendService(be *compute.BackendService) error
CreateBackendService fakes backend service creation.
func (*FakeBackendServices) DeleteBackendService ¶
func (f *FakeBackendServices) DeleteBackendService(name string) error
DeleteBackendService fakes backend service deletion.
func (*FakeBackendServices) GetBackendService ¶
func (f *FakeBackendServices) GetBackendService(name string) (*compute.BackendService, error)
GetBackendService fakes getting a backend service from the cloud.
func (*FakeBackendServices) GetHealth ¶
func (f *FakeBackendServices) GetHealth(name, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
GetHealth fakes getting backend service health.
func (*FakeBackendServices) ListBackendServices ¶
func (f *FakeBackendServices) ListBackendServices() (*compute.BackendServiceList, error)
ListBackendServices fakes backend service listing.
func (*FakeBackendServices) UpdateBackendService ¶
func (f *FakeBackendServices) UpdateBackendService(be *compute.BackendService) error
UpdateBackendService fakes updating a backend service.
type FakeHealthChecks ¶
type FakeHealthChecks struct {
// contains filtered or unexported fields
}
FakeHealthChecks fakes out health checks.
func NewFakeHealthChecks ¶
func NewFakeHealthChecks() *FakeHealthChecks
NewFakeHealthChecks returns a health check fake.
func (*FakeHealthChecks) CreateHttpHealthCheck ¶
func (f *FakeHealthChecks) CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error
CreateHttpHealthCheck fakes health check creation.
func (*FakeHealthChecks) DeleteHttpHealthCheck ¶
func (f *FakeHealthChecks) DeleteHttpHealthCheck(name string) error
DeleteHttpHealthCheck fakes deleting a http health check.
func (*FakeHealthChecks) GetHttpHealthCheck ¶
func (f *FakeHealthChecks) GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error)
GetHttpHealthCheck fakes getting a http health check.
type HealthChecker ¶
type HealthChecker interface { Add(port int64, path string) error Delete(port int64) error Get(port int64) (*compute.HttpHealthCheck, error) }
HealthChecker is an interface to manage cloud HTTPHealthChecks.
type SingleHealthCheck ¶
type SingleHealthCheck interface { CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error DeleteHttpHealthCheck(name string) error GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error) }
SingleHealthCheck is an interface to manage a single GCE health check.