lib

package
v0.0.0-...-b6fdf8c Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const UserClosedStreamIndex = -1

UserClosedStreamIndex is the maximum number of inbound or outbound streams supported by any one lib.User

View Source
const UserMaxStreams = 64

UserMaxStreams is the character prefix which identifies a user ID.

Variables

This section is empty.

Functions

func Err

func Err(status status) error

Err returns a status error given a status

func ResetErrors

func ResetErrors() error

ResetErrors resets guacamole runtime error and returns the former error message

Types

type Client

type Client struct {
	ID string
	// contains filtered or unexported fields
}

Client is a guacamole client container

func NewClient

func NewClient() (*Client, error)

NewClient creates a new guacamole client

func (*Client) Close

func (c *Client) Close()

Close closes the corresponding guacamole client

func (*Client) InitLogLevel

func (c *Client) InitLogLevel(level string)

InitLogLevel initialize guacamole's libguac maximum log level

func (*Client) LoadProtocolPlugin

func (c *Client) LoadProtocolPlugin(proto string) error

LoadProtocolPlugin initializes the given guac_client using the initialization routine provided by the plugin corresponding to the named protocol. This will automatically invoke guac_client_init within the plugin for the given protocol.

Note that the connection will likely not be established until the first user (the "owner") is added to the client.

type ClientMouse

type ClientMouse int

ClientMouse ...

const (
	ClientMouseLeft       ClientMouse = 0x01
	ClientMouseMiddle     ClientMouse = 0x02
	ClientMouseRight      ClientMouse = 0x04
	ClientMouseScrollUp   ClientMouse = 0x08
	ClientMouseScrollDown ClientMouse = 0x10
)

ClientMouse constants

type Socket

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

Socket is a wrapper of given open file descriptor

func NewSocket

func NewSocket(fd int) (*Socket, error)

NewSocket allocates and initialize a new guac_socket object with given open file descriptor. The file descriptor will be automatically closed when the allocated guac_socket is freed.

If an error occurs while allocating the guac_socket object, guac_error will be returned as error.

func (*Socket) Close

func (s *Socket) Close()

Close closes the Socket and all associated resources.

func (*Socket) Read

func (s *Socket) Read(buf []byte) (int, error)

Read data from the socket, filling up to the specified number of bytes in the given buffer.

func (*Socket) Write

func (s *Socket) Write(buf []byte) error

Write all given data to the specified socket.

type User

type User struct {
	ID string
	// contains filtered or unexported fields
}

User is the representation of a physical connection within a larger logical connection which may be shared. Logical connections are represented by guac_client.

func NewUser

func NewUser(s *Socket, c *Client, owner bool, jwt *config.JWT) (*User, error)

NewUser creates a user and associate the user with any specific client

func (*User) Close

func (u *User) Close()

Close frees the user and detach the association to the attached client

func (*User) Debug

func (u *User) Debug(format string, args ...interface{})

Debug logs debug information

func (*User) HandleConnection

func (u *User) HandleConnection(done chan struct{})

HandleConnection handles all I/O for the portion of a user's Occamy connection without the handshake process. This function blocks until the connection/user is aborted or the user disconnects.

func (*User) Prepare

func (u *User) Prepare() error

func (*User) Stop

func (u *User) Stop()

Stop signals the given user that it must disconnect, or advises cooperating services that the given user is no longer connected.

Jump to

Keyboard shortcuts

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