diff options
| author | Paul Bütow <pbuetow@mimecast.com> | 2020-01-20 18:41:05 +0000 |
|---|---|---|
| committer | Paul Bütow <pbuetow@mimecast.com> | 2020-01-21 14:35:23 +0000 |
| commit | c128865c4c7411c29a59fca9a3a2f95537686d7b (patch) | |
| tree | 193bccc70d942c8b70cc93fae2670263701e43aa /internal/clients/handlers/clienthandler.go | |
| parent | 3755a9911ecb05886577095f2b8cc8b9e4066a3a (diff) | |
Move commands to cmd/ and move internal dependencies to internal/
Diffstat (limited to 'internal/clients/handlers/clienthandler.go')
| -rw-r--r-- | internal/clients/handlers/clienthandler.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/clients/handlers/clienthandler.go b/internal/clients/handlers/clienthandler.go new file mode 100644 index 0000000..4738cd3 --- /dev/null +++ b/internal/clients/handlers/clienthandler.go @@ -0,0 +1,26 @@ +package handlers + +import ( + "github.com/mimecast/dtail/internal/logger" +) + +// ClientHandler is the basic client handler interface. +type ClientHandler struct { + baseHandler +} + +// NewClientHandler creates a new client handler. +func NewClientHandler(server string, pingTimeout int) *ClientHandler { + logger.Debug(server, "Creating new client handler") + + return &ClientHandler{ + baseHandler{ + server: server, + shellStarted: false, + commands: make(chan string), + pong: make(chan struct{}, 1), + stop: make(chan struct{}), + pingTimeout: pingTimeout, + }, + } +} |
