{"modulePath":"github.com/wavetermdev/waveterm/wavesrv","version":"v0.7.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pcloud\n\n## Constants\n\n```go\nconst APIVersion = 1\n```\n\n```go\nconst EstimatedSizePadding = 100\n```\n\n```go\nconst MaxPtyUpdateSize = (128 * 1024)\n```\n\n```go\nconst MaxUpdatePayloadSize = 1 * (1024 * 1024)\n```\nsetting 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\n\n```go\nconst MaxUpdateWriterErrors = 3\n```\n\n```go\nconst MaxUpdatesPerReq = 10\n```\n\n```go\nconst MaxUpdatesToDeDup = 1000\n```\n\n```go\nconst NoTelemetryUrl = \"/no-telemetry\"\n```\n\n```go\nconst PCloudDefaultTimeout = 5 * time.Second\n```\n\n```go\nconst PCloudEndpoint = \"https://api.waveterm.dev/central\"\n```\n\n```go\nconst PCloudEndpointVarName = \"PCLOUD_ENDPOINT\"\n```\n\n```go\nconst PCloudWSEndpoint = \"wss://wsapi.waveterm.dev/\"\n```\n\n```go\nconst PCloudWSEndpointVarName = \"PCLOUD_WS_ENDPOINT\"\n```\n\n```go\nconst PCloudWebShareUpdateTimeout = 15 * time.Second\n```\n\n```go\nconst TelemetryUrl = \"/telemetry\"\n```\n\n```go\nconst WebShareUpdateUrl = \"/auth/web-share-update\"\n```\n\n## Functions\n\n```go\nfunc DeDupUpdates(ctx context.Context, updateArr []*sstore.ScreenUpdateType) ([]*sstore.ScreenUpdateType, error)\n```\n\n```go\nfunc DoSyncWebUpdate(webUpdate *WebShareUpdateType) error\n```\n\n```go\nfunc DoWebUpdates(webUpdates []*WebShareUpdateType) error\n```\n\n```go\nfunc GetEndpoint() string\n```\n\n```go\nfunc GetUpdateWriterNumFailures() int\n```\n\n```go\nfunc GetUpdateWriterRunning() bool\n```\n\n```go\nfunc GetWSEndpoint() string\n```\n\n```go\nfunc ResetUpdateWriterNumFailures()\n```\n\n```go\nfunc SendNoTelemetryUpdate(ctx context.Context, noTelemetryVal bool) error\n```\n\n```go\nfunc SendTelemetry(ctx context.Context, force bool) error\n```\n\n```go\nfunc StartUpdateWriter()\n```\n\n## Types\n\n```go\ntype AuthInfo struct {\n\tUserId   string `json:\"userid\"`\n\tClientId string `json:\"clientid\"`\n\tAuthKey  string `json:\"authkey\"`\n}\n```\n\n```go\ntype NoTelemetryInputType struct {\n\tClientId string `json:\"clientid\"`\n\tValue    bool   `json:\"value\"`\n}\n```\n\n```go\ntype TelemetryInputType struct {\n\tUserId       string                    `json:\"userid\"`\n\tClientId     string                    `json:\"clientid\"`\n\tCurDay       string                    `json:\"curday\"`\n\tDefaultShell string                    `json:\"defaultshell\"`\n\tActivity     []*telemetry.ActivityType `json:\"activity\"`\n}\n```\n\n```go\ntype WebShareCmdType struct {\n\tLineId      string             `json:\"lineid\"`\n\tCmdStr      string             `json:\"cmdstr\"`\n\tRawCmdStr   string             `json:\"rawcmdstr\"`\n\tRemote      *WebShareRemote    `json:\"remote\"`\n\tFeState     sstore.FeStateType `json:\"festate\"`\n\tTermOpts    sstore.TermOpts    `json:\"termopts\"`\n\tStatus      string             `json:\"status\"`\n\tCmdPid      int                `json:\"cmdpid\"`\n\tRemotePid   int                `json:\"remotepid\"`\n\tDoneTs      int64              `json:\"donets,omitempty\"`\n\tExitCode    int                `json:\"exitcode,omitempty\"`\n\tDurationMs  int                `json:\"durationms,omitempty\"`\n\tRtnState    bool               `json:\"rtnstate,omitempty\"`\n\tRtnStateStr string             `json:\"rtnstatestr,omitempty\"`\n}\n```\n\n```go\ntype WebShareLineType struct {\n\tLineId        string `json:\"lineid\"`\n\tTs            int64  `json:\"ts\"`\n\tLineNum       int64  `json:\"linenum\"`\n\tLineType      string `json:\"linetype\"`\n\tContentHeight int64  `json:\"contentheight\"`\n\tRenderer      string `json:\"renderer,omitempty\"`\n\tText          string `json:\"text,omitempty\"`\n}\n```\n\n```go\ntype WebSharePtyData struct {\n\tPtyPos int64  `json:\"ptypos\"`\n\tData   []byte `json:\"data\"`\n\tEof    bool   `json:\"-\"` // internal use\n}\n```\n\n```go\ntype WebShareRemote struct {\n\tRemoteId      string `json:\"remoteid\"`\n\tAlias         string `json:\"alias,omitempty\"`\n\tCanonicalName string `json:\"canonicalname\"`\n\tName          string `json:\"name,omitempty\"`\n\tHomeDir       string `json:\"homedir,omitempty\"`\n\tIsRoot        bool   `json:\"isroot,omitempty\"`\n}\n```\n\n```go\ntype WebShareScreenType struct {\n\tScreenId     string `json:\"screenid\"`\n\tShareName    string `json:\"sharename\"`\n\tViewKey      string `json:\"viewkey\"`\n\tSelectedLine int    `json:\"selectedline\"`\n}\n```\n\n```go\ntype WebShareUpdateResponseType struct {\n\tUpdateId int64  `json:\"updateid\"`\n\tSuccess  bool   `json:\"success\"`\n\tError    string `json:\"error,omitempty\"`\n}\n```\n\n```go\nfunc (ur *WebShareUpdateResponseType) GetSimpleKey() int64\n```\n\n```go\ntype WebShareUpdateType struct {\n\tScreenId   string `json:\"screenid\"`\n\tLineId     string `json:\"lineid\"`\n\tUpdateId   int64  `json:\"updateid\"`\n\tUpdateType string `json:\"updatetype\"`\n\tUpdateTs   int64  `json:\"updatets\"`\n\n\tScreen   *WebShareScreenType `json:\"screen,omitempty\"`\n\tLine     *WebShareLineType   `json:\"line,omitempty\"`\n\tCmd      *WebShareCmdType    `json:\"cmd,omitempty\"`\n\tPtyData  *WebSharePtyData    `json:\"ptydata,omitempty\"`\n\tSVal     string              `json:\"sval,omitempty\"`\n\tIVal     int64               `json:\"ival,omitempty\"`\n\tBVal     bool                `json:\"bval,omitempty\"`\n\tTermOpts *sstore.TermOpts    `json:\"termopts,omitempty\"`\n}\n```\n\n```go\nfunc MakeScreenDelUpdate(screen *sstore.ScreenType, screenId string) *WebShareUpdateType\n```\n\n```go\nfunc MakeScreenNewUpdate(screen *sstore.ScreenType, webShareOpts sstore.ScreenWebShareOpts) *WebShareUpdateType\n```\n\n```go\nfunc (update *WebShareUpdateType) GetEstimatedSize() int\n```\n\n```go\nfunc (update *WebShareUpdateType) String() string\n```\n\n","path":"github.com/wavetermdev/waveterm/wavesrv/pkg/pcloud","name":"pcloud","synopsis":"","isRedistributable":true}
