Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureResolver(domains []string, port int) error
- func GeneratePort() int
- func InstallIntoSystem(listenPort, tlsPort int, dir, domains, timeout string) error
- func NewCertCache() *certCache
- func Setup() error
- func SetupOurCert() error
- func Stop() error
- func TrustCert(cert string) error
- func Uninstall(domains []string)
- type App
- type AppPool
- type DNSResponder
- type Events
- type HTTPServer
Constants ¶
View Source
const ( // Booting is the thread that will boot Booting = iota // Running are the threads that are running Running // Dead are any dead threads Dead )
View Source
const DefaultAddress = ":9253"
View Source
const DefaultThreads = 5
DefaultThreads specifies the amount of threads that will be consumed by default
Variables ¶
View Source
var CACert *tls.Certificate
View Source
var ErrUnexpectedExit = errors.New("unexpected exit")
ErrUnexpectedExit is the error thrown when the app crashes during a request
View Source
var ErrUnknownApp = errors.New("unknown app")
ErrUnknownApp is thrown when an application cannot be found in config
Functions ¶
func ConfigureResolver ¶
func GeneratePort ¶
func GeneratePort() int
GeneratePort outputs a random port number in the range of 3001-3999 that will be passed as $PORT to the `docker-compose` process for a given application.
func InstallIntoSystem ¶
func NewCertCache ¶
func NewCertCache() *certCache
func SetupOurCert ¶
func SetupOurCert() error
Types ¶
type App ¶
type App struct { Name string Scheme string Host string Port int Command *exec.Cmd Public bool Events *Events // contains filtered or unexported fields }
App represents a running `docker-compose` project
func (*App) SetAddress ¶
SetAddress configures the URL that the app is running on
func (*App) WaitTilReady ¶
WaitTilReady listens on the App's `readyChan` for the app to come up and returns when it can serve requests.
type AppPool ¶
type AppPool struct { Dir string IdleTime time.Duration Debug bool Events *Events AppClosed func(*App) // contains filtered or unexported fields }
AppPool is the collection of Apps that docker-dev controls
type DNSResponder ¶
type DNSResponder struct {
Address string
}
func (*DNSResponder) Serve ¶
func (d *DNSResponder) Serve(domains []string) error
type HTTPServer ¶
type HTTPServer struct { Address string TLSAddress string Pool *AppPool Debug bool Events *Events // contains filtered or unexported fields }
func (*HTTPServer) AppClosed ¶
func (h *HTTPServer) AppClosed(app *App)
func (*HTTPServer) Serve ¶
func (h *HTTPServer) Serve() error
func (*HTTPServer) ServeHTTP ¶
func (h *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*HTTPServer) ServeTLS ¶
func (h *HTTPServer) ServeTLS() error
func (*HTTPServer) Setup ¶
func (h *HTTPServer) Setup()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.