Documentation
¶
Index ¶
- type API
- type Action
- type ActionMeta
- type ActionMetaE5EAsyncFunction
- type ActionMetaE5EAsyncResult
- type ActionMetaE5EFunction
- type ActionMetaMockResponse
- type ActionMetaURLRewrite
- type ActionType
- type Deployment
- func (d *Deployment) DecodeAPIResponse(ctx context.Context, data io.Reader) error
- func (d *Deployment) EndpointURL(ctx context.Context) (*url.URL, error)
- func (d *Deployment) FilterAPIRequestBody(ctx context.Context) (interface{}, error)
- func (*Deployment) FilterAPIResponse(ctx context.Context, res *http.Response) (*http.Response, error)
- func (o *Deployment) GetIdentifier(ctx context.Context) (string, error)
- type Endpoint
- type TransferProtocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Identifier string `json:"identifier,omitempty" anxcloud:"identifier"` Name string `json:"name,omitempty"` Description *string `json:"description,omitempty"` TransferProtocol string `json:"transfer_protocol,omitempty"` DeploymentIdentifier string `json:"deployment_identifier,omitempty"` // contains filtered or unexported fields }
API represents Frontier's root object and contains a collection of endpoints. The API defines the transfer protocol, such as HTTP and HTTPS, for all containing endpoints.
func (*API) EndpointURL ¶
EndpointURL returns the base URL path of the resources API
func (*API) FilterAPIResponse ¶
type Action ¶
type Action struct { Identifier string `json:"identifier,omitempty" anxcloud:"identifier"` EndpointIdentifier string `json:"endpoint_identifier,omitempty"` HTTPRequestMethod string `json:"http_request_method,omitempty"` Type ActionType `json:"type,omitempty"` Meta *ActionMeta `json:"meta,omitempty"` // contains filtered or unexported fields }
Action represents the lowest entity within Frontier's hierarchy and maps HTTP methods for an endpoint to action handlers. Those action handlers may be e5e functions, other HTTP-based APIs or mock responses.
func (*Action) EndpointURL ¶
EndpointURL returns the base URL path of the resources API
func (*Action) FilterAPIResponse ¶
type ActionMeta ¶
type ActionMeta struct { *ActionMetaURLRewrite *ActionMetaMockResponse *ActionMetaE5EFunction *ActionMetaE5EAsyncFunction *ActionMetaE5EAsyncResult }
ActionMeta is used to configure an Action based on its Type
type ActionMetaE5EAsyncFunction ¶
type ActionMetaE5EAsyncFunction struct {
FunctionIdentifier string `json:"e5e_async_function_function,omitempty"`
}
ActionMetaE5EAsyncFunction is used to configure a resource of type "e5e_async_function"
type ActionMetaE5EAsyncResult ¶
type ActionMetaE5EAsyncResult struct {
FunctionIdentifier string `json:"e5e_async_result_function,omitempty"`
}
ActionMetaE5EAsyncResult is used to configure a resource of type "e5e_async_result"
type ActionMetaE5EFunction ¶
type ActionMetaE5EFunction struct {
FunctionIdentifier string `json:"e5e_function_function,omitempty"`
}
ActionMetaE5EFunction is used to configure a resource of type "e5e_function"
type ActionMetaMockResponse ¶
type ActionMetaMockResponse struct { Body string `json:"mock_response_body,omitempty"` Language string `json:"mock_response_language,omitempty"` }
ActionMetaMockResponse is used to configure a resource of type "mock_response"
type ActionMetaURLRewrite ¶
type ActionMetaURLRewrite struct {
URL string `json:"url_rewrite_url,omitempty"`
}
ActionMetaURLRewrite is used to configure a resource of type "url_rewrite"
type ActionType ¶
type ActionType string
const ( // ActionTypeURLRewrite configures a rewrite to another URL ActionTypeURLRewrite ActionType = "url_rewrite" // ActionTypeMockResponse configures the action to return mock data ActionTypeMockResponse ActionType = "mock_response" // ActionTypeE5EFunction configures the action to synchronously call an e5e function ActionTypeE5EFunction ActionType = "e5e_function" // ActionTypeE5EAsyncFunction configures the action to asynchronously call an e5e function ActionTypeE5EAsyncFunction ActionType = "e5e_async_function" // ActionTypeE5EAsyncResult configures the action to fetch an asynchronously e5e function result ActionTypeE5EAsyncResult ActionType = "e5e_async_result" )
type Deployment ¶
type Deployment struct { Identifier string `json:"identifier,omitempty" anxcloud:"identifier"` APIIdentifier string `json:"api_identifier,omitempty"` Name string `json:"name,omitempty"` Slug string `json:"slug,omitempty"` State string `json:"state,omitempty"` // contains filtered or unexported fields }
Deployment represents a published version of a Frontier API with all its endpoints and actions exactly as it was at the time it was deployed. Note that using api.Create on a `Deployment` only sets the Deployments `Identifier`. Use api.Get on the same struct instance to retrieve all data.
func (*Deployment) DecodeAPIResponse ¶
DecodeAPIResponse is a hook that extracts the identifier from the deviating response format when creating a Deployment
func (*Deployment) EndpointURL ¶
EndpointURL returns the base URL path of the resources API Deployments are created via the (frontier) api API
func (*Deployment) FilterAPIRequestBody ¶
func (d *Deployment) FilterAPIRequestBody(ctx context.Context) (interface{}, error)
FilterAPIRequestBody is a hook that handles the deviating request format expected when creating a Deployment
func (*Deployment) FilterAPIResponse ¶
func (*Deployment) GetIdentifier ¶
func (o *Deployment) GetIdentifier(ctx context.Context) (string, error)
GetIdentifier returns the primary identifier of a Deployment object
type Endpoint ¶
type Endpoint struct { Identifier string `json:"identifier,omitempty" anxcloud:"identifier"` Name string `json:"name,omitempty"` Path string `json:"path,omitempty"` APIIdentifier string `json:"api_identifier,omitempty"` // contains filtered or unexported fields }
Endpoint represents a path within an HTTP-based API and contains a collection of actions.
func (*Endpoint) EndpointURL ¶
EndpointURL returns the base URL path of the resources API
func (*Endpoint) FilterAPIResponse ¶
type TransferProtocol ¶
type TransferProtocol string
const (
TransferProtocolHTTP TransferProtocol = "http"
)