jq

package
v0.0.0-...-5ea7d2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 9 Imported by: 0

README

jq

import "github.com/eclipse-symphony/symphony/packages/testutils/conditions/jq"

Index

type JqCondition

type JqCondition struct {
    // contains filtered or unexported fields
}

func Equality
func Equality(path string, value interface{}, opts ...Option) *JqCondition

Equality returns a new JqCondition that checks if the value at the given path resolves to the given value exactly.

func MustNew
func MustNew(path string, opts ...Option) *JqCondition

MustNew returns a new JqCondition. It panics if the condition cannot be created.

func New
func New(path string, opts ...Option) (*JqCondition, error)

New returns a new JqCondition.

func (*JqCondition) Description
func (j *JqCondition) Description() string

Description implements condition.Condition.

func (*JqCondition) Id
func (j *JqCondition) Id() string

Id implements condition.Condition.

func (*JqCondition) IsSatisfiedBy
func (j *JqCondition) IsSatisfiedBy(c context.Context, resource interface{}) error

IsSatisfiedBy implements condition.Condition.

type Option

type Option func(*JqCondition)

func WithCustomMatcher
func WithCustomMatcher(matcher func(ctx context.Context, value, root interface{}, log logger.Logger) error) Option

WithCustomMatcher specifies the matcher to be used to match the jq result.

func WithDescription
func WithDescription(description string) Option

WithDescription specifies the description of the condition.

func WithLogger
func WithLogger(log func(format string, args ...interface{})) Option

WithLogger specifies the logger to be used to log the jq operations.

func WithValue
func WithValue(value interface{}) Option

WithValue does an equality check on the jq result.

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JqCondition

type JqCondition struct {
	// contains filtered or unexported fields
}

func Equality

func Equality(path string, value interface{}, opts ...Option) *JqCondition

Equality returns a new JqCondition that checks if the value at the given path resolves to the given value exactly.

func MustNew

func MustNew(path string, opts ...Option) *JqCondition

MustNew returns a new JqCondition. It panics if the condition cannot be created.

func New

func New(path string, opts ...Option) (*JqCondition, error)

New returns a new JqCondition.

func (*JqCondition) Description

func (j *JqCondition) Description() string

Description implements condition.Condition.

func (*JqCondition) Id

func (j *JqCondition) Id() string

Id implements condition.Condition.

func (*JqCondition) IsSatisfiedBy

func (j *JqCondition) IsSatisfiedBy(c context.Context, resource interface{}) error

IsSatisfiedBy implements condition.Condition.

type Option

type Option func(*JqCondition)

func WithCustomMatcher

func WithCustomMatcher(matcher func(ctx context.Context, value, root interface{}, log logger.Logger) error) Option

WithCustomMatcher specifies the matcher to be used to match the jq result.

func WithDescription

func WithDescription(description string) Option

WithDescription specifies the description of the condition.

func WithLogger

func WithLogger(log func(format string, args ...interface{})) Option

WithLogger specifies the logger to be used to log the jq operations.

func WithValue

func WithValue(value interface{}) Option

WithValue does an equality check on the jq result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL