Documentation
¶
Index ¶
- func ToConfig(v Item) any
- func ToConfigFile(m *Model) *config.File
- func Validate(m *Model) error
- type Auth
- type BasicAuth
- type Client
- type DigOutput
- type Endpoint
- type ExecSecret
- type Expander
- type FetchCall
- type FetchOptions
- type FileSecret
- type Flow
- type GRPCClient
- type HTTPClient
- type Item
- type ItemKind
- type JMESPathOutput
- type JSONOutput
- type Link
- type MergeMode
- type Mixin
- type Model
- func (m *Model) Flow(name string) (*Flow, bool)
- func (m *Model) Mixin(name string) (*Mixin, bool)
- func (m *Model) Resolve(spec ServiceSpec, server string, method string, mixins ...string) (*ResolvedResource, error)
- func (m *Model) Search(criteria *SearchCriteria) Searcher
- func (m *Model) Server(spec ServiceSpec) (*Server, bool)
- func (m *Model) Service(name string) (*Service, bool)
- func (m *Model) VarSet(name string) (*VarSet, bool)
- type Output
- type OutputImpl
- type Param
- type Request
- type RequestOption
- type ResolvedResource
- type Resource
- type SearchCriteria
- type Searcher
- type Secret
- type SecretProvider
- type Server
- type Service
- type ServiceSpec
- type SpecStep
- type Step
- type StepImpl
- type TSVOutput
- type TableOutput
- type TemplateOutput
- type URLStep
- type Value
- type Values
- type VarSet
- type WebSocketClient
- type XMLOutput
- type XPathOutput
- type YAMLOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToConfig ¶ added in v0.4.0
ToConfig converts a model value into the corresponding configuration value.
func ToConfigFile ¶ added in v0.6.0
Types ¶
type Client ¶ added in v0.4.0
type Client interface {
Item
// contains filtered or unexported methods
}
type ExecSecret ¶ added in v0.6.0
type ExecSecret struct {
Command string
}
type FetchCall ¶ added in v0.4.0
type FetchCall struct {
URL string
Options FetchOptions
}
FetchCall represents the parsed fetch call
func ParseJSFetchCall ¶ added in v0.4.0
func (FetchCall) ToEndpoint ¶ added in v0.4.0
type FetchOptions ¶ added in v0.4.0
type FetchOptions struct {
Method string `json:"method,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Body string `json:"body,omitempty"`
}
FetchOptions represents common fetch options
type FileSecret ¶ added in v0.6.0
type GRPCClient ¶ added in v0.4.0
type HTTPClient ¶ added in v0.4.0
type HTTPClient struct {
}
type Item ¶ added in v0.6.0
type Item interface {
// contains filtered or unexported methods
}
Item is a value within the model.
type ItemKind ¶ added in v0.6.0
type ItemKind int
ItemKind enumerates the kinds of items within a model which can be searched.
type JMESPathOutput ¶ added in v0.4.0
type JMESPathOutput struct {
Query string
}
type JSONOutput ¶ added in v0.4.0
type JSONOutput struct {
Pretty bool
}
type MergeMode ¶ added in v0.6.0
type MergeMode int
MergeMode indicates how a Value's values are combined during a reduce.
type Model ¶
type Model struct {
Services []*Service
VarSets []*VarSet
Flows []*Flow
Mixins []*Mixin
// contains filtered or unexported fields
}
func (*Model) Resolve ¶
func (m *Model) Resolve(spec ServiceSpec, server string, method string, mixins ...string) (*ResolvedResource, error)
Resolve locates the resource named by the spec, optionally within the named server and using the given request method. Any mixins which are named are applied as the last layer of the resolution.
func (*Model) Search ¶ added in v0.6.0
func (m *Model) Search(criteria *SearchCriteria) Searcher
Search provides a searcher over the items in the model which match the criteria.
type OutputImpl ¶ added in v0.6.1
type OutputImpl interface {
// contains filtered or unexported methods
}
type Request ¶ added in v0.4.0
type Request struct {
URL *url.URL
Body io.ReadCloser
Headers http.Header
Vars map[string]any
Links []Link
Auth Auth
Expander e.Interface
}
func NewRequest ¶ added in v0.4.0
func NewRequest(r *ResolvedResource, opts ...RequestOption) (*Request, error)
type RequestOption ¶ added in v0.4.0
type RequestOption interface {
// contains filtered or unexported methods
}
func WithBaseURL ¶ added in v0.4.0
func WithBaseURL(baseURL *url.URL) RequestOption
func WithContext ¶ added in v0.6.0
func WithContext(vs *VarSet) RequestOption
func WithModel ¶ added in v0.6.0
func WithModel(m *Model) RequestOption
WithModel makes the model available so that the "var" expander can resolve qualified names from any varset in the model rather than only from vars.
func WithVars ¶ added in v0.4.0
func WithVars(vars map[string]any) RequestOption
type ResolvedResource ¶
type ResolvedResource struct {
Service *Service
Resource *Resource
Lineage []*Resource
Endpoint *Endpoint
Server *Server
// Mixins are the mixins which were selected for the request, in the
// order that they are applied.
Mixins []*Mixin
Output []*Output
Secrets []*Secret
Client Client
Params []*Param
// contains filtered or unexported fields
}
ResolvedResource represents the resource which was selected by its name
type Resource ¶
type Resource struct {
Name string
Comment string
Title string
Description string
Tags []string
Resources []*Resource
Endpoints []*Endpoint
URITemplate *uritemplates.URITemplate
Headers Values
Query Values
Form Values
Links []Link
Command []string
Body any
RawBody any
Vars map[string]any
Params []*Param
Auth Auth
Output []*Output
}
type SearchCriteria ¶ added in v0.6.0
type SearchCriteria struct {
// Spec names the items to search for. For var sets, services, and flows,
// the spec must be just a name because these don't nest, but for resources
// or endpoints, this could be a qualifying name. When the spec is empty,
// all items of the given kind are considered.
Spec *ServiceSpec
// Kind identifies which kind of item is searched for.
Kind ItemKind
// IncludeTags filters items to those which have all of these tags. When
// empty, no filtering on tags occurs.
IncludeTags []string
// Method filters endpoints to those which use this request method. It is
// only relevant to endpoints.
Method string
}
SearchCriteria is the union of all of the criteria which are relevant to each kind of searcher.
type Searcher ¶ added in v0.6.0
Searcher enumerates the items within a model which match a search criteria.
type SecretProvider ¶ added in v0.6.0
type SecretProvider interface {
// contains filtered or unexported methods
}
type Service ¶
type ServiceSpec ¶
type ServiceSpec []string
func ParseServiceSpec ¶ added in v0.5.0
func ParseServiceSpec(text string) (ServiceSpec, error)
ParseServiceSpec parses a service spec
func (ServiceSpec) NewCounter ¶
func (s ServiceSpec) NewCounter() cli.ArgCounter
func (ServiceSpec) Path ¶
func (s ServiceSpec) Path() string
func (ServiceSpec) ServiceName ¶
func (s ServiceSpec) ServiceName() string
func (*ServiceSpec) Set ¶
func (s *ServiceSpec) Set(arg string) error
func (ServiceSpec) String ¶
func (s ServiceSpec) String() string
type SpecStep ¶ added in v0.5.0
type SpecStep struct {
Spec ServiceSpec
}
type StepImpl ¶ added in v0.6.1
type StepImpl interface {
// contains filtered or unexported methods
}
type TableOutput ¶ added in v0.5.0
type TemplateOutput ¶ added in v0.4.0
type Values ¶ added in v0.6.0
type Values []Value
Values is a list of named values. It mirrors config.Values within the model and provides the reduce semantics used when resolving values across the service, server, resource, and endpoint layers.
func (Values) Reduce ¶ added in v0.6.0
Reduce combines the receiver with the more-specific next values, honoring each incoming value's merge mode. A value with the same name is appended to or replaces the existing one; a value with a new name is added.
func (Values) ToURLValues ¶ added in v0.6.0
ToURLValues converts the values into a url.Values.
type VarSet ¶ added in v0.5.0
type VarSet struct {
Name string
Comment string
Title string
Description string
Tags []string
Links []Link
Vars map[string]map[string]any
}
func (*VarSet) Resolve ¶ added in v0.6.0
Resolve looks up the value used to fill the variable named target, at the given dotted path within the varset. The first path segment names a group within Vars. When the path names only the group, the property within that group whose name matches target is used instead.
type WebSocketClient ¶ added in v0.6.0
type WebSocketClient struct {
}
type XPathOutput ¶ added in v0.4.0
type XPathOutput struct {
Query string
}
type YAMLOutput ¶ added in v0.4.0
type YAMLOutput struct {
}