Documentation ¶
Index ¶
- Variables
- func CreateFile(contents []byte, filename string, location string) error
- func DownloadFile(filepath string, url string) error
- func ErrCueLookup(err error) error
- func ErrExpectedTypeMismatch(err error, expectedType string) error
- func ErrGetBool(key string, err error) error
- func ErrGettingLatestReleaseTag(err error) error
- func ErrJsonSchemaToCue(err error) error
- func ErrJsonToCue(err error) error
- func ErrMarshal(err error) error
- func ErrMissingField(err error, missingFieldName string) error
- func ErrReadingLocalFile(err error) error
- func ErrReadingRemoteFile(err error) error
- func ErrRemoteFileNotFound(url string) error
- func ErrUnmarshal(err error) error
- func ErrUnmarshalInvalid(err error, typ reflect.Type) error
- func ErrUnmarshalSyntax(err error, offset int64) error
- func ErrUnmarshalType(err error, value string) error
- func ErrUnmarshalUnsupportedType(err error, typ reflect.Type) error
- func ErrUnmarshalUnsupportedValue(err error, value reflect.Value) error
- func ErrYamlToCue(err error) error
- func Filepath() string
- func GetBool(key string) (bool, error)
- func GetHome() string
- func GetLatestReleaseTagsSorted(org string, repo string) ([]string, error)
- func GetNonConcreteFields(val cue.Value) []string
- func Git() (version, commitHead string)
- func JsonSchemaToCue(value string) (cue.Value, error)
- func JsonToCue(value []byte) (cue.Value, error)
- func Lookup(rootVal cue.Value, path string) (cue.Value, error)
- func Marshal(obj interface{}) (string, error)
- func MergeToTemplate(tpl []byte, data interface{}) ([]byte, error)
- func NewUUID() (string, error)
- func ReadFileSource(uri string) (string, error)
- func ReadLocalFile(location string) (string, error)
- func ReadRemoteFile(url string) (string, error)
- func SortDottedStringsByDigits(s []string) []string
- func StrConcat(s ...string) string
- func TcpCheck(hp *HostPort, mock *MockOptions) bool
- func TransformMapKeys(input map[string]interface{}, transformFunc func(string) string) map[string]interface{}
- func Unmarshal(obj string, result interface{}) error
- func Validate(schema cue.Value, value cue.Value) (bool, []errors.Error)
- func YamlToCue(value string) (cue.Value, error)
- type Endpoint
- type HostPort
- type MockOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnmarshalCode = "11043" ErrUnmarshalInvalidCode = "11044" ErrUnmarshalSyntaxCode = "11045" ErrUnmarshalTypeCode = "11046" ErrUnmarshalUnsupportedTypeCode = "11047" ErrUnmarshalUnsupportedValueCode = "11048" ErrMarshalCode = "11049" ErrGetBoolCode = "11050" ErrInvalidProtocolCode = "11051" ErrRemoteFileNotFoundCode = "11052" ErrReadingRemoteFileCode = "11053" ErrReadingLocalFileCode = "11054" ErrGettingLatestReleaseTagCode = "11055" ErrInvalidProtocol = errors.New(ErrInvalidProtocolCode, errors.Alert, []string{"invalid protocol: only http, https and file are valid protocols"}, []string{}, []string{"Network protocol is incorrect"}, []string{"Make sure to specify the right network protocol"}) ErrMissingFieldCode = "11076" ErrExpectedTypeMismatchCode = "11079" ErrJsonToCueCode = "11085" ErrYamlToCueCode = "11086" ErrJsonSchemaToCueCode = "11087" ErrCueLookupCode = "11089" )
Functions ¶
func CreateFile ¶ added in v0.1.22
CreateFile creates a file with the given content on the given location with the given filename
func DownloadFile ¶
func ErrCueLookup ¶ added in v0.5.38
func ErrExpectedTypeMismatch ¶ added in v0.5.22
func ErrGetBool ¶
func ErrGettingLatestReleaseTag ¶ added in v0.2.35
func ErrJsonSchemaToCue ¶ added in v0.5.33
func ErrJsonToCue ¶ added in v0.5.29
func ErrMarshal ¶
func ErrMissingField ¶ added in v0.5.22
func ErrReadingLocalFile ¶ added in v0.1.31
func ErrReadingRemoteFile ¶ added in v0.1.31
func ErrRemoteFileNotFound ¶ added in v0.1.31
func ErrUnmarshal ¶
func ErrUnmarshalInvalid ¶ added in v0.1.25
func ErrUnmarshalSyntax ¶ added in v0.1.25
func ErrUnmarshalType ¶ added in v0.1.25
func ErrUnmarshalUnsupportedType ¶ added in v0.1.25
func ErrUnmarshalUnsupportedValue ¶ added in v0.1.25
func ErrYamlToCue ¶ added in v0.5.29
func GetLatestReleaseTagsSorted ¶ added in v0.2.36
Gets the latest stable release tags from github for a given org name and repo name(in that org) in sorted order
func GetNonConcreteFields ¶ added in v0.5.35
func Git ¶
func Git() (version, commitHead string)
git method which allows fetch the git HEAD tag version and commit number
func MergeToTemplate ¶ added in v0.1.28
MergeToTemplate merges data into the template tpl and returns the result.
func ReadFileSource ¶ added in v0.1.31
ReadFileSource supports "http", "https" and "file" protocols. it takes in the location as a uri and returns the contents of file as a string.
func ReadLocalFile ¶ added in v0.1.31
ReadLocalFile takes in the location of a local file in the format `file://location/of/file` and returns the content of the file if the path is valid and no error occurs
func ReadRemoteFile ¶ added in v0.1.24
ReadRemoteFile takes in the location of a remote file in the format 'http://location/of/file' or 'https://location/file' and returns the content of the file if the location is valid and no error occurs
func SortDottedStringsByDigits ¶ added in v0.2.36
SortDottedStringsByDigits takes version-like dot separated digits in string format and returns them in sorted normalized form. Takes [v1.4.3,0.9.3,v0.0.0]=> returns [v0.0.0,0.9.3,v1.4.3] This function ignores all letters except for: - numeric digits - alpha, beta, rc, stable For the same version, stable is preferred over edge
func TcpCheck ¶
func TcpCheck(hp *HostPort, mock *MockOptions) bool
func TransformMapKeys ¶ added in v0.5.36
func TransformMapKeys(input map[string]interface{}, transformFunc func(string) string) map[string]interface{}
transforms the keys of a Map recursively with the given transform function
func Unmarshal ¶
unmarshal returns parses the JSON config data and stores the value in the reference to result
Types ¶
type MockOptions ¶ added in v0.2.7
type MockOptions struct {
DesiredEndpoint string
}