Documentation ¶
Index ¶
- Constants
- func CheckJWTValid(jwt string) bool
- func EnsureFolder(path string) error
- func ExitWithError(errType string, errMessage string, errData error)
- func FileExists(path string) (bool, error)
- func IsRegularFile(path string) (bool, error)
- func LaunchBrowser(url string)
- func PathExists(path string) (bool, error)
- func RequestJSON(opts RequestOpts) (err error)
- func RequestRaw(opts RequestOpts) (response io.ReadCloser, err error)
- func SliceContainsString(s []string, e string) bool
- func TarBZ2(src string, writers ...io.Writer) error
- type NodeStore
- type RequestOpts
Constants ¶
const ( ErrorApp = "app" ErrorNode = "node" ErrorUser = "user" )
Error types
const ( RequestDELETE = "DELETE" RequestGET = "GET" RequestPATCH = "PATCH" RequestPOST = "POST" RequestPUT = "PUT" )
Variables ¶
This section is empty.
Functions ¶
func CheckJWTValid ¶
CheckJWTValid returns true if the JWT token is well-formed and not expired This function does not validate the JWT token beyond checking if it's still valid
func EnsureFolder ¶
EnsureFolder creates a folder if it doesn't exist already
func ExitWithError ¶
ExitWithError prints and error then terminates the app
func FileExists ¶
FileExists returns true if the path exists on disk and it's not a folder
func IsRegularFile ¶
IsRegularFile returns true if the path is a file
func LaunchBrowser ¶
func LaunchBrowser(url string)
LaunchBrowser opens a web browser at a specified URL
func PathExists ¶
PathExists returns true if the path exists on disk
func RequestJSON ¶
func RequestJSON(opts RequestOpts) (err error)
RequestJSON fetches a JSON document from the web
func RequestRaw ¶
func RequestRaw(opts RequestOpts) (response io.ReadCloser, err error)
RequestRaw fetches a document from the web and returns the stream as is
func SliceContainsString ¶
SliceContainsString returns true if the slice of strings contains a certain string
Types ¶
type NodeStore ¶
type NodeStore struct {
// contains filtered or unexported fields
}
NodeStore class for managing the node store
func (*NodeStore) GetAuthToken ¶
GetAuthToken returns the value for the Authorization header It will throw an error and terminate the app if there's no token or if the auth token has expired and can't be refreshed