Documentation ¶
Index ¶
- Constants
- Variables
- func Timestamp() string
- func Version() string
- type AssocPair
- type Config
- type Endpoint
- type HttpWsMuxHandler
- type LaunchedProcess
- type LogFunc
- type LogLevel
- type LogScope
- func (l *LogScope) Access(category string, msg string, args ...interface{})
- func (l *LogScope) Associate(key string, value string)
- func (l *LogScope) Debug(category string, msg string, args ...interface{})
- func (l *LogScope) Error(category string, msg string, args ...interface{})
- func (l *LogScope) Fatal(category string, msg string, args ...interface{})
- func (l *LogScope) Info(category string, msg string, args ...interface{})
- func (parent *LogScope) NewLevel(logFunc LogFunc) *LogScope
- func (l *LogScope) Trace(category string, msg string, args ...interface{})
- type ProcessEndpoint
- type URLInfo
- type WebSocketEndpoint
Constants ¶
View Source
const ( LogDebug = iota LogTrace LogAccess LogInfo LogError LogFatal )
View Source
const (
ConsoleContent = `` /* 7202-byte string literal not displayed */
)
View Source
const (
License = `` /* 1325-byte string literal not displayed */
)
Variables ¶
View Source
var ScriptNotFoundError = errors.New("script not found")
Functions ¶
Types ¶
type Config ¶
type Config struct { CommandName string // Command to execute. CommandArgs []string // Additional args to pass to command. ReverseLookup bool // Perform reverse DNS lookups on hostnames (useful, but slower). ScriptDir string // Base directory for websocket scripts. UsingScriptDir bool // Are we running with a script dir. StartupTime time.Time // Server startup time (used for dev console caching). DevConsole bool // Enable dev console. Env []string // Additional environment variables to pass to process ("key=value"). }
type HttpWsMuxHandler ¶
func (HttpWsMuxHandler) ServeHTTP ¶
func (h HttpWsMuxHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
Main HTTP handler. Muxes between WebSocket handler, DevConsole or 404.
type LaunchedProcess ¶
type LaunchedProcess struct {
// contains filtered or unexported fields
}
type LogScope ¶
type LogScope struct { Parent *LogScope // Parent scope MinLevel LogLevel // Minimum log level to write out. Mutex *sync.Mutex // Should be shared across all LogScopes that write to the same destination. Associated []AssocPair // Additional data associated with scope LogFunc LogFunc }
func RootLogScope ¶
type ProcessEndpoint ¶
type ProcessEndpoint struct {
// contains filtered or unexported fields
}
func NewProcessEndpoint ¶
func NewProcessEndpoint(process *LaunchedProcess, log *LogScope) *ProcessEndpoint
func (*ProcessEndpoint) Output ¶
func (pe *ProcessEndpoint) Output() chan string
func (*ProcessEndpoint) ReadOutput ¶
func (pe *ProcessEndpoint) ReadOutput(input io.ReadCloser, config *Config)
func (*ProcessEndpoint) Send ¶
func (pe *ProcessEndpoint) Send(msg string) bool
func (*ProcessEndpoint) Terminate ¶
func (pe *ProcessEndpoint) Terminate()
type WebSocketEndpoint ¶
type WebSocketEndpoint struct {
// contains filtered or unexported fields
}
func NewWebSocketEndpoint ¶
func NewWebSocketEndpoint(ws *websocket.Conn, log *LogScope) *WebSocketEndpoint
func (*WebSocketEndpoint) Output ¶
func (we *WebSocketEndpoint) Output() chan string
func (*WebSocketEndpoint) ReadOutput ¶
func (we *WebSocketEndpoint) ReadOutput(config *Config)
func (*WebSocketEndpoint) Send ¶
func (we *WebSocketEndpoint) Send(msg string) bool
func (*WebSocketEndpoint) Terminate ¶
func (we *WebSocketEndpoint) Terminate()
Click to show internal directories.
Click to hide internal directories.