Documentation
¶
Index ¶
- Constants
- Variables
- func Append(dest, source map[string]interface{}, override bool)
- func AsDataMap(source interface{}) data.Map
- func AsExtractable(input interface{}) (string, map[string]interface{})
- func AsPayload(data []byte) string
- func BuildLowerCaseMapping(aMap map[string]interface{}) map[string]string
- func CheckCommandNotFound(stdout ...string) bool
- func CheckNoSuchFileOrDirectory(stdout ...string) bool
- func ClassifyErrorIfMatched(err error) error
- func EscapeStdout(stdout string) string
- func EscapedContains(stdout, match string) bool
- func ExtractColumn(line string, columnIndex int) (string, bool)
- func ExtractColumns(line string) ([]string, bool)
- func FromPayload(payload string) ([]byte, error)
- func GetArguments(baseURLs ...string) (map[string]interface{}, error)
- func GetCredential(name, username, password string) (string, error)
- func GetDummyCredential() (string, error)
- func GetIgnoreList(service storage.Service, URL string) []string
- func GetUsername(service *secret.Service, credentials string) (string, error)
- func IsNotSuchResourceError(err error) bool
- func ListResource(baseURLs []string, URI string) ([]string, error)
- func LoadData(baseURLs []string, URI string) (interface{}, error)
- func LoadMap(baseURLs []string, URI string) (map[string]interface{}, error)
- func LoadResource(baseURL, URI string, result interface{}) (*url.Resource, error)
- func LoadResourceFromBaseURLs(baseURLs []string, URI string, result interface{}) (*url.Resource, error)
- func NormalizeMap(keyValuePairs interface{}, deep bool) (map[string]interface{}, error)
- func SetNonEmpty(ptr1, ptr2 *string)
- func SetNonZero(ptr1, ptr2 *int)
- func SimpleTypeName(typeName string) string
- type NotSuchResourceError
Constants ¶
const CanNotOpen = "can't open"
const CommandNotFound = "command not found"
const ErrorIsNotRecoverable = "Error is not recoverable"
const NoSuchFileOrDirectory = "no such file or directory"
const NotInstalled = "not installed"
const ProgramCanBeFound = "can be found in the following packages"
Variables ¶
var StdErrors = []string{CommandNotFound, NoSuchFileOrDirectory, ProgramCanBeFound}
Functions ¶
func AsExtractable ¶
AsExtractable returns text and data structure
func BuildLowerCaseMapping ¶ added in v0.30.2
BuildLowerCaseMapping build lowercase key to key map mapping
func CheckCommandNotFound ¶
CheckCommandNotFound checks for command not found message in the provided stdout.
func CheckNoSuchFileOrDirectory ¶
CheckNoSuchFileOrDirectory checks for no such file or directory message in the provided stdout.
func ClassifyErrorIfMatched ¶
ClassifyErrorIfMatched classify error with concrete implementation if needed
func EscapeStdout ¶
func EscapedContains ¶
func ExtractColumn ¶
ExtractColumn extract a column from the line for provided index
func ExtractColumns ¶
ExtractColumns extract all column from the line
func GetArguments ¶ added in v0.29.0
GetArguments extract cli arguments into a map
func GetCredential ¶
func GetDummyCredential ¶
func GetIgnoreList ¶ added in v0.29.2
GetIgnoreList returns ignore list
func IsNotSuchResourceError ¶
IsNotSuchResourceError returns trus if error is of NotSuchResourceError type
func ListResource ¶ added in v0.21.2
ListResource returns list of matcher resource URL
func LoadResource ¶
LoadResource load and decode URI into result pointer
func LoadResourceFromBaseURLs ¶
func LoadResourceFromBaseURLs(baseURLs []string, URI string, result interface{}) (*url.Resource, error)
LoadResourceFromBaseURLs loads resource from base URLs and URI, returns the first successfully loaded resource or error
func NormalizeMap ¶
NormalizeMap normalizes keyValuePairs from map or slice (map with preserved key order)
func SetNonEmpty ¶
func SetNonEmpty(ptr1, ptr2 *string)
func SetNonZero ¶
func SetNonZero(ptr1, ptr2 *int)
func SimpleTypeName ¶ added in v0.30.2
SimpleTypeName returns simple type name
Types ¶
type NotSuchResourceError ¶
NotSuchResourceError represents generic no such resource error
func NewNotSuchResourceError ¶
func NewNotSuchResourceError(resource string) *NotSuchResourceError
NewNotSuchResourceError create new NewNotSuchResourceError
func (*NotSuchResourceError) Error ¶
func (e *NotSuchResourceError) Error() string