Documentation ¶
Index ¶
- Constants
- Variables
- func CheckForNewCLIVersion(client HTTPClient) string
- func GetDirectoryContainingFile(wd, filename string) (string, error)
- func RandomAlphaNumericSpecialString(length int) string
- func RandomAlphaNumericSpecialStringStrict(length int) string
- func RandomAlphaNumericString(length int) string
- func RandomAlphaString(length int) string
- func ReadAndUnmarshalInto(marshalFn func(in []byte, out interface{}) error, path string, out interface{}) error
- func UnmarshalFromDir(path string) (map[string]interface{}, error)
- func WriteZipToDir(dest string, zipData io.Reader, overwrite bool) error
- type HTTPClient
- type MediaType
Constants ¶
const ( MediaTypeTextPlain = MediaType("text/plain; charset=utf-8") MediaTypeOctetStream = MediaType("application/octet-stream") MediaTypeHTML = MediaType("text/html") MediaTypeJSON = MediaType("application/json") MediaTypeMultipartFormData = MediaType("multipart/form-data") MediaTypeFormURLEncoded = MediaType("application/x-www-form-urlencoded") MediaTypeZip = MediaType("application/zip") )
The set of known MediaTypes
Variables ¶
var ( // CLIVersion represents the current version of the CLI. This version is dynamically replaced at build-time CLIVersion = "1.0.0" // CLIOSArch represents the OS Architecture of the CLI. It is used to select the appropriate URL for the CLI // binary based on the user's OS CLIOSArch string )
Functions ¶
func CheckForNewCLIVersion ¶
func CheckForNewCLIVersion(client HTTPClient) string
CheckForNewCLIVersion looks for and returns a url for a new version of the CLI, if one exists. Any errors are swallowed.
func GetDirectoryContainingFile ¶
GetDirectoryContainingFile searches upwards for a valid Stitch app directory
func RandomAlphaNumericSpecialString ¶
RandomAlphaNumericSpecialString generates a new random alphanumeric key with special characters
func RandomAlphaNumericSpecialStringStrict ¶
RandomAlphaNumericSpecialStringStrict generates a new random alphanumeric key with special characters
func RandomAlphaNumericString ¶
RandomAlphaNumericString generates a new random alphanumeric key
func RandomAlphaString ¶
RandomAlphaString generates a new random alphabetic string of given length
func ReadAndUnmarshalInto ¶
func ReadAndUnmarshalInto(marshalFn func(in []byte, out interface{}) error, path string, out interface{}) error
ReadAndUnmarshalInto unmarshals data from the given path into an interface{} using the provided marshalFn
func UnmarshalFromDir ¶
UnmarshalFromDir unmarshals a Stitch app from the given directory into a map[string]interface{}
Types ¶
type HTTPClient ¶
HTTPClient represents the minimum HTTP client required to check for version information