path
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package path implements attribute path functionality, which definestransversals into schema-based data.
Index¶
- type Expression
- func (e Expression) AtAnyListIndex() Expression
- func (e Expression) AtAnyMapKey() Expression
- func (e Expression) AtAnySetValue() Expression
- func (e Expression) AtListIndex(index int) Expression
- func (e Expression) AtMapKey(key string) Expression
- func (e Expression) AtName(name string) Expression
- func (e Expression) AtParent() Expression
- func (e Expression) AtSetValue(value attr.Value) Expression
- func (e Expression) Copy() Expression
- func (e Expression) Equal(o Expression) bool
- func (e Expression) Matches(path Path) bool
- func (e Expression) MatchesParent(path Path) bool
- func (e Expression) Merge(other Expression) Expression
- func (e Expression) MergeExpressions(others ...Expression) Expressions
- func (e Expression) Resolve() Expression
- func (e Expression) Steps() ExpressionSteps
- func (e Expression) String() string
- type ExpressionStep
- type ExpressionStepAttributeNameExact
- type ExpressionStepElementKeyIntAny
- type ExpressionStepElementKeyIntExact
- type ExpressionStepElementKeyStringAny
- type ExpressionStepElementKeyStringExact
- type ExpressionStepElementKeyValueAny
- type ExpressionStepElementKeyValueExact
- type ExpressionStepParent
- type ExpressionSteps
- func (s *ExpressionSteps) Append(steps ...ExpressionStep) ExpressionSteps
- func (s ExpressionSteps) Copy() ExpressionSteps
- func (s ExpressionSteps) Equal(o ExpressionSteps) bool
- func (s ExpressionSteps) LastStep() (ExpressionStep, ExpressionSteps)
- func (s ExpressionSteps) Matches(pathSteps PathSteps) bool
- func (s ExpressionSteps) MatchesParent(pathSteps PathSteps) bool
- func (s ExpressionSteps) NextStep() (ExpressionStep, ExpressionSteps)
- func (s ExpressionSteps) Resolve() ExpressionSteps
- func (s ExpressionSteps) String() string
- type Expressions
- type Path
- func (p Path) AtListIndex(index int) Path
- func (p Path) AtMapKey(key string) Path
- func (p Path) AtName(name string) Path
- func (p Path) AtSetValue(value attr.Value) Path
- func (p Path) AtTupleIndex(index int) Path
- func (p Path) Copy() Path
- func (p Path) Equal(o Path) bool
- func (p Path) Expression() Expression
- func (p Path) ParentPath() Path
- func (p Path) Steps() PathSteps
- func (p Path) String() string
- type PathStep
- type PathStepAttributeName
- type PathStepElementKeyInt
- type PathStepElementKeyString
- type PathStepElementKeyValue
- type PathSteps
- func (s *PathSteps) Append(steps ...PathStep) PathSteps
- func (s PathSteps) Copy() PathSteps
- func (s PathSteps) Equal(o PathSteps) bool
- func (s PathSteps) ExpressionSteps() ExpressionSteps
- func (s PathSteps) LastStep() (PathStep, PathSteps)
- func (s PathSteps) NextStep() (PathStep, PathSteps)
- func (s PathSteps) String() string
- type Paths
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeExpression¶
type Expression struct {// contains filtered or unexported fields}Expression represents an attribute path with expression steps, which canrepresent zero, one, or more actual paths in schema data. This logic iseither based on an absolute path starting at the root of the schema data,similar to Path, or a relative path which is intended to be merged with anexisting absolute path.
Use the MatchRoot() function to create an Expression for an absolute pathwith an initial AtName() step. Use the MatchRelative() function to createan Expression for a relative path, which will be merged with an existingabsolute path.
Similar to Path, Expression functionality has some overlapping method namesand follows a builder pattern, which allows for chaining method calls toconstruct a full expression. The available traversal steps after Expressioncreation are:
- AtAnyListIndex(): Step into a list at any index
- AtAnyMapKey(): Step into a map at any key
- AtAnySetValue(): Step into a set at any attr.Value element
- AtListIndex(): Step into a list at a specific index
- AtMapKey(): Step into a map at a specific key
- AtName(): Step into an attribute or block with a specific name
- AtParent(): Step backwards one step
- AtSetValue(): Step into a set at a specific attr.Value element
For example, to express any list element with a root list attribute named"some_attribute":
path.MatchRoot("some_attribute").AtAnyListIndex()An Expression is generally preferable over a Path in schema-definedfunctionality that is intended to accept paths as parameters, such asattribute validators and attribute plan modifiers, since it allows consumersto support relative paths. Use the Merge() or MergeExpressions() method tocombine the current attribute path expression with those expression(s).
To find Paths from an Expression in schema based data structures, such astfsdk.Config, tfsdk.Plan, and tfsdk.State, use their PathMatches() method.
funcMatchRelative¶
func MatchRelative()Expression
MatchRelative creates an empty attribute path expression that is intendedto be combined with an existing attribute path expression. This allowscreating a relative expression in nested schemas, using AtParent() totraverse up the path or other At methods to traverse further down.
funcMatchRoot¶
func MatchRoot(rootAttributeNamestring)Expression
MatchRoot creates an attribute path expression starting withExpressionStepAttributeNameExact.
func (Expression)AtAnyListIndex¶
func (eExpression) AtAnyListIndex()Expression
AtAnyListIndex returns a copied expression with a new list index step at theend. The returned path is safe to modify without affecting the original.
func (Expression)AtAnyMapKey¶
func (eExpression) AtAnyMapKey()Expression
AtAnyMapKey returns a copied expression with a new map key step at the end.The returned path is safe to modify without affecting the original.
func (Expression)AtAnySetValue¶
func (eExpression) AtAnySetValue()Expression
AtAnySetValue returns a copied expression with a new set value step at theend. The returned path is safe to modify without affecting the original.
func (Expression)AtListIndex¶
func (eExpression) AtListIndex(indexint)Expression
AtListIndex returns a copied expression with a new list index step at theend. The returned path is safe to modify without affecting the original.
func (Expression)AtMapKey¶
func (eExpression) AtMapKey(keystring)Expression
AtMapKey returns a copied expression with a new map key step at the end.The returned path is safe to modify without affecting the original.
func (Expression)AtName¶
func (eExpression) AtName(namestring)Expression
AtName returns a copied expression with a new attribute or block name stepat the end. The returned path is safe to modify without affecting theoriginal.
func (Expression)AtParent¶
func (eExpression) AtParent()Expression
AtParent returns a copied expression with a new parent step at the end.The returned path is safe to modify without affecting the original.
func (Expression)AtSetValue¶
func (eExpression) AtSetValue(valueattr.Value)Expression
AtSetValue returns a copied expression with a new set value step at the end.The returned path is safe to modify without affecting the original.
func (Expression)Copy¶
func (eExpression) Copy()Expression
Copy returns a duplicate of the expression that is safe to modify withoutaffecting the original.
func (Expression)Equal¶
func (eExpression) Equal(oExpression)bool
Equal returns true if the given expression is exactly equivalent.
func (Expression)Matches¶
func (eExpression) Matches(pathPath)bool
Matches returns true if the given Path is valid for the Expression. Anyrelative expression steps, such as ExpressionStepParent, are automaticallyresolved before matching.
func (Expression)MatchesParent¶
func (eExpression) MatchesParent(pathPath)bool
MatchesParent returns true if the given Path is a valid parent for theExpression. This is helpful for determining if a child Path wouldpotentially match the full Expression during depth-first traversal. Anyrelative expression steps, such as ExpressionStepParent, are automaticallyresolved before matching.
func (Expression)Merge¶
func (eExpression) Merge(otherExpression)Expression
Merge returns a copied expression either with the steps of the givenexpression added to the end of the existing steps, or overwriting thesteps if the given expression was a root expression.
Any merged expressions will preserve all expressions steps, such asExpressionStepParent, for troubleshooting. Methods such as Matches() willautomatically resolve the expression when using it. Call the Resolve()method explicitly if a resolved expression without any ExpressionStepParentis desired.
func (Expression)MergeExpressions¶
func (eExpression) MergeExpressions(others ...Expression)Expressions
MergeExpressions returns collection of expressions that calls Merge() onthe current expression with each of the others.
If no Expression are given, then it will return a collection of expressionscontaining only the current expression.
func (Expression)Resolve¶
func (eExpression) Resolve()Expression
Resolve returns a copied expression with any relative steps, such asExpressionStepParent, resolved. This is not necessary before calling methodssuch as Matches(), however it can be useful before returning the String()method so the path information is simplified.
Returns an empty expression if any ExpressionStepParent attempt to gobeyond the first element.
func (Expression)Steps¶
func (eExpression) Steps()ExpressionSteps
Steps returns a copy of the underlying expression steps. Returns an emptycollection of steps if expression is nil.
func (Expression)String¶
func (eExpression) String()string
String returns the human-readable representation of the path.It is intended for logging and error messages and is not protected bycompatibility guarantees.
typeExpressionStep¶
type ExpressionStep interface {// Equal should return true if the given Step is exactly equivalent.Equal(ExpressionStep)bool// Matches should return true if the given PathStep can be fulfilled by the// ExpressionStep.Matches(PathStep)bool// String should return a human-readable representation of the step// intended for logging and error messages. There should not be usage// that needs to be protected by compatibility guarantees.String()string// contains filtered or unexported methods}ExpressionStep represents an expression of an attribute path step, which maymatch zero, one, or more actual paths.
typeExpressionStepAttributeNameExact¶
type ExpressionStepAttributeNameExactstring
ExpressionStepAttributeNameExact is an attribute path expression for anexact attribute name match within an object.
func (ExpressionStepAttributeNameExact)Equal¶
func (sExpressionStepAttributeNameExact) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepAttributeNameExact and the attribute name is equivalent.
func (ExpressionStepAttributeNameExact)Matches¶
func (sExpressionStepAttributeNameExact) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepAttributeNameExact condition.
func (ExpressionStepAttributeNameExact)String¶
func (sExpressionStepAttributeNameExact) String()string
String returns the human-readable representation of the attribute nameexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepElementKeyIntAny¶
type ExpressionStepElementKeyIntAny struct{}ExpressionStepElementKeyIntAny is an attribute path expression for a matching anyinteger element key within a list.
func (ExpressionStepElementKeyIntAny)Equal¶
func (sExpressionStepElementKeyIntAny) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepElementKeyIntAny.
func (ExpressionStepElementKeyIntAny)Matches¶
func (sExpressionStepElementKeyIntAny) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepElementKeyIntAny condition.
func (ExpressionStepElementKeyIntAny)String¶
func (sExpressionStepElementKeyIntAny) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepElementKeyIntExact¶
type ExpressionStepElementKeyIntExactint64
ExpressionStepElementKeyIntExact is an attribute path expression for an exact integerelement key match within a list. List indexing starts at 0.
func (ExpressionStepElementKeyIntExact)Equal¶
func (sExpressionStepElementKeyIntExact) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepElementKeyIntExact and the integer element key is equivalent.
func (ExpressionStepElementKeyIntExact)Matches¶
func (sExpressionStepElementKeyIntExact) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepElementKeyIntExact condition.
func (ExpressionStepElementKeyIntExact)String¶
func (sExpressionStepElementKeyIntExact) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepElementKeyStringAny¶
type ExpressionStepElementKeyStringAny struct{}ExpressionStepElementKeyStringAny is an attribute path expression for a matching anystring key within a map.
func (ExpressionStepElementKeyStringAny)Equal¶
func (sExpressionStepElementKeyStringAny) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepElementKeyStringAny.
func (ExpressionStepElementKeyStringAny)Matches¶
func (sExpressionStepElementKeyStringAny) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepElementKeyStringAny condition.
func (ExpressionStepElementKeyStringAny)String¶
func (sExpressionStepElementKeyStringAny) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepElementKeyStringExact¶
type ExpressionStepElementKeyStringExactstring
ExpressionStepElementKeyStringExact is an attribute path expression for an exact stringkey within a map. Map keys are always strings.
func (ExpressionStepElementKeyStringExact)Equal¶
func (sExpressionStepElementKeyStringExact) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepElementKeyStringExact and the string element key is equivalent.
func (ExpressionStepElementKeyStringExact)Matches¶
func (sExpressionStepElementKeyStringExact) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepElementKeyStringExact condition.
func (ExpressionStepElementKeyStringExact)String¶
func (sExpressionStepElementKeyStringExact) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepElementKeyValueAny¶
type ExpressionStepElementKeyValueAny struct{}ExpressionStepElementKeyValueAny is an attribute path expression for a matching anyValue element within a set.
func (ExpressionStepElementKeyValueAny)Equal¶
func (sExpressionStepElementKeyValueAny) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepElementKeyValueAny.
func (ExpressionStepElementKeyValueAny)Matches¶
func (sExpressionStepElementKeyValueAny) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepElementKeyValueAny condition.
func (ExpressionStepElementKeyValueAny)String¶
func (sExpressionStepElementKeyValueAny) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepElementKeyValueExact¶
type ExpressionStepElementKeyValueExact struct {// Value is an interface, so it cannot be type aliased with methods.attr.Value}ExpressionStepElementKeyValueExact is an attribute path expression for an exact Valueelement within a set. Sets do not use integer-based indexing.
func (ExpressionStepElementKeyValueExact)Equal¶
func (sExpressionStepElementKeyValueExact) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is aExpressionStepElementKeyValueExact and the Value element key is equivalent.
func (ExpressionStepElementKeyValueExact)Matches¶
func (sExpressionStepElementKeyValueExact) Matches(pathStepPathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepElementKeyValueExact condition.
func (ExpressionStepElementKeyValueExact)String¶
func (sExpressionStepElementKeyValueExact) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionStepParent¶
type ExpressionStepParent struct{}StepParent is an attribute path expression for a traversing to the parentattribute path relative to the current one. This is intended only for thestart of attribute-level expressions which will be combined with the currentattribute path being called.
func (ExpressionStepParent)Equal¶
func (sExpressionStepParent) Equal(oExpressionStep)bool
Equal returns true if the given ExpressionStep is a ExpressionStepParent.
func (ExpressionStepParent)Matches¶
func (sExpressionStepParent) Matches(_PathStep)bool
Matches returns true if the given PathStep is fulfilled by theExpressionStepParent condition.
func (ExpressionStepParent)String¶
func (sExpressionStepParent) String()string
String returns the human-readable representation of the element keyexpression. It is intended for logging and error messages and is notprotected by compatibility guarantees.
typeExpressionSteps¶
type ExpressionSteps []ExpressionStep
ExpressionSteps represents an ordered collection of attribute pathexpressions.
func (*ExpressionSteps)Append¶
func (s *ExpressionSteps) Append(steps ...ExpressionStep)ExpressionSteps
Append adds the given ExpressionSteps to the end of the previous ExpressionSteps andreturns the combined result.
func (ExpressionSteps)Copy¶
func (sExpressionSteps) Copy()ExpressionSteps
Copy returns a duplicate of the steps that is safe to modify withoutaffecting the original. Returns nil if the original steps is nil.
func (ExpressionSteps)Equal¶
func (sExpressionSteps) Equal(oExpressionSteps)bool
Equal returns true if the given ExpressionSteps are equivalent.
func (ExpressionSteps)LastStep¶
func (sExpressionSteps) LastStep() (ExpressionStep,ExpressionSteps)
LastStep returns the final ExpressionStep and the remaining ExpressionSteps.
func (ExpressionSteps)Matches¶
func (sExpressionSteps) Matches(pathStepsPathSteps)bool
Matches returns true if the given PathSteps match each ExpressionStep.
Any ExpressionStepParent will automatically be resolved.
func (ExpressionSteps)MatchesParent¶
func (sExpressionSteps) MatchesParent(pathStepsPathSteps)bool
MatchesParent returns true if the given PathSteps match each ExpressionStepuntil there are no more PathSteps. This is helpful for determining if thePathSteps would potentially match the full ExpressionSteps duringdepth-first traversal.
Any ExpressionStepParent will automatically be resolved.
func (ExpressionSteps)NextStep¶
func (sExpressionSteps) NextStep() (ExpressionStep,ExpressionSteps)
NextStep returns the first ExpressionStep and the remaining ExpressionSteps.
func (ExpressionSteps)Resolve¶
func (sExpressionSteps) Resolve()ExpressionSteps
Resolve returns a copy of ExpressionSteps without any ExpressionStepParent.
Returns empty ExpressionSteps if any ExpressionStepParent attempt to gobeyond the first element. Returns nil if the original steps is nil.
func (ExpressionSteps)String¶
func (sExpressionSteps) String()string
String returns the human-readable representation of the ExpressionSteps.It is intended for logging and error messages and is not protected bycompatibility guarantees.
typeExpressions¶
type Expressions []Expression
Expressions is a collection of attribute path expressions.
Refer to the Expression documentation for more details about intended usage.
func (*Expressions)Append¶
func (e *Expressions) Append(expressions ...Expression)Expressions
Append adds the given Expressions to the collection without duplication andreturns the combined result.
func (Expressions)Contains¶
func (eExpressions) Contains(checkExpressionExpression)bool
Contains returns true if the collection of expressions includes the givenexpression.
func (Expressions)Matches¶added inv1.1.0
func (eExpressions) Matches(checkPathPath)bool
Matches returns true if one of the expressions in the collection matches thegiven path.
func (Expressions)String¶
func (pExpressions) String()string
String returns the human-readable representation of the expressioncollection. It is intended for logging and error messages and is notprotected by compatibility guarantees.
Empty expressions are skipped.
typePath¶
type Path struct {// contains filtered or unexported fields}Path represents exact traversal steps into a schema or schema-based data.These steps always start from the root of the schema, which is an objectwith zero or more attributes and blocks.
Use the Root() function to create a Path with an initial AtName() step. Pathfunctionality follows a builder pattern, which allows for chaining methodcalls to construct a full path. The available traversal steps after Pathcreation are:
- AtListIndex(): Step into a list at a specific 0-based index
- AtMapKey(): Step into a map at a specific key
- AtName(): Step into an attribute or block with a specific name
- AtSetValue(): Step into a set at a specific attr.Value element
For example, to represent the first list element with a root list attributenamed "some_attribute":
path.MatchRoot("some_attribute").AtListIndex(0)Path is used for functionality which must exactly match the underlyingschema structure and types, such as diagnostics that are intended for aspecific attribute or working with specific attribute values in a schemabased data structure such as tfsdk.Config, tfsdk.Plan, or tfsdk.State.
Refer to Expression for situations where relative or wildcard step logic isdesirable for schema defined functionality, such as attribute validators orattribute plan modifiers.
func (Path)AtListIndex¶
AtListIndex returns a copied path with a new list index step at the end.The returned path is safe to modify without affecting the original.
List indices are 0-based. The first element of a list is 0.
func (Path)AtMapKey¶
AtMapKey returns a copied path with a new map key step at the end.The returned path is safe to modify without affecting the original.
func (Path)AtName¶
AtName returns a copied path with a new attribute or block name step at theend. The returned path is safe to modify without affecting the original.
func (Path)AtSetValue¶
AtSetValue returns a copied path with a new set value step at the end.The returned path is safe to modify without affecting the original.
func (Path)AtTupleIndex¶added inv1.6.0
AtTupleIndex returns a copied path with a new tuple index step at the end.The returned path is safe to modify without affecting the original.
Tuple indices are 0-based. The first element of a tuple is 0.
func (Path)Copy¶
Copy returns a duplicate of the path that is safe to modify withoutaffecting the original.
func (Path)Expression¶
func (pPath) Expression()Expression
Expression returns an Expression which exactly matches the Path.
func (Path)ParentPath¶
ParentPath returns a copy of the path with the last step removed.
If the current path is empty, an empty path is returned.
typePathStep¶
type PathStep interface {// Equal should return true if the given PathStep is exactly equivalent.Equal(PathStep)bool// ExpressionStep should return an ExpressionStep which exactly// matches the PathStep.ExpressionStep()ExpressionStep// String should return a human-readable representation of the step// intended for logging and error messages. There should not be usage// that needs to be protected by compatibility guarantees.String()string// contains filtered or unexported methods}PathStep represents a transversal for an attribute path. Only exact pathtransversals are supported as implementations of this interface must remaincompatible with all protocol implementations.
typePathStepAttributeName¶
type PathStepAttributeNamestring
PathStepAttributeName is an attribute path tranversal for an attribute namewithin an object.
List elements must be transversed by PathStepElementKeyInt.Map elements must be transversed by PathStepElementKeyString.Set elements must be transversed by PathStepElementKeyValue.
func (PathStepAttributeName)Equal¶
func (sPathStepAttributeName) Equal(oPathStep)bool
Equal returns true if the given PathStep is a PathStepAttributeName and theattribute name is equivalent.
func (PathStepAttributeName)ExpressionStep¶
func (sPathStepAttributeName) ExpressionStep()ExpressionStep
ExpressionStep returns the ExpressionStep for the PathStep.
func (PathStepAttributeName)String¶
func (sPathStepAttributeName) String()string
String returns the human-readable representation of the attribute name.It is intended for logging and error messages and is not protected bycompatibility guarantees.
typePathStepElementKeyInt¶
type PathStepElementKeyIntint64
PathStepElementKeyInt is an attribute path transversal for an integerelement of a list. List indexing starts a 0.
Map elements must be transversed by PathStepElementKeyString.Object attributes must be transversed by PathStepAttributeName.Set elements must be transversed by PathStepElementKeyValue.
func (PathStepElementKeyInt)Equal¶
func (sPathStepElementKeyInt) Equal(oPathStep)bool
Equal returns true if the given PathStep is a PathStepAttributeName and theattribute name is equivalent.
func (PathStepElementKeyInt)ExpressionStep¶
func (sPathStepElementKeyInt) ExpressionStep()ExpressionStep
ExpressionStep returns the ExpressionStep for the PathStep.
func (PathStepElementKeyInt)String¶
func (sPathStepElementKeyInt) String()string
String returns the human-readable representation of the element key.It is intended for logging and error messages and is not protected bycompatibility guarantees.
typePathStepElementKeyString¶
type PathStepElementKeyStringstring
PathStepElementKeyString is an attribute path transversal for a stringkey of a map. Map keys are always strings.
List elements must be transversed by PathStepElementKeyInt.Object attributes must be transversed by PathStepAttributeName.Set elements must be transversed by PathStepElementKeyValue.
func (PathStepElementKeyString)Equal¶
func (sPathStepElementKeyString) Equal(oPathStep)bool
Equal returns true if the given PathStep is a PathStepAttributeName and theattribute name is equivalent.
func (PathStepElementKeyString)ExpressionStep¶
func (sPathStepElementKeyString) ExpressionStep()ExpressionStep
ExpressionStep returns the ExpressionStep for the PathStep.
func (PathStepElementKeyString)String¶
func (sPathStepElementKeyString) String()string
String returns the human-readable representation of the element key.It is intended for logging and error messages and is not protected bycompatibility guarantees.
typePathStepElementKeyValue¶
type PathStepElementKeyValue struct {// Value is an interface, so it cannot be type aliased with methods.attr.Value}PathStepElementKeyValue is an attribute path transversal for a Value elementof a set. Sets do not use integer-based indexing.
List elements must be transversed by PathStepElementKeyInt.Map elements must be transversed by PathStepElementKeyString.Object attributes must be transversed by PathStepAttributeName.
func (PathStepElementKeyValue)Equal¶
func (sPathStepElementKeyValue) Equal(oPathStep)bool
Equal returns true if the given PathStep is a PathStepAttributeName and theattribute name is equivalent.
func (PathStepElementKeyValue)ExpressionStep¶
func (sPathStepElementKeyValue) ExpressionStep()ExpressionStep
ExpressionStep returns the ExpressionStep for the PathStep.
func (PathStepElementKeyValue)String¶
func (sPathStepElementKeyValue) String()string
String returns the human-readable representation of the element key.It is intended for logging and error messages and is not protected bycompatibility guarantees.
typePathSteps¶
type PathSteps []PathStep
PathSteps represents an ordered collection of attribute path transversals.
func (*PathSteps)Append¶
Append adds the given PathSteps to the end of the previous PathSteps andreturns the combined result.
func (PathSteps)Copy¶
Copy returns a duplicate of the steps that is safe to modify withoutaffecting the original. Returns nil if the original steps is nil.
func (PathSteps)ExpressionSteps¶
func (sPathSteps) ExpressionSteps()ExpressionSteps
ExpressionSteps returns the ordered collection of expression steps whichexactly matches the PathSteps.
typePaths¶
type Paths []Path
Paths is a collection of exact attribute paths.
Refer to the Path documentation for more details about intended usage.
func (*Paths)Append¶
Append adds the given Paths to the collection without duplication andreturns the combined result.
Source Files¶
- doc.go
- expression.go
- expression_step.go
- expression_step_attribute_name_exact.go
- expression_step_element_key_int_any.go
- expression_step_element_key_int_exact.go
- expression_step_element_key_string_any.go
- expression_step_element_key_string_exact.go
- expression_step_element_key_value_any.go
- expression_step_element_key_value_exact.go
- expression_step_parent.go
- expression_steps.go
- expressions.go
- path.go
- path_step.go
- path_step_attribute_name.go
- path_step_element_key_int.go
- path_step_element_key_string.go
- path_step_element_key_value.go
- path_steps.go
- paths.go