Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteServiceByName ¶
DeleteServiceByName will find any service matching the name, and delete it, including any upstreams that are not referenced by other services.
func SaveUpstream ¶
SaveUpstream will persist an upstream to the database. This will check the database and update the upstream, if it already exists. Upstreams are unique by URL, so if the upstream was added to a different service, saving a change will update all services that shared this backend.
Types ¶
type Service ¶
type Service struct { Name string `json:"name"` Path string `json:"path"` Upstreams []*Upstream `json:"upstreams"` Registered time.Time `json:"registered"` }
Service represents a single registered service with this reverse proxy.
func CreateService ¶
CreateService will create a new (or update an existing) service. If the service already exists, this call will update it with the new name, and append it's own upstream. This could be problematic if two different services register with the same path. The router would send traffic randomly to each.
func ListServices ¶
ListServices returns a list of all available, known services. TODO this should cache and not always hit the disk.