Documentation ¶
Index ¶
- Constants
- Variables
- func NewFakeZoneGetter() *fakeZoneGetter
- type FakeNetworkEndpointGroupCloud
- func (f *FakeNetworkEndpointGroupCloud) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error)
- func (f *FakeNetworkEndpointGroupCloud) AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
- func (f *FakeNetworkEndpointGroupCloud) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error
- func (f *FakeNetworkEndpointGroupCloud) DeleteNetworkEndpointGroup(name string, zone string) error
- func (f *FakeNetworkEndpointGroupCloud) DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
- func (f *FakeNetworkEndpointGroupCloud) GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error)
- func (f *FakeNetworkEndpointGroupCloud) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error)
- func (f *FakeNetworkEndpointGroupCloud) ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error)
- func (f *FakeNetworkEndpointGroupCloud) NetworkURL() string
- func (f *FakeNetworkEndpointGroupCloud) SubnetworkURL() string
- type NegStatus
- type NegSyncer
- type NegSyncerManager
- type NetworkEndpointGroupCloud
- type NetworkEndpointGroupNamer
- type PortNameMap
- type ZoneGetter
Constants ¶
View Source
const ( TestZone1 = "zone1" TestZone2 = "zone2" TestInstance1 = "instance1" TestInstance2 = "instance2" TestInstance3 = "instance3" TestInstance4 = "instance4" )
Variables ¶
View Source
var NotFoundError = fmt.Errorf("Not Found")
Functions ¶
func NewFakeZoneGetter ¶
func NewFakeZoneGetter() *fakeZoneGetter
Types ¶
type FakeNetworkEndpointGroupCloud ¶
type FakeNetworkEndpointGroupCloud struct { NetworkEndpointGroups map[string][]*computebeta.NetworkEndpointGroup NetworkEndpoints map[string][]*computebeta.NetworkEndpoint Subnetwork string Network string // contains filtered or unexported fields }
func (*FakeNetworkEndpointGroupCloud) AggregatedListNetworkEndpointGroup ¶
func (f *FakeNetworkEndpointGroupCloud) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error)
func (*FakeNetworkEndpointGroupCloud) AttachNetworkEndpoints ¶
func (f *FakeNetworkEndpointGroupCloud) AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
func (*FakeNetworkEndpointGroupCloud) CreateNetworkEndpointGroup ¶
func (f *FakeNetworkEndpointGroupCloud) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error
func (*FakeNetworkEndpointGroupCloud) DeleteNetworkEndpointGroup ¶
func (f *FakeNetworkEndpointGroupCloud) DeleteNetworkEndpointGroup(name string, zone string) error
func (*FakeNetworkEndpointGroupCloud) DetachNetworkEndpoints ¶
func (f *FakeNetworkEndpointGroupCloud) DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
func (*FakeNetworkEndpointGroupCloud) GetNetworkEndpointGroup ¶
func (f *FakeNetworkEndpointGroupCloud) GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error)
func (*FakeNetworkEndpointGroupCloud) ListNetworkEndpointGroup ¶
func (f *FakeNetworkEndpointGroupCloud) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error)
func (*FakeNetworkEndpointGroupCloud) ListNetworkEndpoints ¶
func (f *FakeNetworkEndpointGroupCloud) ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error)
func (*FakeNetworkEndpointGroupCloud) NetworkURL ¶
func (f *FakeNetworkEndpointGroupCloud) NetworkURL() string
func (*FakeNetworkEndpointGroupCloud) SubnetworkURL ¶
func (f *FakeNetworkEndpointGroupCloud) SubnetworkURL() string
type NegStatus ¶
type NegStatus struct { // NetworkEndpointGroups returns the mapping between service port and NEG // resource. key is service port, value is the name of the NEG resource. NetworkEndpointGroups PortNameMap `json:"network_endpoint_groups,omitempty"` Zones []string `json:"zones,omitempty"` }
NegStatus contains name and zone of the Network Endpoint Group resources associated with this service
type NegSyncer ¶
type NegSyncer interface { // Start starts the syncer. This call is synchronous. It will return after syncer is started. Start() error // Stop stops the syncer. This call is asynchronous. It will not block until syncer is stopped. Stop() // Sync signals the syncer to sync NEG. This call is asynchronous. Syncer will sync once it becomes idle. Sync() bool // IsStopped returns true if syncer is stopped IsStopped() bool // IsShuttingDown returns true if syncer is shutting down IsShuttingDown() bool }
NegSyncer is an interface to interact with syncer
type NegSyncerManager ¶
type NegSyncerManager interface { // EnsureSyncer ensures corresponding syncers are started and stops any unnecessary syncer // portMap is a map of ServicePort Port to TargetPort EnsureSyncers(namespace, name string, portMap PortNameMap) error // StopSyncer stops all syncers related to the service. This call is asynchronous. It will not wait for all syncers to stop. StopSyncer(namespace, name string) // Sync signals all syncers related to the service to sync. This call is asynchronous. Sync(namespace, name string) // GC garbage collects network endpoint group and syncers GC() error // ShutDown shuts down the manager ShutDown() }
NegSyncerManager is an interface for controllers to manage syncer
type NetworkEndpointGroupCloud ¶
type NetworkEndpointGroupCloud interface { GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error DeleteNetworkEndpointGroup(name string, zone string) error AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error) NetworkURL() string SubnetworkURL() string }
NetworkEndpointGroupCloud is an interface for managing gce network endpoint group.
func NewFakeNetworkEndpointGroupCloud ¶
func NewFakeNetworkEndpointGroupCloud(subnetwork, network string) NetworkEndpointGroupCloud
type NetworkEndpointGroupNamer ¶
type NetworkEndpointGroupNamer interface { NEG(namespace, name string, port int32) string IsNEG(name string) bool }
NetworkEndpointGroupNamer is an interface for generating network endpoint group name.
type PortNameMap ¶
PortNameMap is a map of ServicePort:TargetPort.
func (PortNameMap) Difference ¶
func (p1 PortNameMap) Difference(p2 PortNameMap) PortNameMap
Difference returns the set of Port:TargetPorts in p2 that aren't present in p1
func (PortNameMap) Union ¶
func (p1 PortNameMap) Union(p2 PortNameMap) PortNameMap
Union returns the union of the Port:TargetPort mappings
Click to show internal directories.
Click to hide internal directories.