Documentation ¶
Index ¶
- Variables
- func DecodeAnswer(in string, obj interface{}) (interface{}, error)
- func EncodeOffer(obj interface{}) (string, error)
- func Error(err error) error
- func Execute()
- func FMTTurn(addrs []string) []string
- func InitConfig(fn func() (string, bool)) (string, bool)
- func ToJSON(obj interface{}) string
- func VersionCheck(current string) (string, bool)
- type AuthResponse
- type GetGist
- type Gist
- type GistFile
- type GistFiles
- type Info
- type Lines
- type LiveLine
- type LiveOffer
- type LiveResponse
- type Logger
- type Recording
- type TURNCredentials
- type TURNServer
Constants ¶
This section is empty.
Variables ¶
var ( GistFileName = "terminal-recording.json" Application = "termbacktime" GistAPI = "https://api.github.com/gists" PlaybackURL = "https://termbackti.me" LiveURL = "https://xterm.live" Broker = "wss://broker.termbackti.me" APIEndpoint = "https://api.termbackti.me" Revision = "0000000" Version = "0.0.0" ConfigType = "json" STUNServerOne = "stun:stun1.l.google.com:19302" STUNServerTwo = "stun:stun2.l.google.com:19302" HomeDir = getHome() Username = uuid() )
Exported default compile settings.
var ( Shell string Closed bool GistResponse map[string]interface{} GithubToken string Instructions []Lines )
Base application variables.
Functions ¶
func DecodeAnswer ¶
DecodeAnswer decodes WebRTC answer from base64
func EncodeOffer ¶
EncodeOffer encodes WebRTC offer in base64
func InitConfig ¶
InitConfig reads in config file and ENV variables if set.
func VersionCheck ¶
VersionCheck checks the current version against the semver at termbackti.me/_version TODO: Create a manual command to check versions.
Types ¶
type AuthResponse ¶
AuthResponse represents the WebSocket response from the broker
type GetGist ¶
type GetGist struct { ID string `json:"id,omitempty"` Description string `json:"description,omitempty"` Public bool `json:"public,omitempty"` Owner map[string]interface{} `json:"owner,omitempty"` Files map[string]GistFile `json:"files,omitempty"` Comments int `json:"comments,omitempty"` HTMLURL string `json:"html_url,omitempty"` GitPullURL string `json:"git_pull_url,omitempty"` GitPushURL string `json:"git_push_url,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` NodeID string `json:"node_id,omitempty"` }
GetGist represents a GitHub's gist API response.
type Gist ¶
type Gist struct { Description string `json:"description,omitempty"` Public bool `json:"public,omitempty"` GistFiles map[string]GistFiles `json:"files,omitempty"` }
Gist is the required structure for POST data for API purposes.
type GistFile ¶
type GistFile struct { Size int `json:"size,omitempty"` Filename string `json:"filename,omitempty"` Language string `json:"language,omitempty"` Type string `json:"type,omitempty"` RawURL string `json:"raw_url,omitempty"` Content string `json:"content,omitempty"` }
GistFile represents a file in a gist.
type GistFiles ¶
type GistFiles struct {
Content string `json:"content"`
}
GistFiles is the top-level struct for gist files.
type Lines ¶
type Lines struct { Time int64 `json:"t,omitempty"` Command string `json:"c,omitempty"` Lines []string `json:"l,omitempty"` Sizes []int `json:"s,omitempty"` }
Lines is an array of terminal STDOUT lines.
type LiveLine ¶
type LiveLine struct { Command string `json:"c,omitempty"` Lines []string `json:"l,omitempty"` Sizes []int `json:"s,omitempty"` }
LiveLine is for live terminal streaming
type LiveOffer ¶
type LiveOffer struct { Offer string `json:"offer"` TURN *TURNServer `json:"turn,omitempty"` }
LiveOffer creates SDP offers
type LiveResponse ¶
LiveResponse represents the WebSocket response from the broker
type Recording ¶
type Recording struct { Info Info `json:"i"` Started int64 `json:"d"` Title string `json:"t,omitempty"` Sizes []int `json:"s,omitempty"` Lines []Lines `json:"r,omitempty"` Pack string `json:"p,omitempty"` }
Recording JSON struct for recordings.
type TURNCredentials ¶
type TURNCredentials struct { URLs []string `json:"servers,omitempty"` Username string `json:"username,omitempty"` Credential string `json:"credential,omitempty"` }
TURNCredentials is the authorization creds for official TURN servers
type TURNServer ¶
type TURNServer struct { URLs string `json:"urls,omitempty"` Username string `json:"username,omitempty"` Credential string `json:"credential,omitempty"` }
TURNServer is used for the front end access to a TURN server