Documentation
¶
Overview ¶
Package router is the main router and provides the main HTTP entry point for Platform.CC.
Index ¶
- Variables
- func AddProjectRoutes(p *project.Project) error
- func ClearCertificates() error
- func DeleteProjectRoutes(p *project.Project) error
- func DumpCertificateCA() ([]byte, error)
- func GenerateNginxConfig(proj *project.Project) ([]byte, error)
- func GenerateRouteListJSON(proj *project.Project) ([]byte, error)
- func GenerateTemplateVars(proj *project.Project) ([]map[string]interface{}, error)
- func GetContainerConfig() container.Config
- func GetUpstreamHost(proj *project.Project, upstream string, allowServices bool) (string, error)
- func ListActiveProjects() ([]string, error)
- func ListActiveRoutes() ([]def.Route, error)
- func Reload() error
- func Start() error
- func Stop() error
- type HostRoute
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUpstreamNotFound is an error returned when a route upstream is not found. ErrUpstreamNotFound = errors.New("upstream not found") )
var HTTPPort = uint16(80)
HTTPPort is the port to accept HTTP requests on.
var HTTPSPort = uint16(443)
HTTPSPort is the port to accept HTTPS requests on.
Functions ¶
func AddProjectRoutes ¶
AddProjectRoutes adds given project's routes to router.
func ClearCertificates ¶
func ClearCertificates() error
ClearCertificates deletes all certificates files generates by minica.
func DeleteProjectRoutes ¶
DeleteProjectRoutes deletes routes for given project.
func DumpCertificateCA ¶
DumpCertificateCA returns the CA certificate.
func GenerateNginxConfig ¶
GenerateNginxConfig creates nginx configuration for given application.
func GenerateRouteListJSON ¶
GenerateRouteListJSON creates a list of routes for project as JSON.
func GenerateTemplateVars ¶
GenerateTemplateVars generates variables to inject in nginx template.
func GetContainerConfig ¶
GetContainerConfig gets container configuration for the router.
func GetUpstreamHost ¶
GetUpstreamHost retrieves upstream hostname from upstream value in route.
func ListActiveProjects ¶
ListActiveProjects returns list of project ids of projects current loaded in to the router.
func ListActiveRoutes ¶
ListActiveRoutes returns list of routes currently active in the router.
Types ¶
type HostRoute ¶
HostRoute contains all routes mapped to a host.
func MapHostRoutes ¶
MapHostRoutes maps all routes to their hosts.