Documentation ¶
Index ¶
- type Config
- type EventsChannel
- type MockRegistryAdapter
- func (_m *MockRegistryAdapter) AdvertiseAddr() (string, error)
- func (_m *MockRegistryAdapter) Deregister(group *ServiceGroup) error
- func (_m *MockRegistryAdapter) EXPECT() *_MockRegistryAdapterRecorder
- func (_m *MockRegistryAdapter) Ping() error
- func (_m *MockRegistryAdapter) Register(group *ServiceGroup) error
- func (_m *MockRegistryAdapter) Services() ([]*ServiceGroup, error)
- type MockSchedulerAdapter
- type RegistryAdapter
- type SchedulerAdapter
- type Service
- type ServiceAction
- type ServiceEvent
- type ServiceGroup
- type ServiceHealthCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventsChannel ¶
type EventsChannel chan *ServiceEvent
EventsChannel is a channel to receive events upon.
type MockRegistryAdapter ¶
type MockRegistryAdapter struct {
// contains filtered or unexported fields
}
Mock of RegistryAdapter interface
func NewMockRegistryAdapter ¶
func NewMockRegistryAdapter(ctrl *gomock.Controller) *MockRegistryAdapter
func (*MockRegistryAdapter) AdvertiseAddr ¶
func (_m *MockRegistryAdapter) AdvertiseAddr() (string, error)
func (*MockRegistryAdapter) Deregister ¶
func (_m *MockRegistryAdapter) Deregister(group *ServiceGroup) error
func (*MockRegistryAdapter) EXPECT ¶
func (_m *MockRegistryAdapter) EXPECT() *_MockRegistryAdapterRecorder
func (*MockRegistryAdapter) Ping ¶
func (_m *MockRegistryAdapter) Ping() error
func (*MockRegistryAdapter) Register ¶
func (_m *MockRegistryAdapter) Register(group *ServiceGroup) error
func (*MockRegistryAdapter) Services ¶
func (_m *MockRegistryAdapter) Services() ([]*ServiceGroup, error)
type MockSchedulerAdapter ¶
type MockSchedulerAdapter struct {
// contains filtered or unexported fields
}
Mock of SchedulerAdapter interface
func NewMockSchedulerAdapter ¶
func NewMockSchedulerAdapter(ctrl *gomock.Controller) *MockSchedulerAdapter
func (*MockSchedulerAdapter) EXPECT ¶
func (_m *MockSchedulerAdapter) EXPECT() *_MockSchedulerAdapterRecorder
func (*MockSchedulerAdapter) ListenForEvents ¶
func (_m *MockSchedulerAdapter) ListenForEvents(channel EventsChannel) error
func (*MockSchedulerAdapter) Services ¶
func (_m *MockSchedulerAdapter) Services() ([]*ServiceGroup, error)
type RegistryAdapter ¶
type RegistryAdapter interface { Services() ([]*ServiceGroup, error) Ping() error Register(group *ServiceGroup) error Deregister(group *ServiceGroup) error AdvertiseAddr() (string, error) }
type SchedulerAdapter ¶
type SchedulerAdapter interface { Services() ([]*ServiceGroup, error) ListenForEvents(channel EventsChannel) error }
type Service ¶
type Service struct { ID string Name string Tags []string Healthy bool OriginalPort int ExposedPort int }
Service represents a single entry in the service registry.
type ServiceAction ¶
type ServiceAction int
const ( // ServiceUnchanged denotes unchanged service status ServiceUnchanged ServiceAction = 1 << iota // ServiceWentUp denotes service availability ServiceWentUp // ServiceWentDown denotes service unavailability ServiceWentDown // ServiceStarted denotes added service instance ServiceStarted // ServiceStopped denotes removed service instance ServiceStopped )
func (ServiceAction) String ¶
func (action ServiceAction) String() string
type ServiceEvent ¶
type ServiceEvent struct { ServiceID string IP string Action ServiceAction OriginalEvent interface{} }
ServiceEvent is the definition for an event occurred to Service in scheduler.
func (*ServiceEvent) String ¶
func (event *ServiceEvent) String() string
type ServiceGroup ¶
type ServiceGroup struct { ID string IP string Services []*Service HealthChecks []*ServiceHealthCheck }
ServiceGroup represents the collection of services which expose multiple ports. Most of the time it will hold the single Service instance, but if the service exposes multiple ports, it will contain multiple services named by appending exposed port number to them, i.e. foo-service-3000, foo-service-4001, etc.
func (*ServiceGroup) ServiceKey ¶
func (group *ServiceGroup) ServiceKey(service *Service) string
Click to show internal directories.
Click to hide internal directories.