guacamole

package
v0.0.0-...-caea6a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MalformedLoginErr = errors.New("malformed login response")
	NoHostErr         = errors.New("host is missing")
	NoPortErr         = errors.New("port is missing")
	NoNameErr         = errors.New("name is missing")
	IncorrectColorErr = errors.New("colorDepth can take the following values: 8, 16, 24, 32")
	UnexpectedRespErr = errors.New("unexpected response from Guacamole")
	SessionErr        = errors.New("session must exist")

	DefaultAdminUser = "guacadmin"
	DefaultAdminPass = "guacadmin"
)
View Source
var (
	KeyPressed = func(kf *KeyFrame) bool {
		return kf.Pressed == "1"
	}
	MouseClicked = func(mf *MouseFrame) bool {
		return mf.Button == "1" || mf.Button == "4" || mf.Button == "2"
	}
)
View Source
var (
	InvalidOpcodeErr = errors.New("invalid opcode")
	InvalidArgsErr   = errors.New("invalid number of args")
)
View Source
var (
	UnknownTeamIdErr = errors.New("Unknown team id")
)

Functions

func NewGuacTokenLoginEndpoint

func NewGuacTokenLoginEndpoint(users *GuacUserStore, ts store.TeamStore, loginFunc func(string, string) (string, error)) *guacTokenLoginEndpoint

Types

type Config

type Config struct {
	AdminPass string `yaml:"admin_pass"`
}

type CreateRDPConnOpts

type CreateRDPConnOpts struct {
	Host             string
	Port             uint
	Name             string
	GuacUser         string
	Username         *string
	Password         *string
	ResolutionWidth  uint
	ResolutionHeight uint
	MaxConn          uint
	ColorDepth       uint
}

type Element

type Element string

type Frame

type Frame struct {
	Opcode Element
	Args   []Element
}

func NewFrame

func NewFrame(rawFrame RawFrame) (*Frame, error)

type GuacError

type GuacError struct {
	// contains filtered or unexported fields
}

func (*GuacError) Error

func (ge *GuacError) Error() string

type GuacUser

type GuacUser struct {
	Username string
	Password string
}

type GuacUserStore

type GuacUserStore struct {
	// contains filtered or unexported fields
}

func NewGuacUserStore

func NewGuacUserStore() *GuacUserStore

func (*GuacUserStore) CreateUserForTeam

func (us *GuacUserStore) CreateUserForTeam(tid string, u GuacUser)

func (*GuacUserStore) GetUserForTeam

func (us *GuacUserStore) GetUserForTeam(tid string) (*GuacUser, error)

type Guacamole

type Guacamole interface {
	io.Closer
	Start(context.Context) error
	CreateUser(username, password string) error
	CreateRDPConn(opts CreateRDPConnOpts) error
	GetAdminPass() string
	RawLogin(username, password string) ([]byte, error)
	ProxyHandler(us *GuacUserStore, klp KeyLoggerPool) svcs.ProxyConnector
}

func New

func New(ctx context.Context, conf Config) (Guacamole, error)

type KeyFrame

type KeyFrame struct {
	Key     Element
	Pressed Element
}

func NewKeyFrame

func NewKeyFrame(f *Frame) (*KeyFrame, error)

type KeyFrameFilter

type KeyFrameFilter interface {
	Filter(RawFrame) (kf *KeyFrame, ok bool, err error)
}

func NewKeyFrameFilter

func NewKeyFrameFilter(conditions ...KeyFrameFilterCondition) KeyFrameFilter

type KeyFrameFilterCondition

type KeyFrameFilterCondition func(*KeyFrame) bool

type KeyLogger

type KeyLogger interface {
	Log(rm RawFrame)
}

func NewKeyLogger

func NewKeyLogger(logger *zerolog.Logger) (KeyLogger, error)

type KeyLoggerPool

type KeyLoggerPool interface {
	GetLogger(t store.Team) (KeyLogger, error)
	io.Closer
}

func NewKeyLoggerPool

func NewKeyLoggerPool(dir string) (KeyLoggerPool, error)

type MouseFrame

type MouseFrame struct {
	X      Element
	Y      Element
	Button Element
}

func NewMouseFrame

func NewMouseFrame(f *Frame) (*MouseFrame, error)

type MouseFrameFilter

type MouseFrameFilter interface {
	Filter(RawFrame) (mf *MouseFrame, ok bool, err error)
}

func NewMouseFrameFilter

func NewMouseFrameFilter(conditions ...MouseFrameFilterCondition) MouseFrameFilter

type MouseFrameFilterCondition

type MouseFrameFilterCondition func(*MouseFrame) bool

type RawFrame

type RawFrame []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL