Documentation
¶
Index ¶
- Variables
- func BrowserFlow(opts BrowserFlowOptions) error
- func CopyDir(src string, dst string) error
- func CopyFile(src, dst string) (int64, error)
- func EnsureLoggedIn() (string, string)
- func EnsureLoggedInWithOnlyAPIKey() string
- func Exists(fn string) bool
- func GetURLs(logger logger.Logger) (string, string)
- func ListDir(dir string) ([]string, error)
- func NewOrderedMap(keys []string, data map[string]any) *orderedMap
- func NewOrderedMapFromFile(keys []string, filename string) (*orderedMap, error)
- func NewOrderedMapFromJSON(keys []string, buf []byte) (*orderedMap, error)
- func Pluralize(count int, singular string, plural string) string
- func RandStringBytes(n int) string
- func SafeFilename(name string) string
- func ShowLogin()
- func TransformUrl(urlString string) string
- func ZipDir(dir string, outfilename string, opts ...ZipDirCallbackMatcher) error
- type APIClient
- type APIError
- type BrowserFlowOptions
- type ZipDirCallbackMatcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTimeout = errors.New("timeout")
View Source
var PackageJsonKeysOrder = []string{
"name",
"description",
"version",
"main",
"type",
"scripts",
"keywords",
"author",
"license",
"engines",
"private",
"devDependencies",
"peerDependencies",
"dependencies",
}
these are the keys that will be written in order to the package.json file if a key is not present, it will be added to the end of the file
View Source
var TypeScriptConfigJsonKeysOrder = []string{
"compilerOptions",
"include",
"exclude",
}
these are the keys that will be written in order to the package.json file if a key is not present, it will be added to the end of the file
Functions ¶
func BrowserFlow ¶
func BrowserFlow(opts BrowserFlowOptions) error
BrowserFlow will open a browser and wait for the user to finish the flow. It will return an error if the flow times out with an ErrTimeout error. It will return an error if the callback fails or any other error occurs.
func EnsureLoggedIn ¶ added in v0.0.42
func EnsureLoggedInWithOnlyAPIKey ¶ added in v0.0.43
func EnsureLoggedInWithOnlyAPIKey() string
func NewOrderedMap ¶ added in v0.0.26
func NewOrderedMapFromFile ¶ added in v0.0.26
func NewOrderedMapFromJSON ¶ added in v0.0.26
func RandStringBytes ¶
RandStringBytes will generate a random string of length n using the alphaNumChars string.
func SafeFilename ¶ added in v0.0.23
func TransformUrl ¶ added in v0.0.47
Types ¶
type APIError ¶ added in v0.0.51
type APIError struct {
URL string `json:"url"`
Method string `json:"method"`
Status int `json:"status"`
Body string `json:"body"`
TheError error `json:"error"`
}
func NewAPIError ¶ added in v0.0.51
type BrowserFlowOptions ¶
Click to show internal directories.
Click to hide internal directories.