Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Services []Service `yaml:"services"` // Name of the strategy to be used in load balancing between instances Strategy string `yaml:"strategy"` }
Config is a representation of the configuration given to farely from a config source.
type Server ¶
type Server struct { Url *url.URL Proxy *httputil.ReverseProxy Metadata map[string]string // contains filtered or unexported fields }
Server is an instance of a running server
func (*Server) GetMetaOrDefault ¶
GetMetaOrDefault returns the value associated with the given key in the metadata, or returns the default
func (*Server) GetMetaOrDefaultInt ¶
GetMetaOrDefaultInt returns the int value associated with the given key in the metadata, or returns the default
func (*Server) SetLiveness ¶
SetLiveness will change the current alive field value, and return the old value.
type Service ¶
type Service struct { Name string `yaml:"name"` // A prefix matcher to select service based on the path part of the url // Note(self): The matcher could be more sophisticated (i.e Regex based, // subdomain based), but for the purposes of simplicity let's think about this // later, and it could be a nice contribution to the project. Matcher string `yaml:"matcher"` // Strategy is the load balancing strategy used for this service. Strategy string `yaml:"strategy"` Replicas []Replica `yaml:"replicas"` }
Click to show internal directories.
Click to hide internal directories.