Documentation
¶
Overview ¶
Package model defines Flowi's domain types as plain data. It performs no I/O and holds no behaviour beyond small structural helpers; storage, validation and execution live in other packages.
Index ¶
- Constants
- Variables
- func AsyncBindings(p string) []string
- func AsyncCredentials(p string) []string
- func AsyncProtocols() []string
- func AsyncSchemes(p string) []string
- func AuthParams(authType string) []string
- func AuthSecretParams(authType string) []string
- func AuthTypes() []string
- func CloudProtocol(p string) bool
- func DatasetDrivers() []string
- func DefaultEnvColour(name string) string
- func EnvColours() []string
- func GRPCTarget(server string) (hostport string, useTLS bool)
- func GRPCTargetURL(server, method string) string
- func InputTypes() []string
- func JoinURL(server, channel string) string
- func KnownMethod(name string) (spelling string, known bool)
- func KnownProtocol(p string) bool
- func MoreMethods() []string
- func NodeColors() []string
- func NormalizeServer(protocol, server string) string
- func ProtocolOfVerb(verb string) string
- func ProtocolVerb(protocol string) string
- func RedactedTarget(target string) string
- func RemovedNodeTypes() map[NodeType]string
- func SplitMethod(m string) (service, method string, ok bool)
- func StandardMethods() []string
- func TargetURL(protocol, server, channel string) string
- func ValidMethod(name string) bool
- func ValidOutcomeName(name string) bool
- type Arrow
- type Async
- type AsyncReceive
- type AsyncSend
- type Auth
- type Blueprint
- type Body
- type Branch
- type Case
- type Collection
- type Dataset
- type Dependency
- type EnvVar
- type Environment
- type Exchange
- type Execution
- type Extraction
- type Family
- type Field
- type Flow
- type Folder
- type GRPC
- type HookControl
- type HookStep
- type Hooks
- type ID
- type Input
- type KeyValue
- type Layout
- type Manifest
- type Meta
- type Mount
- type Node
- type NodeType
- type Outcome
- type Output
- type Overlay
- type OverlayOp
- type Param
- type ParamType
- type Point
- type Ref
- type Request
- type RequestCall
- type RequestOverlay
- type RequestVersion
- type RunTill
- type Schedule
- type SetValue
- type Settings
- type SubflowCall
- type VarKind
- type Workspace
Constants ¶
const ( ProtocolWS = "ws" ProtocolSSE = "sse" ProtocolMQTT = "mqtt" ProtocolKafka = "kafka" ProtocolAMQP = "amqp" // AMQP 0-9-1 (RabbitMQ and compatible) ProtocolNATS = "nats" // ProtocolAMQP10 is AMQP 1.0 (ActiveMQ Artemis, Qpid, IBM MQ, RabbitMQ 4 ...), a different protocol from AMQP 0-9-1. ProtocolAMQP10 = "amqp10" // Managed messaging and Redis (ADR 0019). ProtocolRedis = "redis" ProtocolSQS = "sqs" ProtocolSNS = "sns" ProtocolServiceBus = "servicebus" ProtocolPubSub = "pubsub" )
The async protocols a request can speak.
const ( AuthDefault = "default" // the provider's own credential lookup AuthExplicit = "explicit" // the credential bindings of the request )
Values of the `auth` binding of the cloud protocols.
const ( AuthAPIKey = "apikey" AuthDigest = "digest" AuthOAuth2 = "oauth2" AuthOAuth1 = "oauth1" AuthAWSSigV4 = "aws_sigv4" AuthJWT = "jwt" AuthHawk = "hawk" AuthMutualTLS = "mtls" AuthNTLM = "ntlm" AuthHTTPSig = "httpsig" // RFC 9421 HTTP Message Signatures AuthDPoP = "dpop" // RFC 9449 proof of possession )
The authentication schemes a request version can name in its auth block (beyond a plain Authorization header, which the Auth tab also writes).
const ( DriverPostgres = "postgres" DriverMySQL = "mysql" DriverMariaDB = "mariadb" DriverSQLite = "sqlite" )
The dataset drivers.
const ( GRPCSchemePlaintext = "grpc" GRPCSchemeTLS = "grpcs" )
The URL schemes of a gRPC server.
const ( OutcomeSuccess = "success" OutcomeFailure = "failure" )
The two outcomes every step has unless a request says otherwise: it passed (success) or it failed (failure: the request, its hooks or its asserts failed, or it could not be sent).
const ( OverlaySet = "set" // give a field or entry a value OverlayRemove = "remove" // take an entry away OverlayAdd = "add" // append a line to a list (assert) OverlayMerge = "merge" // merge-patch a JSON body )
Operation verbs of a flowi overlay.
const ( AsyncSendOnly = "send" AsyncReceiveOnly = "receive" AsyncRequestReply = "request_reply" )
The actions an Async version can have.
const DefaultDatasetLimit = 1000
DefaultDatasetLimit is how many rows a dataset request keeps when it sets no limit.
const ProtocolVerbGRPC = "GRPC"
ProtocolVerbGRPC is what a gRPC request shows where an HTTP request shows its method.
Variables ¶
var ( ErrEnvironmentBase = errors.New("base environment not found") ErrEnvironmentLoop = errors.New("environments extend each other in a loop") )
Errors EnvironmentChain wraps, so a caller can tell a missing base from a loop.
Functions ¶
func AsyncBindings ¶
AsyncBindings are the binding names protocol p understands.
func AsyncCredentials ¶
AsyncCredentials are the binding names of protocol p that hold credentials.
func AsyncProtocols ¶
func AsyncProtocols() []string
AsyncProtocols lists the protocols in catalogue order.
func AsyncSchemes ¶
AsyncSchemes are the URL schemes a server of protocol p may use.
func AuthParams ¶
AuthParams lists the parameter names a scheme understands, in the order a form shows them; nil for an unknown scheme.
func AuthSecretParams ¶
AuthSecretParams are the parameters of a scheme that hold credentials, which a description or a snippet must not write out.
func CloudProtocol ¶
CloudProtocol reports whether p is a cloud service with an `auth` mode: the provider's default login, or the explicit credential bindings.
func DatasetDrivers ¶
func DatasetDrivers() []string
DatasetDrivers lists the drivers in the order a picker shows them.
func DefaultEnvColour ¶
DefaultEnvColour is the colour a new environment of that name starts with: red for a name that begins with "prod" (any case), since that is the environment where a slip costs the most.
func EnvColours ¶
func EnvColours() []string
EnvColours are the colours an environment can be marked with.
func GRPCTarget ¶
GRPCTarget is the host and port to dial and whether to use TLS. A scheme decides; a bare host:port is plaintext for the local machine (localhost, 127.0.0.1, ::1) and TLS for any other host.
func GRPCTargetURL ¶
GRPCTargetURL is where a gRPC call goes, for display: the server with the scheme the call will use, then the method. A templated server is shown as written, since its scheme is only known when it runs.
func InputTypes ¶
func InputTypes() []string
InputTypes are the types a flow input or output may declare; "" means any.
func JoinURL ¶
JoinURL puts a channel after a server URL: "wss://h" and "events" give "wss://h/events"; an empty channel leaves the server alone.
func KnownMethod ¶
KnownMethod says whether name is a method Flowi knows by name, ignoring case, and returns its usual spelling. Method names are case-sensitive on the wire: "query" is not QUERY, so a lower-case known name is worth a warning.
func KnownProtocol ¶
KnownProtocol reports whether p is an async protocol.
func MoreMethods ¶
func MoreMethods() []string
MoreMethods are other methods in use that a person may need: the WebDAV and CalDAV family and SEARCH (registered with IANA), LINK and UNLINK, and PURGE, which CDNs and caches use and which is not registered.
func NodeColors ¶
func NodeColors() []string
NodeColors are the colours a person may give a step on the canvas. A step with no colour is drawn in its category's colour.
func NormalizeServer ¶
NormalizeServer writes out the scheme of a server that left it off: a NATS or Kafka server is often written as host:port, a Service Bus one as the namespace host. A templated server, one with a scheme and one of a protocol with several schemes are returned as given.
func ProtocolOfVerb ¶
ProtocolOfVerb is the protocol a verb stands for, or "" when it is not one (an HTTP method).
func ProtocolVerb ¶
ProtocolVerb is the short upper-case name a protocol shows where an HTTP request shows its method: MQTT, WS, … BUS for Service Bus and AMQP1 for AMQP 1.0.
func RedactedTarget ¶
RedactedTarget hides the password of user:password@ in a URL-like target, for anything recorded or shown. A user name alone is left as it is.
func RemovedNodeTypes ¶
RemovedNodeTypes maps a node type that no longer exists to what replaces it, so a file that still uses one fails with a message that says what to write instead.
func SplitMethod ¶
SplitMethod splits package.Service/Method into the service and method names. A leading slash (grpcurl's way of writing it) is allowed.
func StandardMethods ¶
func StandardMethods() []string
StandardMethods are the HTTP methods of the core standards, in the order a picker offers them. QUERY is RFC 10008 (June 2026): a safe, idempotent request that carries a body.
func TargetURL ¶
TargetURL is where an async request goes, for display and for the protocols that connect to a path: the server and channel joined. For SSE the channel names the event to keep, not a path, so the server alone is the URL.
func ValidMethod ¶
ValidMethod says whether name can be sent as an HTTP method: a token (RFC 9110), which is one or more of letters, digits and !#$%&'*+-.^_`|~ and nothing else. It does not say the server knows it.
func ValidOutcomeName ¶
ValidOutcomeName says whether name can name an outcome: letters, digits, '-' and '_', not starting with '-'. A ':' is how an after_outcome entry joins a step and an outcome, so it cannot be in the name.
Types ¶
type Arrow ¶
Arrow is a line into a step: the step it leaves, and the outcomes of that step that take it. Success and failure have flags; any other outcome of the step's request is named in On.
type Async ¶
type Async struct {
Protocol string // ws, sse, mqtt, kafka, amqp or nats
Server string // templated; e.g. mqtt://host:1883
Channel string // topic, subject, queue, or routing key
Send *AsyncSend
Receive *AsyncReceive
// Binding is the protocol's own options (qos, key, exchange, …), in
// file order; the allowed names depend on the protocol.
Binding []KeyValue
}
Async is what an async request version does: it sends a message to a channel, receives messages from it, or both (request and reply).
type AsyncReceive ¶
type AsyncReceive struct {
Count int
Timeout time.Duration
// Match, when set, is an expression a message must satisfy to count.
Match string
}
AsyncReceive says which messages an async request waits for. Count 0 means 1 and Timeout 0 means 30s when it runs.
type Auth ¶
Auth is a version's authentication scheme and its parameters, in file order. Every value is a template, so credentials come from the vault ({{secret.client_secret}}) and never sit in the file.
type Blueprint ¶
type Blueprint struct {
Meta
Path string
// Phase says which hooks of a request the blueprint's nodes can be: "pre"
// or "post"; empty means post. It does not matter to a blueprint used to
// make a flow.
Phase string
Params []Param
// Outcomes are the outcomes a request starts with when it is seeded from the blueprint (see Outcome): the
// same list for the request's opening version, unless that already writes its own.
Outcomes []Outcome
Body Flow
File string
}
Blueprint is a flow template with declared parameters (design §4.8). Body holds the flow's inputs, outputs, execution, run settings and nodes; its identity fields are unused. Using a blueprint makes an ordinary flow and leaves no link back. Path is relative to blueprints/ without the suffix.
type Collection ¶
type Collection struct {
Root string
Manifest Manifest
Folders []Folder
Environments []Environment
Requests []Request
Flows []Flow
Blueprints []Blueprint
Overlays []Overlay
}
Collection is everything loaded from one collection directory.
func (Collection) FlowTags ¶
func (c Collection) FlowTags(f Flow) []string
FlowTags lists the tags of f: those of the folders it sits under, outermost first, then its own. A tag appears once, and the list is sorted.
func (Collection) FlowsTagged ¶
func (c Collection) FlowsTagged(tag string) []Flow
FlowsTagged lists the flows that carry tag, in file order.
func (Collection) RequestTags ¶
func (c Collection) RequestTags(r Request) []string
RequestTags lists the tags of r, as FlowTags does for a flow.
type Dataset ¶
type Dataset struct {
// Driver is the store: postgres, mysql, mariadb or sqlite.
Driver string
// Server is the connection string, templated: a postgres:// or mysql:// URL, or for sqlite a file path
// relative to the collection.
Server string
// Query is one SELECT (or WITH, VALUES, SHOW, EXPLAIN, DESCRIBE) statement. It is not templated: values go in
// Params, which are sent to the store separately from the statement, so a value can never change what the
// statement means.
Query string
// Params are the values of the query's placeholders, in order, templated. Placeholders are $1, $2 … for postgres
// and sqlite, and ? for mysql, mariadb and sqlite.
Params []string
// Limit is the most rows kept; 0 means DefaultDatasetLimit. More rows than that are cut and the result says so.
Limit int
}
Dataset is what a dataset request version does: it runs one read-only query against a data store and keeps the rows it returns.
type Dependency ¶
type Dependency struct {
ID ID
Name string
Repo string // optional clone URL shown when the dependency is not mounted
}
Dependency is another collection this one references.
type EnvVar ¶
type EnvVar struct {
Name string
Value string // the text form; for VarJSON, JSON text
Secret bool
// Kind says what Value is read as. "" is text. A number, a boolean or an object keeps its type when
// the variable is used on its own, so {"n": {{env.count}}} sends a number and not "5".
Kind VarKind
}
EnvVar is one environment variable. When Secret is set, Value is empty: the value lives in the workspace vault.
type Environment ¶
type Environment struct {
Meta
Vars []EnvVar
File string
// Colour marks the environment wherever it is chosen, so that one is not mistaken for another.
// It is one of EnvColours(), or empty for the default; an unknown name is shown as the default.
Colour string
// Extends names the environment this one builds on: its plain variables apply unless this one sets the same name.
// Secrets are not inherited, because a secret's value lives in the vault under the environment that declares it.
Extends string
// Scope is the vault scope of this environment's secrets. Empty means
// the owning collection; global environments carry the workspace scope.
Scope ID
}
Environment is a named set of variables. Name defaults to the file stem.
func EnvironmentChain ¶
func EnvironmentChain(envs []Environment, name string) ([]Environment, error)
EnvironmentChain lists the environment called name and the ones it extends, base first. A base that is not in envs, or a loop, is an error that names the environment at fault.
type Exchange ¶
type Exchange uint8
Exchange is which directions a request has: what it sends and what it receives.
const ( // SendOnly sends and does not wait for an answer (a published message). SendOnly Exchange = iota + 1 // ReceiveOnly waits for what arrives and sends nothing (a subscription). ReceiveOnly // SendReceive sends and receives the answer (an HTTP request, a gRPC call, a query, request and reply). SendReceive )
The exchanges.
type Execution ¶
type Execution struct {
MaxConcurrency int
RateLimit string
HostRateLimits []KeyValue
OnBranchError string
}
Execution controls where concurrency is allowed to go. RateLimit applies to every host; HostRateLimits to the hosts they name.
type Extraction ¶
type Extraction struct {
Name string
From string
Path string
Header string
Cookie string
Regex string
}
Extraction names a value taken from a response. From is one of body, header, cookie or status; the matching selector field is set.
type Family ¶
type Family string
Family is the kind of conversation a request has with what it talks to. Every request version belongs to exactly one family; what differs inside a family (an HTTP method, a message protocol, a SQL driver) is that family's own detail. New kinds of request are new families, not new branches in the code that handles the existing ones.
const ( // FamilyHTTP is a request and its response over HTTP. FamilyHTTP Family = "http" // FamilyRPC is a call of a method of a remote service (gRPC). FamilyRPC Family = "rpc" // FamilyMessaging is a message sent to or received from a channel (WebSocket, SSE, MQTT, Kafka, AMQP, NATS, …). FamilyMessaging Family = "messaging" // FamilyDataset is a query of a data store, answered with rows (SQL). FamilyDataset Family = "dataset" )
The families.
type Field ¶
Field is an ordered key with an arbitrary YAML value: string, bool, int64, float64, []any, []Field or nil.
type Flow ¶
type Flow struct {
Meta
// Tags label the flow for `flowi run --tag`; the tags of its folders apply as well.
Tags []string
Path string
PreferVersion string
Inputs []Input
Outputs []Output // rendered when the flow ends, in this order
Execution Execution
Run *RunTill
Nodes []Node
File string
}
Flow is a graph of nodes. Path is relative to flows/ without the .flow.yaml suffix.
type Folder ¶
type Folder struct {
Dir string
Settings Settings
Hooks Hooks
// Order lists the names of the folder's entries (a request or flow without its
// file suffix, or a sub-folder's name) in the order they are shown. Entries it
// does not name follow, by name; a name that matches nothing is ignored.
Order []string
// Tags apply to every flow and request under the folder.
Tags []string
File string
}
Folder holds the settings and hooks of one _folder.yaml. Dir is relative to the collection root and slash-separated, e.g. "requests/auth".
type GRPC ¶
type GRPC struct {
// Server is grpc://host:port (plaintext), grpcs://host:port (TLS) or a bare
// host:port; templated, e.g. {{env.api}}.
Server string
// Method is package.Service/Method.
Method string
// Body is the request message, as JSON (or text holding JSON).
Body Body
// Proto lists .proto files, relative to the collection. Empty: the schema
// is asked of the server by reflection.
Proto []string
// Import lists the roots .proto imports are resolved against, relative to
// the collection.
Import []string
// Receive says which messages of a server stream to keep; unused for a
// unary call. Count 0 means 1 and Timeout 0 means 30s when it runs.
Receive *AsyncReceive
// Web makes the call over gRPC-Web: an HTTP POST to Server, which is then
// an http:// or https:// address, for a proxy or gateway that speaks it.
// It needs Proto files (such a proxy has no reflection) and a method that
// does not stream from the client.
Web bool
}
GRPC is what a gRPC request version does: it calls one method of a service with a JSON message and reads the response (one message, or a stream).
type HookControl ¶
HookControl decides which API hooks a request node runs. Mode is "all" (default) or "none"; Skip lists "pre", "post" and/or "message".
type HookStep ¶
HookStep is one pre or post hook: a reusable flow or inline nodes. Exactly one of Flow and Inline is set.
type Hooks ¶
Hooks are the steps attached to an API at some scope: Pre runs before the request is sent and Post after its response. Message runs for each message a message request keeps, as it arrives, in the order Pre does; requests that receive no messages never run it.
type Input ¶
Input is a declared flow input with an optional type and default template. A flow keeps its inputs in the order they were written: the Start card shows them in that order.
type KeyValue ¶
type KeyValue struct {
Key string
Value string
// Description says what the entry is for; only requests keep it (query,
// headers, variables).
Description string
}
KeyValue is an ordered string pair (headers, query parameters, inputs).
type Layout ¶
type Layout struct {
Flow ID
Nodes map[string]Point // manual positions by node id
Collapsed []string // collapsed action strips, by first node id
File string
}
Layout is a flow's *.layout.yaml: canvas positions only, kept apart from the flow so moving nodes never changes the flow file (design §4.7).
type Manifest ¶
type Manifest struct {
Format int
Meta
DependsOn []Dependency
// Variables are the collection's own values, read as {{collection_var.name}}
// by its requests and flows. The selected environment overrides one of
// the same name, so the value that differs per API (a base URL) can still
// differ per environment.
Variables []KeyValue
Settings Settings
Hooks Hooks
File string
}
Manifest is the content of a collection's flowi.yaml.
type Node ¶
type Node struct {
ID string
Type NodeType
Name string
Description string
Needs []string
// AfterFailureOf lists the steps of the same list whose failure starts this one. Needs and
// AfterFailureOf are the arrows into a step: a name in Needs is an arrow taken when that step
// succeeds, one in AfterFailureOf when it fails, one in both whichever way it ends. With neither,
// the step follows the step before it, on success.
AfterFailureOf []string
// AfterOutcome lists "step:outcome" entries: the step starts this one when its request ends with that
// outcome (one of the outcomes the request names, or success or failure).
AfterOutcome []string
// Unlinked says the step has no arrow into it: it does not follow the step before it. The arrow from that step
// was taken away on purpose. It is ignored when the step has arrows of its own.
Unlinked bool
When string
Concurrent bool
OnError string
Timeout time.Duration
// Attach names a request or subflow node of the same list that this node is shown
// with: the canvas draws them as one block. It is a view only; the run order is
// the list order, as always.
Attach string
// AttachAt says where, around that request, the canvas draws the node: "above" or
// "below" it in a stack, or "" beside it (before it in the list is drawn left of it,
// after it right of it). Like Attach it is a view only.
AttachAt string
// Color is a colour from NodeColors the canvas draws the step in; "" for
// the category's own. It is cosmetic: a run never reads it.
Color string
Request *RequestCall
Subflow *SubflowCall
Body []Node
Branches []Branch
Then []Node
Else []Node
Cases []Case
// Values are what a set node writes, in order; a later one may read an
// earlier one. A set node with a target (and no values) writes one
// variable or request field instead.
Values []SetValue
Params []Field
}
Node is one step of a flow. Only the fields relevant to its Type are set. Type-specific options without a typed field are kept, in file order, in Params until the engine milestone types them.
type Outcome ¶
type Outcome struct {
Name string
When string
Disabled bool // kept in the list, but never matched
// Color is one of NodeColors, for the port and arrows of the outcome; "" is the outcome's own (green for
// success, red for failure, blue for a named one). Description says what it is for, shown beside it.
Color string
Description string
}
Outcome is a named way a request can end, which an arrow can follow. A step has every outcome whose rule holds once the request and its hooks have run, so a response can be `success` and `ok` at once. success and failure are built in: their rule is "the request passed" and "it failed", and they have no When. Any other name has a When, an expression over the response (`status in [200, 201]`).
func DefaultOutcomes ¶
func DefaultOutcomes() []Outcome
DefaultOutcomes is the list of a request that writes none: success and failure.
type Output ¶
Output is a value a flow hands back when it ends: a subflow's caller reads it as nodes.<id>.<name>, and the End card shows it. Value is a template rendered in the flow's final scope.
type Overlay ¶
type Overlay struct {
Name string
Description string
Requests []RequestOverlay
File string
}
Overlay is a flowi overlay: a named set of changes laid over a request version at send time (the same request as a VIP customer, a delayed request, one with a bad token). Shared applies to every request that uses the overlay; each RequestOverlay applies to its request after that.
type OverlayOp ¶
OverlayOp is one change a flowi overlay makes to a request version. Path says where (url, headers.X-Tier, body.json, assert, ...); Was is what the base held when the overlay was saved, used to report drift later.
type Param ¶
Param is one declared blueprint parameter. A parameter without a Default must be given a value when the blueprint is used.
type ParamType ¶
type ParamType string
ParamType is the kind of value a blueprint parameter takes.
const ( ParamString ParamType = "string" ParamInt ParamType = "int" ParamBool ParamType = "bool" ParamRequestRef ParamType = "request-ref" ParamFlowRef ParamType = "flow-ref" )
Parameter types. A request-ref or flow-ref parameter fills the places in the blueprint's nodes that name a request or a subflow ({param: name}); the other types become inputs of the flow made from the blueprint.
func ParamTypes ¶
func ParamTypes() []ParamType
ParamTypes lists the parameter types in documentation order.
type Ref ¶
type Ref struct {
Collection string
ID ID
Path string
// Param, set only inside a blueprint, names the blueprint parameter
// that fills this reference when the blueprint is used; ID and Path are
// then empty.
Param string
}
Ref points at a request or flow. Collection is empty for the referencing collection itself, otherwise the name or id of a declared dependency. ID is authoritative; Path is a readable hint that tools repair.
type Request ¶
type Request struct {
Meta
// Tags label the request; the tags of its folders apply as well.
Tags []string
Path string
Operation string // the OpenAPI operationId of its first version; Arazzo steps refer to it
Default string
Versions []RequestVersion
Hooks Hooks
File string
// Edit is the one dirty edit: an autosaved working copy of a version.
// Runs, serve and the CLI ignore it; only the GUI sends it. EditBase is
// the label of the version it started from.
Edit *RequestVersion
EditBase string
// EditOverlay names the flowi overlay the edit was made with laid over
// its base version: the edit then shows the overlay's changes too, and the
// window restores the overlay choice with it. "" when there was none.
EditOverlay string
}
Request is a saved API request with one or more versions. Path is relative to requests/ without the .req.yaml suffix, e.g. "auth/login".
type RequestCall ¶
type RequestCall struct {
Request Ref
Version string
// Overlay names a flowi overlay of the request's collection laid over the
// version, "" for none.
Overlay string
// Open names a connection this step opens and leaves open for later steps
// (an async request that can be kept open: WebSocket, MQTT 5, NATS); ""
// for none. The step's own send and receive run on it.
Open string
// Over names a connection an earlier step opened: this step sends and
// receives over it instead of connecting.
Over string
// Close ends the connection Over names once this step has run. A
// connection still open when the run ends is closed then.
Close bool
Hooks HookControl
With []KeyValue
Headers []KeyValue
// Outcomes, when set, are this step's outcomes in place of the request version's own: the same request
// can end in different ways in different flows. See Outcome.
Outcomes []Outcome
}
RequestCall is the configuration of a request node.
type RequestOverlay ¶
type RequestOverlay struct {
Request ID
// Path is a readable hint at the request; Request is authoritative.
Path string
Ops []OverlayOp
}
RequestOverlay is the part of an overlay that only one request needs.
type RequestVersion ¶
type RequestVersion struct {
Label string
// Name is a short title for the version ("Before the tax change"); the label
// ("1.1") stays what it is called everywhere else. Docs is its description.
Name string
Method string
URL string
Query []KeyValue
Headers []KeyValue
Body Body
Extract []Extraction
Assert []string
// Outcomes are the named ways the request can end (see Outcome). None (or an empty list): success and failure.
Outcomes []Outcome
Settings Settings
Hooks Hooks
// Variables are the version's default values for {{var.name}}; the
// environment's variable of the same name wins.
Variables []KeyValue
// Docs is the version's documentation, written as Markdown.
Docs string
// Auth, when set, signs or authenticates the request when it is sent: an
// API key, Digest, OAuth 2.0 or 1.0a, AWS Signature v4, a signed JWT, Hawk
// or a client certificate. The Authorization header of Headers is the
// simple form of the same thing.
Auth *Auth
// Async, when set, makes this an async (message) request instead of an
// HTTP one: Method, Query and Body are then unused.
Async *Async
// GRPC, when set, makes this a gRPC call instead of an HTTP request. The
// version's Headers are the call's metadata; Method, URL, Query and Body
// are unused.
GRPC *GRPC
// Dataset, when set, makes this a query of a data store instead of an HTTP
// request. The version's Headers, Method, URL, Query and Body are unused.
Dataset *Dataset
}
RequestVersion is one complete definition of a request.
func (RequestVersion) EffectiveOutcomes ¶
func (v RequestVersion) EffectiveOutcomes() []Outcome
EffectiveOutcomes is the version's outcomes: the ones written, or success and failure when it writes none. A written list is the whole list: leaving success out removes it, and the steps that follow on success then never run. An empty list is the same as none (a request always has an outcome): the editor does not let the last one be removed, and a nil list does not survive the trip to the window as different from empty.
func (RequestVersion) Exchange ¶
func (v RequestVersion) Exchange() Exchange
Exchange is which directions the version has. Only messaging varies: a published message sends, a subscription receives, request and reply does both; every other family sends and receives the answer.
func (RequestVersion) Family ¶
func (v RequestVersion) Family() Family
Family is the family of the version: the block that is set decides, and a version with none is HTTP.
type RunTill ¶
type RunTill struct {
Until string
MaxIterations int
MaxDuration time.Duration
Interval time.Duration
}
RunTill repeats a whole flow until a condition or limit.
type Schedule ¶
type Schedule struct {
Name string // unique within the workspace; names the schedule in logs and commands
Flow string // a flow path or id
Collection string // optional: a collection name or id when Flow is ambiguous
Cron string // five fields, or @hourly, @daily, …
Env string // environment name; "" uses defaults.environment
Inputs []KeyValue
TZ string // IANA zone name; "" is the machine's zone
Disabled bool
}
Schedule runs a flow on a cron schedule while `flowi serve` is running. Schedules are personal, so they live in workspace.yaml, not in a collection.
type SetValue ¶
type SetValue struct {
Name string
From string
Value any
// Where, for From "response", is "body", "header", "cookie" or "status";
// Path, Header, Cookie and Regex then say which part (a body regex wins
// over the path).
Where string
Path string
Header string
Cookie string
Regex string
Seed int64
}
SetValue is one value a set node writes into the variable Name.
From says where the value comes from: "expr" (the default; Value is a template or expression), "literal" (Value as written, never evaluated), "response" (a part of the last response, named by Where) or "generate" (Value is a template using generators such as {{$uuid-v4}}; Seed makes it repeatable on its own).
type Settings ¶
Settings maps dotted setting keys ("http.max_redirects") to values that the settings package has already validated.
type SubflowCall ¶
SubflowCall is the configuration of a subflow node.