utils

package
v0.0.0-...-18bc924 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSessionID

func GenerateSessionID(sessionInfo *SessionInfo) (sessionID string, err error)

GenerateSessionID Generate Session ID in JWT token format

func GenerateUUID

func GenerateUUID() string

func JsonError

func JsonError(w http.ResponseWriter, msg string, code int)

JsonError JSON error

func RequestInfo

func RequestInfo(r *http.Request) (string, string)

RequestInfo Request info

func ResponseFailed

func ResponseFailed(w http.ResponseWriter, status int, err error)

ResponseFailed Response Failed

func ResponseOk

func ResponseOk(w http.ResponseWriter, status int, data interface{})

ResponseOk Response OK

func SecondsSince

func SecondsSince(start time.Time) float64

SecondsSince Calculate seconds since specified time until now

func Serial

func Serial() uint64

Serial Serial

func WaitUntilGridReady

func WaitUntilGridReady(url *url.URL, healthCheck string) (err error)

Types

type CachedInfo

type CachedInfo struct {
	Session *SessionInfo
	Proxy   *httputil.ReverseProxy
}

type SessionInfo

type SessionInfo struct {
	SessionID   string
	ServiceName string
	Host        string
	Port        string
	BaseURL     string
	VNCPort     string
	Engine      string
}

func ParseSessionID

func ParseSessionID(sessionID string) (sessionInfo *SessionInfo, err error)

ParseSessionID Extract session id information

Jump to

Keyboard shortcuts

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