github.com/instill-ai/component@v0.16.0-beta/pkg/jsonref/interface.go (about)

     1  // The following code is based on lestrrat's work, available at https://github.com/lestrrat-go/jsref.
     2  
     3  package jsonref
     4  
     5  import (
     6  	"errors"
     7  	"net/url"
     8  	"reflect"
     9  )
    10  
    11  var zeroval = reflect.Value{}
    12  
    13  var ErrMaxRecursion = errors.New("reached max number of recursions")
    14  var ErrReferenceLoop = errors.New("reference loop detected")
    15  
    16  // Resolver is responsible for interpreting the provided JSON
    17  // reference.
    18  type Resolver struct {
    19  	providers     []Provider
    20  	MaxRecursions int
    21  }
    22  
    23  // Provider resolves a URL into a ... thing.
    24  type Provider interface {
    25  	Get(*url.URL) (interface{}, error)
    26  }