Documentation
¶
Index ¶
- func ResponseForVerb(sch *schema.Schema, verb *schema.Verb, response HTTPResponse) ([]byte, http.Header, error)
- func SchemaToOpenAPI(sch *schema.Schema) (*spec.Swagger, error)
- func ServeOpenAPI(sch *schema.Schema, w http.ResponseWriter, r *http.Request) bool
- func Start(ctx context.Context, bind *url.URL, config Config, ...) error
- type Config
- type HTTPResponse
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResponseForVerb ¶
func ResponseForVerb(sch *schema.Schema, verb *schema.Verb, response HTTPResponse) ([]byte, http.Header, error)
ResponseForVerb returns the HTTP response for a given verb.
func SchemaToOpenAPI ¶ added in v0.460.0
SchemaToOpenAPI converts an FTL schema to an OpenAPI specification.
func ServeOpenAPI ¶ added in v0.466.0
func Start ¶
func Start(ctx context.Context, bind *url.URL, config Config, eventSource *schemaeventsource.EventSource, client routing.CallClient, timelineClient *timelineclient.Client) error
Start the HTTP ingress service. Blocks until the context is cancelled.
Types ¶
type Config ¶
type Config struct {
AllowOrigins []string `help:"Allow CORS requests to ingress endpoints from these origins." env:"FTL_INGRESS_ALLOW_ORIGIN"`
AllowHeaders []string `help:"Allow these headers in CORS requests. (Requires AllowOrigins)" env:"FTL_INGRESS_ALLOW_HEADERS"`
IngressURLPrefix string `help:"URL prefix for ingress endpoints." env:"FTL_INGRESS_URL_PREFIX" default:""`
}
type HTTPResponse ¶
type HTTPResponse struct {
Status int `json:"status,omitempty"`
Headers map[string][]string `json:"headers,omitempty"`
Body json.RawMessage `json:"body,omitempty"`
Error json.RawMessage `json:"error,omitempty"`
}
HTTPResponse mirrors builtins.HttpResponse.
Click to show internal directories.
Click to hide internal directories.