Documentation
¶
Index ¶
- Constants
- Variables
- type CompositeModuleManager
- type KubernetesTokenMinter
- type RedisModuleRegistry
- func (r *RedisModuleRegistry) DeleteModuleDescriptor(ctx context.Context, key api.AutoFlowModuleKey) error
- func (r *RedisModuleRegistry) LoadModuleDescriptor(ctx context.Context, key api.AutoFlowModuleKey) (*flowcore.RegisteredModuleDescriptor, error)
- func (r *RedisModuleRegistry) RegisterDescriptor(ctx context.Context, key api.AutoFlowModuleKey, ...) error
- type RemoteModuleClient
- type RemoteModuleManager
Constants ¶
const (
ModuleName = "autoflow"
)
Variables ¶
var ErrInlineNotAllowed = errors.New("only a built-in module may declare an action inlineable")
ErrInlineNotAllowed is returned for a module descriptor that declares an action inlineable without being entitled to: only an in-process (built-in) module may, because an inline body runs in the workflow goroutine and stalls its round.
Functions ¶
This section is empty.
Types ¶
type CompositeModuleManager ¶ added in v19.1.0
type CompositeModuleManager struct {
// contains filtered or unexported fields
}
func NewCompositeModuleManager ¶ added in v19.1.0
func NewCompositeModuleManager(delegate flowcore.ModuleManager, builtins flowcore.BuiltinModules) *CompositeModuleManager
NewCompositeModuleManager builds a module manager that serves the given built-in modules in-process and delegates everything else.
func (*CompositeModuleManager) InvokeAction ¶ added in v19.1.0
func (m *CompositeModuleManager) InvokeAction( ctx context.Context, actx pkg_autoflow.InvokeActionContext, agentKey api.AgentKey, inv *autoflowv1.ActionInvocation, ) (*autoflowv1.Result, error)
func (*CompositeModuleManager) LoadModuleDescriptor ¶ added in v19.1.0
func (m *CompositeModuleManager) LoadModuleDescriptor(ctx context.Context, key api.AutoFlowModuleKey) (*flowcore.RegisteredModuleDescriptor, error)
type KubernetesTokenMinter ¶ added in v19.6.0
type KubernetesTokenMinter struct {
Client coreclientv1.ServiceAccountsGetter
Namespace string
ServiceAccountName string
// TTL is the requested validity of a token. The API server refuses less than 10 minutes.
TTL time.Duration
}
KubernetesTokenMinter mints tokens for a Kubernetes ServiceAccount using the TokenRequest API.
type RedisModuleRegistry ¶ added in v19.1.0
type RedisModuleRegistry struct {
Client rueidis.Client
KeyPrefix string
TTL time.Duration
Marshaler prototool.Marshaler
}
RedisModuleRegistry registers AutoFlow modules in Redis. A module's descriptor can be looked up by the module's key.
func (*RedisModuleRegistry) DeleteModuleDescriptor ¶ added in v19.4.0
func (r *RedisModuleRegistry) DeleteModuleDescriptor(ctx context.Context, key api.AutoFlowModuleKey) error
DeleteModuleDescriptor removes a module descriptor from Redis immediately, without waiting for the TTL to expire. It is idempotent: deleting a key that does not exist is not an error.
func (*RedisModuleRegistry) LoadModuleDescriptor ¶ added in v19.1.0
func (r *RedisModuleRegistry) LoadModuleDescriptor(ctx context.Context, key api.AutoFlowModuleKey) (*flowcore.RegisteredModuleDescriptor, error)
LoadModuleDescriptor loads a module descriptor from Redis. Returns (nil, nil) if not found.
func (*RedisModuleRegistry) RegisterDescriptor ¶ added in v19.1.0
func (r *RedisModuleRegistry) RegisterDescriptor(ctx context.Context, key api.AutoFlowModuleKey, desc *flowcore.RegisteredModuleDescriptor) error
type RemoteModuleClient ¶ added in v19.1.0
type RemoteModuleClient struct {
AgentConnPool func(api.AgentKey) grpc.ClientConnInterface
}
func (*RemoteModuleClient) InvokeAction ¶ added in v19.1.0
func (c *RemoteModuleClient) InvokeAction( ctx context.Context, actx pkg_autoflow.InvokeActionContext, agentKey api.AgentKey, inv *autoflowv1.ActionInvocation, ) (*autoflowv1.Result, error)
InvokeAction sends a request to a matching agent.
A module that breaks the protocol fails the invocation with an error marked flowcore.NonRetryable: a retry runs the action again only for the module to break it the same way.
This method uses the simplified tunneling approach. A Remote AutoFlow Module client for that agent key must have an open InvokeAction RPC call to any Relay. The req is routed through a gateway Relay (potentially itself) to that client. This method must send the RPC messages in reversed order - meaning that the actually defined RPC "response" becomes this client's request and the vice versa.
type RemoteModuleManager ¶ added in v19.1.0
type RemoteModuleManager struct {
ModuleClient *RemoteModuleClient
Registry *RedisModuleRegistry
}
func (*RemoteModuleManager) InvokeAction ¶ added in v19.1.0
func (m *RemoteModuleManager) InvokeAction( ctx context.Context, actx pkg_autoflow.InvokeActionContext, agentKey api.AgentKey, inv *autoflowv1.ActionInvocation, ) (*autoflowv1.Result, error)
func (*RemoteModuleManager) LoadModuleDescriptor ¶ added in v19.1.0
func (m *RemoteModuleManager) LoadModuleDescriptor(ctx context.Context, key api.AutoFlowModuleKey) (*flowcore.RegisteredModuleDescriptor, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
event
Package event implements the built-in AutoFlow module that emits events to the Events Platform.
|
Package event implements the built-in AutoFlow module that emits events to the Events Platform. |
|
gitlab
Package gitlab implements the built-in AutoFlow module that calls the GitLab REST API.
|
Package gitlab implements the built-in AutoFlow module that calls the GitLab REST API. |
|
grpc
Package grpc implements the built-in AutoFlow module that makes unary calls to arbitrary gRPC servers.
|
Package grpc implements the built-in AutoFlow module that makes unary calls to arbitrary gRPC servers. |
|
http
Package http implements the built-in AutoFlow module that calls arbitrary HTTP endpoints.
|
Package http implements the built-in AutoFlow module that calls arbitrary HTTP endpoints. |
|
modtool
Package modtool holds conversions between AutoFlow values and the pieces of an HTTP request and response, shared by the built-in modules that call an API.
|
Package modtool holds conversions between AutoFlow values and the pieces of an HTTP request and response, shared by the built-in modules that call an API. |
|
policy
Package policy implements the built-in AutoFlow module that asks the governance decision API whether an action is allowed.
|
Package policy implements the built-in AutoFlow module that asks the governance decision API whether an action is allowed. |
|
service
Package service implements the built-in AutoFlow module that calls the HTTP API of a Theseus service.
|
Package service implements the built-in AutoFlow module that calls the HTTP API of a Theseus service. |