func (c *Client) InitLogLevel(level string) {
	maxLevel, ok := clientLogLevelTable[level]
	if !ok {
		maxLevel = clientLogInfo
	}
	C.init_client_log(c.guacClient, C.int(maxLevel))
}
InitLogLevel initialize guacamole's libguac maximum log level
package lib
import "C"
import (
	"sync"
	"time"
	"unsafe"
	"changkun.de/x/occamy/plugins"
)
type ClientMouse int
const (
	ClientMouseLeft       ClientMouse = 0x01
	ClientMouseMiddle     ClientMouse = 0x02
	ClientMouseRight      ClientMouse = 0x04
	ClientMouseScrollUp   ClientMouse = 0x08
	ClientMouseScrollDown ClientMouse = 0x10
)
type clientLogLevel int
const (
	clientLogError clientLogLevel = 3
	clientLogWarning clientLogLevel = 4
	clientLogInfo clientLogLevel = 6
	clientLogDebug clientLogLevel = 7
	clientLogTrace clientLogLevel = 8
)
var clientLogLevelTable = map[string]clientLogLevel{
	"release": clientLogError,
	"test":    clientLogInfo,
	"debug":   clientLogDebug,
}
type Client struct {
	guacClient *C.struct_guac_client
	once       sync.Once
	ID            string
	socket        *Socket
	running       bool
	data          interface{}
	lastSent      time.Time
	poolBuffer    *Pool
	poolLayer     *Pool
	poolStream    *Pool
	outputStreams [64]Stream
	mu             sync.RWMutex
	users          *User  
	owner          *User
	connectedUsers int64
	handlerFree  func()
	handlerLog   func()
	handlerJoin  func()
	handlerLeave func()
	args         []string
	plugin       plugins.Client
}
func NewClient() (*Client, error) {
	id := NewID(prefixClient)
	cid := C.CString(id)
	cli := C.guac_client_alloc(cid)
	if cli == nil {
		C.free(unsafe.Pointer(cid))
		return nil, errorStatus()
	}
	streams := [64]Stream{}
	for i := 0; i < 64; i++ {
		streams[i] = Stream{Index: ClientClosedStreamIndex}
	}
	return &Client{
		guacClient: cli,
		ID:            id,
		socket:        nil,  
		running:       true,
		lastSent:      time.Now(),
		poolBuffer:    NewPool(BufferPoolInitialSize),
		poolLayer:     NewPool(BufferPoolInitialSize),
		poolStream:    NewPool(0),
		outputStreams: streams,
		args:          []string{},
	}, nil
}
func (c *Client) isRunning() bool {
	if c.guacClient.state == C.GUAC_CLIENT_RUNNING {
		return true
	}
	return false
}
func (c *Client) Close() {
	c.once.Do(func() {
		C.guac_client_stop(c.guacClient)
		C.guac_client_free(c.guacClient)
		c.guacClient = nil
	})
}