{"modulePath":"github.com/redhat-developer/service-binding-operator","version":"v0.1.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package nested\n\n## Variables\n\n```go\nvar InvalidIndexErr = errors.New(\"invalid index\")\n```\nInvalidIndexErr is returned when a given index is out of bounds.\n\n```go\nvar UnsupportedTypeErr = errors.New(\"unsupported type\")\n```\nUnsupportedTypeErr is returned when an unsupported type is encountered.\n\n## Functions\n\n```go\nfunc ComposeValue(val interface{}, path Path) map[string]interface{}\n```\nComposeValue returns a map containing the structure of \\`path\\`, with \\`val\\` as value.\n\nThe value is always transformed into a slice unless it is already one. For example, the call\n\n\tComposeValue(42, \"foo.bar\")\n\nyields the following result:\n\n\tmap[string]interface{}{\n\t    \"foo\": map[string]interface{}{\n\t        \"bar\": []int{42},\n\t    },\n\t}\n\n```go\nfunc GetValue(obj interface{}, p string, o string) (map[string]interface{}, bool, error)\n```\nGetValue attempts to retrieve the value in the given string encoded path.\n\n## Types\n\n```go\ntype Field struct {\n\t// Name is the field name.\n\tName string\n\t// Index is the integer representation of the field name in the case it can be converted to an\n\t// integer value.\n\tIndex *int\n}\n```\nField is the representation of a term in a field path.\n\nAssuming that 'status.dbCredentials' is a path for a value in a nested object, 'status' and 'dbCredentials' are represented as Field values.\n\nField contains two members: 'Name' and 'Index'. 'Name' is a string like 'status' or 'dbCredentials', and 'Index' is the optional integer representation of the value, if it can be transformed to a valid positive integer.\n\n```go\nfunc NewField(name string) Field\n```\nNewField creates a new field with the given name.\n\n```go\ntype Path []Field\n```\nPath represents a field path.\n\n```go\nfunc NewPath(s string) Path\n```\nNewPath creates a new path with the given string in the format 'a.b.c'.\n\n```go\nfunc NewPathWithParts(parts []string) Path\n```\nNewPathWithParts constructs a Path from given parts.\n\n```go\nfunc (p Path) AdjustedPath() Path\n```\nAdjustedPath adjusts the current path depending on the head element.\n\nIn the case the head of a path ('a' in the 'a.b.c' path) exists and is different than '\\*', returns itself otherwise returns the path tail ('b.c' in the example).\n\n```go\nfunc (p Path) BasePath() Path\n```\nBasePath returns the receiver's base path.\n\nFor example, returns 'a.b' from the 'a.b.c' path.\n\n```go\nfunc (p Path) Clean() Path\n```\nClean creates a new Path without '\\*' or integer values.\n\nFor example, returns 'a.b.c' for 'a.b.\\*.c' or 'a.b.1.c'.\n\n```go\nfunc (p Path) Decompose() (Path, Field)\n```\nDecompose returns the receiver's base path and the last field.\n\n```go\nfunc (p Path) HasTail() bool\n```\nHasTail asserts whether path has a tail.\n\n```go\nfunc (p Path) Head() (Field, bool)\n```\nHead returns the path head if one exists.\n\n```go\nfunc (p Path) LastField() (Field, bool)\n```\nLastField returns the last field from the receiver.\n\n```go\nfunc (p Path) Tail() Path\n```\nTail returns the path tail if present.\n\nReturns 'b.c' in the path 'a.b.c'.\n\n","path":"github.com/redhat-developer/service-binding-operator/pkg/controller/servicebindingrequest/nested","name":"nested","synopsis":"","isRedistributable":true}
