summaryrefslogtreecommitdiff
path: root/internal/clients/handlers/clienthandler.go
blob: fcd80526308f398ff3914af050a177a391a6771b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package handlers

import (
	"github.com/mimecast/dtail/internal/io/logger"
)

// ClientHandler is the basic client handler interface.
type ClientHandler struct {
	baseHandler
}

// NewClientHandler creates a new client handler.
func NewClientHandler(server string) *ClientHandler {
	logger.Debug(server, "Creating new client handler")

	return &ClientHandler{
		baseHandler{
			server:       server,
			shellStarted: false,
			commands:     make(chan string),
			status:       -1,
			withCancel: withCancel{
				done: make(chan struct{}),
			},
		},
	}
}