func (m Method) getHandler(method Method) methodHandler {
	ma := m.GetMethodsAvailable()
	mh := ma.Methodhandlers[method]
	return mh
}
getHandler will check the methodsAvailable map, and return the
method handler for the method given
as input argument.
package steward
import (
	"bufio"
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"os/exec"
	"path/filepath"
	"strconv"
	"strings"
	"time"
	"github.com/hpcloud/tail"
	"github.com/prometheus/client_golang/prometheus"
)
type Method string
const (
	REQInitial Method = "REQInitial"
	REQOpCommand Method = "REQOpCommand"
	REQOpProcessList Method = "REQOpProcessList"
	REQOpProcessStart Method = "REQOpProcessStart"
	REQOpProcessStop Method = "REQOpProcessStop"
	REQCliCommand Method = "REQCliCommand"
	REQCliCommandCont Method = "REQCliCommandCont"
	REQToConsole Method = "REQToConsole"
	REQToFileAppend Method = "REQToFileAppend"
	REQToFile Method = "REQToFile"
	REQHello Method = "REQHello"
	REQErrorLog Method = "REQErrorLog"
	REQPing Method = "REQPing"
	REQPong Method = "REQPong"
	REQHttpGet Method = "REQHttpGet"
	REQTailFile Method = "REQTailFile"
	REQToSocket Method = "REQToSocket"
)
func (m Method) GetMethodsAvailable() MethodsAvailable {
	ma := MethodsAvailable{
		Methodhandlers: map[Method]methodHandler{
			REQInitial: methodREQInitial{
				commandOrEvent: CommandACK,
			},
			REQOpCommand: methodREQOpCommand{
				commandOrEvent: CommandACK,
			},
			REQOpProcessList: methodREQOpProcessList{
				commandOrEvent: CommandACK,
			},
			REQOpProcessStart: methodREQOpProcessStart{
				commandOrEvent: CommandACK,
			},
			REQOpProcessStop: methodREQOpProcessStop{
				commandOrEvent: CommandACK,
			},
			REQCliCommand: methodREQCliCommand{
				commandOrEvent: CommandACK,
			},
			REQCliCommandCont: methodREQCliCommandCont{
				commandOrEvent: CommandACK,
			},
			REQToConsole: methodREQToConsole{
				commandOrEvent: EventACK,
			},
			REQToFileAppend: methodREQToFileAppend{
				commandOrEvent: EventACK,
			},
			REQToFile: methodREQToFile{
				commandOrEvent: EventACK,
			},
			REQHello: methodREQHello{
				commandOrEvent: EventNACK,
			},
			REQErrorLog: methodREQErrorLog{
				commandOrEvent: EventACK,
			},
			REQPing: methodREQPing{
				commandOrEvent: EventACK,
			},
			REQPong: methodREQPong{
				commandOrEvent: EventACK,
			},
			REQHttpGet: methodREQHttpGet{
				commandOrEvent: EventACK,
			},
			REQTailFile: methodREQTailFile{
				commandOrEvent: EventACK,
			},
			REQToSocket: methodREQToSocket{
				commandOrEvent: EventACK,
			},
		},
	}
	return ma
}
func (m Method) GetReplyMethods() []Method {
	rm := []Method{REQToConsole, REQToFile, REQToFileAppend, REQToSocket}
	return rm
}