Documentation ¶
Overview ¶
core centralizes the commonly used interfaces and structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backender ¶
type Backender interface { Init() error // services GetServices() ([]Service, error) GetService(id string) (*Service, error) SetServices(services []Service) error SetService(service *Service) error DeleteService(id string) error // servers SetServers(svcId string, servers []Server) error SetServer(svcId string, server *Server) error DeleteServer(svcId, srvId string) error GetServer(svcId, srvId string) (*Server, error) }
type CertBundle ¶
type Proxyable ¶
type Proxyable interface { // routes SetRoute(route Route) error SetRoutes(routes []Route) error DeleteRoute(route Route) error GetRoutes() ([]Route, error) // certs SetCerts(certs []CertBundle) error SetCert(cert CertBundle) error DeleteCert(cert CertBundle) error GetCerts() ([]CertBundle, error) }
type Route ¶
type Route struct { // defines match characteristics SubDomain string `json:"subdomain"` // subdomain to match on - "admin" Domain string `json:"domain"` // domain to match on - "myapp.com" Path string `json:"path"` // route to match on - "/admin" // defines actions Targets []string `json:"targets"` // ips of servers - ["http://127.0.0.1:8080/app1","http://127.0.0.2"] (optional) FwdPath string `json:"fwdpath"` // path to forward to targets - "/goadmin" incoming req: test.com/admin -> 127.0.0.1/goadmin (optional) Page string `json:"page"` // page to serve instead of routing to targets - "<HTML>We are fixing it</HTML>" (optional) }
type Server ¶
type Server struct { // todo: change "Id" to "name" (for clarity) Id string `json:"id,omitempty"` Host string `json:"host"` Port int `json:"port"` Forwarder string `json:"forwarder"` Weight int `json:"weight"` UpperThreshold int `json:"upper_threshold"` LowerThreshold int `json:"lower_threshold"` }
type Service ¶
type Service struct { Id string `json:"id,omitempty"` Host string `json:"host"` Interface string `json:"interface,omitempty"` Port int `json:"port"` Type string `json:"type"` Scheduler string `json:"scheduler"` Persistence int `json:"persistence"` Netmask string `json:"netmask"` Servers []Server `json:"servers,omitempty"` }
Directories ¶
Path | Synopsis |
---|---|
common contains all the logic to perform an action, as well as roll back other "systems" upon failure, effectively "undoing" the action.
|
common contains all the logic to perform an action, as well as roll back other "systems" upon failure, effectively "undoing" the action. |
Click to show internal directories.
Click to hide internal directories.