Documentation ¶
Index ¶
Constants ¶
View Source
const (
E_BAD_REQUEST string = "bad_request"
)
View Source
const SERVICES_PREFIX string = "services_"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendInfo ¶
type BackendInfo struct { Address string `json:"address"` Disabled bool `json:"disabled"` HeartBeatAddress string `json:"heart_beat_address"` HeartBeatTimeout int `json:"heart_beat_timeout"` }
Backend holds information about a backend.
type Client ¶
type Client interface { // Ping pings the ApiHub server. // // Errors: // * Error - indicates the ApiHub API server is in a bad state. Ping() error // AddService adds a new service. // // Errors: // * When the host is already taken. AddService(ServiceSpec) (Service, error) // RemoveService removes an existing service. // // Errors: // * When the host is not found. RemoveService(host string) error // Services lists all services. // // Errors: // * None. Services() ([]Service, error) // FindService returns the service with the specified host. // // Errors: // * Service not found. FindService(host string) (Service, error) // UpdateService updates the service with the specified host. // // Errors: // * Service not found. UpdateService(string, ServiceSpec) (Service, error) }
type ErrorResponse ¶
type Service ¶
type Service interface { // Host returns the subdomain/host used to access a service. Host() string // Start adds a service in the service pool to host upcoming requests. Start() error // Stop stops proxying the requests. Stop() error // Info returns information about a service. Info() (ServiceSpec, error) // Backends returns all backends in the service. Backends() ([]BackendInfo, error) // Timeout waits for the duration before returning an error to the client. SetTimeout(time.Duration) error }
type ServicePublisher ¶
type ServiceSpec ¶
type ServiceSpec struct { // Host specifies the subdomain/host used to access the service. Host string `json:"host"` Disabled bool `json:"disabled"` Timeout time.Duration `json:"timeout"` // in milliseconds Backends []BackendInfo `json:"backends,omitempty"` }
ServiceInfo holds information about a service.
type ServiceSubscriber ¶
type ServiceSubscriber interface {
Subscribe(logger lager.Logger, prefix string, servicesCh chan ServiceSpec, stop <-chan struct{}) error
}
type Storage ¶
type Storage interface { AddService(ServiceSpec) error UpdateService(ServiceSpec) error FindServiceByHost(string) (ServiceSpec, error) Services() ([]ServiceSpec, error) RemoveService(string) error }
Storage is an interface for "storage".
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
connection/connectionfakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
cmd
|
|
gatewayfakes
This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter |
integration
|
|
package storage provides in memory storage implementation, for test purposes.
|
package storage provides in memory storage implementation, for test purposes. |
Click to show internal directories.
Click to hide internal directories.