Documentation ¶
Index ¶
Constants ¶
View Source
const ( ResizeMessage byte = iota + 1 DelayMessage )
View Source
const (
//Assuming there will be a moderate number of control messages, so let's set ot 1kB
ControlRecorderBufferSize = 1024
)
View Source
const (
DefaultPlaybackSleepIntervalMs = uint(100)
)
View Source
const ( //It is used as a length of a memory region in bytes that is used to buffer //the session recording. 4455 comes from the estimated typical terminal size in //bytes (height=135 width=33) multiplied by 4 bytes of of terminal codes to get //an estimate of a typical screen frame size in bytes. So we round to 4kB RecorderBufferSize = 4 * 4096 )
Variables ¶
View Source
var ( ErrDeviceNotFound = errors.New("device not found") ErrDeviceNotConnected = errors.New("device not connected") )
App errors
View Source
var (
ErrUnknownMessage = errors.New("message of unknown type")
)
View Source
var ( //Any session that transfers at least one byte above this limit will be automatically //closed. This is set to 8MB, based on a research that a typical couple of minutes session //of `top -d1` (top refreshing every second) is 2MB large (at terminal height=135 width=33)) //Note: this refers to the number of bytes seen on the terminal stdout, as opposed // to the number of bytes saved in the db. The key difference being: // the latter is compressed. //see: https://northerntech.atlassian.net/browse/MEN-4448 MessageSizeLimit = 8 * 1024 * 1024 )
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { HealthCheck(ctx context.Context) error ProvisionDevice(ctx context.Context, tenantID string, device *model.Device) error GetDevice(ctx context.Context, tenantID, deviceID string) (*model.Device, error) DeleteDevice(ctx context.Context, tenantID, deviceID string) error UpdateDeviceStatus(ctx context.Context, tenantID, deviceID, status string) error PrepareUserSession(ctx context.Context, sess *model.Session) error LogUserSession(ctx context.Context, sess *model.Session, sessionType string) error FreeUserSession(ctx context.Context, sessionID string, sessionTypes []string) error GetSessionRecording(ctx context.Context, id string, w io.Writer) (err error) SaveSessionRecording(ctx context.Context, id string, sessionBytes []byte) error GetRecorder(ctx context.Context, sessionID string) io.Writer GetControlRecorder(ctx context.Context, sessionID string) io.Writer DownloadFile(ctx context.Context, userID string, deviceID string, path string) error UploadFile(ctx context.Context, userID string, deviceID string, path string) error Shutdown(timeout time.Duration) ShutdownDone() RegisterShutdownCancel(context.CancelFunc) uint32 UnregisterShutdownCancel(uint32) }
App interface describes app objects
type Control ¶
type Control struct { Type byte Offset int DelayMs uint16 TerminalWidth uint16 TerminalHeight uint16 }
func (Control) MarshalBinary ¶
func (*Control) UnmarshalBinary ¶
type ControlRecorder ¶
type ControlRecorder struct {
// contains filtered or unexported fields
}
func NewControlRecorder ¶
type Playback ¶
type Playback struct {
// contains filtered or unexported fields
}
func NewPlayback ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.