github.com/MontFerret/ferret@v0.18.0/pkg/runtime/core/getter.go (about)

     1  package core
     2  
     3  import "context"
     4  
     5  type (
     6  	GetterPathIterator interface {
     7  		Path() []Value
     8  		Current() Value
     9  		CurrentIndex() int
    10  	}
    11  
    12  	// Getter represents an interface of
    13  	// complex types that needs to be used to read values by path.
    14  	// The interface is created to let user-defined types be used in dot notation data access.
    15  	Getter interface {
    16  		GetIn(ctx context.Context, path []Value) (Value, PathError)
    17  	}
    18  
    19  	// GetterFn represents a type of helper functions that implement complex path resolutions.
    20  	GetterFn func(ctx context.Context, path []Value, src Getter) (Value, PathError)
    21  )