Documentation
¶
Index ¶
Constants ¶
View Source
const ( StartTestWorkerMsg = "Test worker started" StopTestWorkerMsg = "Test worker stopped" )
View Source
const ( TestProcessLogPath = "test_process.log" TestProcessPidFile = "test_process.pid" )
View Source
const (
EnvName = "TT_CLI_DAEMON"
)
Variables ¶
This section is empty.
Functions ¶
func RunHTTPServerOnBackground ¶
RunHTTPServerOnBackground starts http daemon process.
func StopDaemon ¶
StopDaemon starts http daemon process.
Types ¶
type DaemonCtx ¶
type DaemonCtx struct {
// Port is a port number to be used for daemon http server.
Port int
// PIDFile is a path of a file contains pid of daemon process.
PIDFile string
// LogPath is a path to a file contains log of daemon process.
LogPath string
// ListenInterface is a network interface the IP address
// should be found on to bind http server socket.
ListenInterface string
}
DaemonCtx contains information for running an daemon instance.
func NewDaemonCtx ¶
func NewDaemonCtx(opts *config.DaemonOpts) *DaemonCtx
NewDaemonCtx creates the DaemonCtx context.
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer contains information for http server.
func NewHTTPServer ¶
func NewHTTPServer(listenInterface string, port int) *HTTPServer
NewHTTPServer creates new HTTPServer.
func (*HTTPServer) SetLogger ¶
func (httpServer *HTTPServer) SetLogger(logger ttlog.Logger)
SetLogger sets a log file the HTTP server will write to.
func (*HTTPServer) Start ¶
func (httpServer *HTTPServer) Start(ttPath string)
Start starts HTTP server.
func (*HTTPServer) Timeout ¶
func (httpServer *HTTPServer) Timeout(timeout time.Duration) *HTTPServer
Timeout sets the time that was provided to the HTTP server to shutdown correctly.
type Process ¶
type Process struct {
// DaemonTag is an env name to check the process is a child process.
DaemonTag string
// contains filtered or unexported fields
}
Process describes a running process.
func NewProcess ¶
func NewProcess(worker Worker, pidFileName string, logOpts ttlog.LoggerOpts) *Process
NewProcess creates new Process.
Click to show internal directories.
Click to hide internal directories.