pcloud

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = 1
View Source
const EstimatedSizePadding = 100
View Source
const MaxPtyUpdateSize = (128 * 1024)
View Source
const MaxUpdatePayloadSize = 1 * (1024 * 1024)

setting to 1M to be safe (max is 6M for API-GW + Lambda, but there is base64 encoding and upload time) we allow one extra update past this estimated size

View Source
const MaxUpdateWriterErrors = 3
View Source
const MaxUpdatesPerReq = 10
View Source
const MaxUpdatesToDeDup = 1000
View Source
const NoTelemetryUrl = "/no-telemetry"
View Source
const PCloudDefaultTimeout = 5 * time.Second
View Source
const PCloudEndpoint = "https://api.waveterm.dev/central"
View Source
const PCloudEndpointVarName = "PCLOUD_ENDPOINT"
View Source
const PCloudWSEndpoint = "wss://wsapi.waveterm.dev/"
View Source
const PCloudWSEndpointVarName = "PCLOUD_WS_ENDPOINT"
View Source
const PCloudWebShareUpdateTimeout = 15 * time.Second
View Source
const TelemetryUrl = "/telemetry"
View Source
const WebShareUpdateUrl = "/auth/web-share-update"

Variables

This section is empty.

Functions

func DeDupUpdates

func DeDupUpdates(ctx context.Context, updateArr []*sstore.ScreenUpdateType) ([]*sstore.ScreenUpdateType, error)

func DoSyncWebUpdate

func DoSyncWebUpdate(webUpdate *WebShareUpdateType) error

func DoWebUpdates

func DoWebUpdates(webUpdates []*WebShareUpdateType) error

func GetEndpoint

func GetEndpoint() string

func GetUpdateWriterNumFailures

func GetUpdateWriterNumFailures() int

func GetUpdateWriterRunning

func GetUpdateWriterRunning() bool

func GetWSEndpoint

func GetWSEndpoint() string

func ResetUpdateWriterNumFailures

func ResetUpdateWriterNumFailures()

func SendNoTelemetryUpdate

func SendNoTelemetryUpdate(ctx context.Context, noTelemetryVal bool) error

func SendTelemetry

func SendTelemetry(ctx context.Context, force bool) error

func StartUpdateWriter

func StartUpdateWriter()

Types

type AuthInfo

type AuthInfo struct {
	UserId   string `json:"userid"`
	ClientId string `json:"clientid"`
	AuthKey  string `json:"authkey"`
}

type NoTelemetryInputType

type NoTelemetryInputType struct {
	ClientId string `json:"clientid"`
	Value    bool   `json:"value"`
}

type TelemetryInputType

type TelemetryInputType struct {
	UserId       string                    `json:"userid"`
	ClientId     string                    `json:"clientid"`
	CurDay       string                    `json:"curday"`
	DefaultShell string                    `json:"defaultshell"`
	Activity     []*telemetry.ActivityType `json:"activity"`
}

type WebShareCmdType

type WebShareCmdType struct {
	LineId      string             `json:"lineid"`
	CmdStr      string             `json:"cmdstr"`
	RawCmdStr   string             `json:"rawcmdstr"`
	Remote      *WebShareRemote    `json:"remote"`
	FeState     sstore.FeStateType `json:"festate"`
	TermOpts    sstore.TermOpts    `json:"termopts"`
	Status      string             `json:"status"`
	CmdPid      int                `json:"cmdpid"`
	RemotePid   int                `json:"remotepid"`
	DoneTs      int64              `json:"donets,omitempty"`
	ExitCode    int                `json:"exitcode,omitempty"`
	DurationMs  int                `json:"durationms,omitempty"`
	RtnState    bool               `json:"rtnstate,omitempty"`
	RtnStateStr string             `json:"rtnstatestr,omitempty"`
}

type WebShareLineType

type WebShareLineType struct {
	LineId        string `json:"lineid"`
	Ts            int64  `json:"ts"`
	LineNum       int64  `json:"linenum"`
	LineType      string `json:"linetype"`
	ContentHeight int64  `json:"contentheight"`
	Renderer      string `json:"renderer,omitempty"`
	Text          string `json:"text,omitempty"`
}

type WebSharePtyData

type WebSharePtyData struct {
	PtyPos int64  `json:"ptypos"`
	Data   []byte `json:"data"`
	Eof    bool   `json:"-"` // internal use
}

type WebShareRemote

type WebShareRemote struct {
	RemoteId      string `json:"remoteid"`
	Alias         string `json:"alias,omitempty"`
	CanonicalName string `json:"canonicalname"`
	Name          string `json:"name,omitempty"`
	HomeDir       string `json:"homedir,omitempty"`
	IsRoot        bool   `json:"isroot,omitempty"`
}

type WebShareScreenType

type WebShareScreenType struct {
	ScreenId     string `json:"screenid"`
	ShareName    string `json:"sharename"`
	ViewKey      string `json:"viewkey"`
	SelectedLine int    `json:"selectedline"`
}

type WebShareUpdateResponseType

type WebShareUpdateResponseType struct {
	UpdateId int64  `json:"updateid"`
	Success  bool   `json:"success"`
	Error    string `json:"error,omitempty"`
}

func (*WebShareUpdateResponseType) GetSimpleKey

func (ur *WebShareUpdateResponseType) GetSimpleKey() int64

type WebShareUpdateType

type WebShareUpdateType struct {
	ScreenId   string `json:"screenid"`
	LineId     string `json:"lineid"`
	UpdateId   int64  `json:"updateid"`
	UpdateType string `json:"updatetype"`
	UpdateTs   int64  `json:"updatets"`

	Screen   *WebShareScreenType `json:"screen,omitempty"`
	Line     *WebShareLineType   `json:"line,omitempty"`
	Cmd      *WebShareCmdType    `json:"cmd,omitempty"`
	PtyData  *WebSharePtyData    `json:"ptydata,omitempty"`
	SVal     string              `json:"sval,omitempty"`
	IVal     int64               `json:"ival,omitempty"`
	BVal     bool                `json:"bval,omitempty"`
	TermOpts *sstore.TermOpts    `json:"termopts,omitempty"`
}

func MakeScreenDelUpdate

func MakeScreenDelUpdate(screen *sstore.ScreenType, screenId string) *WebShareUpdateType

func MakeScreenNewUpdate

func MakeScreenNewUpdate(screen *sstore.ScreenType, webShareOpts sstore.ScreenWebShareOpts) *WebShareUpdateType

func (*WebShareUpdateType) GetEstimatedSize

func (update *WebShareUpdateType) GetEstimatedSize() int

func (*WebShareUpdateType) String

func (update *WebShareUpdateType) String() string

Jump to

Keyboard shortcuts

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