Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrServiceNotFound is returned when a key is not found in the register. ErrServiceNotFound = errors.New("service not found") // ErrServiceAlreadyRegistered is returned when trying to set an already registered service. ErrServiceAlreadyRegistered = errors.New("service already registered") // ErrServiceAlreadyInPool is returned when trying to update a pool with the address already there. ErrServiceAlreadyInPool = errors.New("service already in the pool") )
Functions ¶
func GetHTTPRouter ¶
func GetHTTPRouter(register *Register) *httprouter.Router
GetHTTPRouter adds all the necessary http handlers for the register.
Types ¶
type Entry ¶
type Entry struct { Meta `json:"_meta"` ServicePool }
Entry represents, at the moment, the value of a key in a register.
type EntryMap ¶
EntryMap is a key value. Not safe on concurrent access.
type Meta ¶
type Meta struct { Revision int `json:"revision"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Meta stores metadata about an entry in the EntryMap.
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
Register stores and allows manipulation of itself.
func (*Register) MarshalJSON ¶
MarshalJSON returns a custom serialisation of the object to bytes.
type ServicePool ¶
ServicePool stores a pool of services.
func (*ServicePool) MarshalJSON ¶
func (sp *ServicePool) MarshalJSON() ([]byte, error)
MarshalJSON returns a custom serialisation of the object to bytes.
Click to show internal directories.
Click to hide internal directories.