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 GetIgnoreList(ctx context.Context, fs afs.Service, URL string) []string
- func GetUsername(service *secret.Service, credentials string) (string, error)
- func IsNotSuchResourceError(err error) bool
- func IsPermitted(stdout ...string) 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{}) (*location.Resource, error)
- func LoadResourceFromBaseURLs(baseURLs []string, URI string, result interface{}) (*location.Resource, error)
- func NormalizeMap(keyValuePairs interface{}, deep bool) (map[string]interface{}, error)
- func SetNonEmpty(ptr1, ptr2 *string)
- func SetNonZero(ptr1, ptr2 *int)
- func ShouldIgnoreLocation(location string, ignoreList []string) bool
- func SimpleTypeName(typeName string) string
- type NotSuchResourceError
Constants ¶
const ( PermissionDenied = "denied" OperationNotPermitted = "not permitted" CommandNotFound = "command not found" NoSuchFileOrDirectory = "no such file or directory" ProgramCanBeFound = "can be found in the following packages" ErrorIsNotRecoverable = "Error is not recoverable" NotInstalled = "not installed" CanNotOpen = "can't open" )
Variables ¶
var StdErrors = []string{CommandNotFound, NoSuchFileOrDirectory, ProgramCanBeFound}
Functions ¶
func AsExtractable ¶
AsExtractable returns text and data structure
func BuildLowerCaseMapping ¶
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 ¶
GetArguments extract cli arguments into a map
func GetIgnoreList ¶
GetIgnoreList returns ignore list
func IsNotSuchResourceError ¶
IsNotSuchResourceError returns trus if error is of NotSuchResourceError type
func IsPermitted ¶
IsPermitted returns true when output does not have permission deinied or not permitted
func ListResource ¶
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{}) (*location.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 ShouldIgnoreLocation ¶
func SimpleTypeName ¶
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