Documentation ¶
Index ¶
- type Instance
- func (i *Instance) Check() error
- func (i *Instance) CheckOrFail(t test.Failer) *Instance
- func (i *Instance) ContainSubstring(substr, path string) *Instance
- func (i *Instance) Equals(expected any, path string, args ...any) *Instance
- func (i *Instance) Exists(path string, args ...any) *Instance
- func (i *Instance) NotExists(path string, args ...any) *Instance
- func (i *Instance) Select(path string, args ...any) *Instance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func ForProto ¶
ForProto creates a structpath Instance by marshaling the proto to JSON and then evaluating over that structure. This is the most generally useful form as serialization to JSON also automatically converts proto.Any and proto.Struct to the serialized JSON forms which can then be evaluated over. The downside is the loss of type fidelity for numeric types as JSON can only represent floats.
func (*Instance) Check ¶
Check executes the set of constraints for this selection and returns the first error encountered, or nil if all constraints have been successfully met. All constraints are removed after them check is performed.
func (*Instance) CheckOrFail ¶
CheckOrFail calls Check on this selection and fails the given test if an error is encountered.