api

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateApiDomain added in v0.6.0

func CreateApiDomain(spec *ApiSpec) (types.Domain, error)

Types

type ApiDomain

type ApiDomain struct {
	// Spec is the specification of the API requests
	Spec *ApiSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
}

ApiDomain is a domain that is defined by a list of API requests

func (ApiDomain) GetResources

func (a ApiDomain) GetResources(ctx context.Context) (types.DomainResources, error)

func (ApiDomain) IsExecutable added in v0.4.0

func (a ApiDomain) IsExecutable() bool

type ApiOpts added in v0.11.0

type ApiOpts struct {
	// Timeout in seconds
	Timeout string            `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Proxy   string            `json:"proxy,omitempty" yaml:"proxy,omitempty"`
	Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
	// contains filtered or unexported fields
}

type ApiSpec

type ApiSpec struct {
	Requests []Request `mapstructure:"requests" json:"requests" yaml:"requests"`
	// Opts will be applied to all requests, except those which have their own
	// specified ApiOpts
	Options *ApiOpts `mapstructure:"options" json:"options,omitempty" yaml:"options,omitempty"`
}

ApiSpec contains a list of API requests

type Request

type Request struct {
	Name   string            `json:"name" yaml:"name"`
	URL    string            `json:"url" yaml:"url"`
	Params map[string]string `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	// ApiOpts specific to this request. If ApiOpts is present, values in the
	// ApiSpec-level Options are ignored for this request.
	Options *ApiOpts `json:"options,omitempty" yaml:"options,omitempty"`
	// contains filtered or unexported fields
}

Request is a single API request

Jump to

Keyboard shortcuts

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