Documentation ¶
Overview ¶
Package apiserver contains all request handlers for gRPC and HTTP servers.
It has these top-level request handlers:
Admin - Administrative functionality related to managing the workflow engine. Invocation - Functionality related to managing invocations. Workflow - functionality related to managing workflows.
The purpose of this package is purely to provide handlers to gRPC and HTTP servers. Therefore, it should not contain any logic (validation, composition, etc.) related to the workflows, invocations or any other targets that it provides. All this logic should be placed in the actual packages that are responsible for the business logic, such as `api`.
Package apiserver is a generated protocol buffer package.
It is generated from these files:
pkg/apiserver/apiserver.proto
It has these top-level messages:
WorkflowList AddTaskRequest InvocationListQuery WorkflowInvocationList ObjectEvents Health
Package apiserver is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- func RegisterAdminAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAdminAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminAPIClient) error
- func RegisterAdminAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAdminAPIServer(s *grpc.Server, srv AdminAPIServer)
- func RegisterWorkflowAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWorkflowAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkflowAPIClient) error
- func RegisterWorkflowAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWorkflowAPIServer(s *grpc.Server, srv WorkflowAPIServer)
- func RegisterWorkflowInvocationAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWorkflowInvocationAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkflowInvocationAPIClient) error
- func RegisterWorkflowInvocationAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWorkflowInvocationAPIServer(s *grpc.Server, srv WorkflowInvocationAPIServer)
- type AddTaskRequest
- type Admin
- type AdminAPIClient
- type AdminAPIServer
- type Client
- type Empty
- type Health
- type Invocation
- func (gi *Invocation) AddTask(ctx context.Context, req *AddTaskRequest) (*empty.Empty, error)
- func (gi *Invocation) Cancel(ctx context.Context, objectMetadata *types.ObjectMetadata) (*empty.Empty, error)
- func (gi *Invocation) Events(ctx context.Context, md *types.ObjectMetadata) (*ObjectEvents, error)
- func (gi *Invocation) Get(ctx context.Context, objectMetadata *types.ObjectMetadata) (*types.WorkflowInvocation, error)
- func (gi *Invocation) Invoke(ctx context.Context, spec *types.WorkflowInvocationSpec) (*types.ObjectMetadata, error)
- func (gi *Invocation) InvokeSync(ctx context.Context, spec *types.WorkflowInvocationSpec) (*types.WorkflowInvocation, error)
- func (gi *Invocation) List(ctx context.Context, query *InvocationListQuery) (*WorkflowInvocationList, error)
- func (gi *Invocation) Validate(ctx context.Context, spec *types.WorkflowInvocationSpec) (*empty.Empty, error)
- type InvocationListQuery
- type ObjectEvents
- func (*ObjectEvents) Descriptor() ([]byte, []int)
- func (m *ObjectEvents) GetEvents() []*fission_workflows_eventstore.Event
- func (m *ObjectEvents) GetMetadata() *fission_workflows_types1.ObjectMetadata
- func (*ObjectEvents) ProtoMessage()
- func (m *ObjectEvents) Reset()
- func (m *ObjectEvents) String() string
- type Workflow
- func (ga *Workflow) Create(ctx context.Context, spec *types.WorkflowSpec) (*types.ObjectMetadata, error)
- func (ga *Workflow) CreateSync(ctx context.Context, spec *types.WorkflowSpec) (*types.Workflow, error)
- func (ga *Workflow) Delete(ctx context.Context, workflowID *types.ObjectMetadata) (*empty.Empty, error)
- func (ga *Workflow) Events(ctx context.Context, md *types.ObjectMetadata) (*ObjectEvents, error)
- func (ga *Workflow) Get(ctx context.Context, workflowID *types.ObjectMetadata) (*types.Workflow, error)
- func (ga *Workflow) List(ctx context.Context, req *empty.Empty) (*WorkflowList, error)
- func (ga *Workflow) Validate(ctx context.Context, spec *types.WorkflowSpec) (*empty.Empty, error)
- type WorkflowAPIClient
- type WorkflowAPIServer
- type WorkflowInvocationAPIClient
- type WorkflowInvocationAPIServer
- type WorkflowInvocationList
- type WorkflowList
Constants ¶
const (
CreateSyncPollInterval = 100 * time.Millisecond
)
const StatusOK = "OK!"
Variables ¶
This section is empty.
Functions ¶
func RegisterAdminAPIHandler ¶
func RegisterAdminAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAdminAPIHandler registers the http handlers for service AdminAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAdminAPIHandlerClient ¶
func RegisterAdminAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminAPIClient) error
RegisterAdminAPIHandler registers the http handlers for service AdminAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdminAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdminAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AdminAPIClient" to call the correct interceptors.
func RegisterAdminAPIHandlerFromEndpoint ¶
func RegisterAdminAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAdminAPIHandlerFromEndpoint is same as RegisterAdminAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAdminAPIServer ¶
func RegisterAdminAPIServer(s *grpc.Server, srv AdminAPIServer)
func RegisterWorkflowAPIHandler ¶
func RegisterWorkflowAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWorkflowAPIHandler registers the http handlers for service WorkflowAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWorkflowAPIHandlerClient ¶
func RegisterWorkflowAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkflowAPIClient) error
RegisterWorkflowAPIHandler registers the http handlers for service WorkflowAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WorkflowAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WorkflowAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WorkflowAPIClient" to call the correct interceptors.
func RegisterWorkflowAPIHandlerFromEndpoint ¶
func RegisterWorkflowAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWorkflowAPIHandlerFromEndpoint is same as RegisterWorkflowAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWorkflowAPIServer ¶
func RegisterWorkflowAPIServer(s *grpc.Server, srv WorkflowAPIServer)
func RegisterWorkflowInvocationAPIHandler ¶
func RegisterWorkflowInvocationAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWorkflowInvocationAPIHandler registers the http handlers for service WorkflowInvocationAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWorkflowInvocationAPIHandlerClient ¶
func RegisterWorkflowInvocationAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkflowInvocationAPIClient) error
RegisterWorkflowInvocationAPIHandler registers the http handlers for service WorkflowInvocationAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WorkflowInvocationAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WorkflowInvocationAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WorkflowInvocationAPIClient" to call the correct interceptors.
func RegisterWorkflowInvocationAPIHandlerFromEndpoint ¶
func RegisterWorkflowInvocationAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWorkflowInvocationAPIHandlerFromEndpoint is same as RegisterWorkflowInvocationAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWorkflowInvocationAPIServer ¶
func RegisterWorkflowInvocationAPIServer(s *grpc.Server, srv WorkflowInvocationAPIServer)
Types ¶
type AddTaskRequest ¶
type AddTaskRequest struct { InvocationID string `protobuf:"bytes,1,opt,name=invocationID" json:"invocationID,omitempty"` Task *fission_workflows_types1.Task `protobuf:"bytes,2,opt,name=task" json:"task,omitempty"` }
func (*AddTaskRequest) Descriptor ¶
func (*AddTaskRequest) Descriptor() ([]byte, []int)
func (*AddTaskRequest) GetInvocationID ¶
func (m *AddTaskRequest) GetInvocationID() string
func (*AddTaskRequest) GetTask ¶
func (m *AddTaskRequest) GetTask() *fission_workflows_types1.Task
func (*AddTaskRequest) ProtoMessage ¶
func (*AddTaskRequest) ProtoMessage()
func (*AddTaskRequest) Reset ¶
func (m *AddTaskRequest) Reset()
func (*AddTaskRequest) String ¶
func (m *AddTaskRequest) String() string
type Admin ¶
type Admin struct { }
Admin is responsible for all administrative functions related to managing the workflow engine.
type AdminAPIClient ¶
type AdminAPIClient interface { Status(ctx context.Context, in *google_protobuf3.Empty, opts ...grpc.CallOption) (*Health, error) Version(ctx context.Context, in *google_protobuf3.Empty, opts ...grpc.CallOption) (*fission_workflows_version.Info, error) }
func NewAdminAPIClient ¶
func NewAdminAPIClient(cc *grpc.ClientConn) AdminAPIClient
type AdminAPIServer ¶
type AdminAPIServer interface { Status(context.Context, *google_protobuf3.Empty) (*Health, error) Version(context.Context, *google_protobuf3.Empty) (*fission_workflows_version.Info, error) }
type Client ¶
type Client struct { Admin AdminAPIClient Invocation WorkflowInvocationAPIClient Workflow WorkflowAPIClient }
func Connect ¶
Connect attempts to connect to the server at addr and returns a Client.
addr should be of the format <hostname>:<port>, without a method. (e.g. workflows:5555)
func NewClient ¶
func NewClient(conn *grpc.ClientConn) *Client
type Health ¶
type Health struct {
Status string `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"`
}
func (*Health) Descriptor ¶
func (*Health) ProtoMessage ¶
func (*Health) ProtoMessage()
type Invocation ¶
type Invocation struct {
// contains filtered or unexported fields
}
Invocation is responsible for all functionality related to managing invocations.
func (*Invocation) AddTask ¶
func (gi *Invocation) AddTask(ctx context.Context, req *AddTaskRequest) (*empty.Empty, error)
func (*Invocation) Cancel ¶
func (gi *Invocation) Cancel(ctx context.Context, objectMetadata *types.ObjectMetadata) (*empty.Empty, error)
func (*Invocation) Events ¶
func (gi *Invocation) Events(ctx context.Context, md *types.ObjectMetadata) (*ObjectEvents, error)
func (*Invocation) Get ¶
func (gi *Invocation) Get(ctx context.Context, objectMetadata *types.ObjectMetadata) (*types.WorkflowInvocation, error)
func (*Invocation) Invoke ¶
func (gi *Invocation) Invoke(ctx context.Context, spec *types.WorkflowInvocationSpec) (*types.ObjectMetadata, error)
func (*Invocation) InvokeSync ¶
func (gi *Invocation) InvokeSync(ctx context.Context, spec *types.WorkflowInvocationSpec) (*types.WorkflowInvocation, error)
func (*Invocation) List ¶
func (gi *Invocation) List(ctx context.Context, query *InvocationListQuery) (*WorkflowInvocationList, error)
func (*Invocation) Validate ¶
func (gi *Invocation) Validate(ctx context.Context, spec *types.WorkflowInvocationSpec) (*empty.Empty, error)
type InvocationListQuery ¶
type InvocationListQuery struct {
Workflows []string `protobuf:"bytes,1,rep,name=workflows" json:"workflows,omitempty"`
}
func (*InvocationListQuery) Descriptor ¶
func (*InvocationListQuery) Descriptor() ([]byte, []int)
func (*InvocationListQuery) GetWorkflows ¶
func (m *InvocationListQuery) GetWorkflows() []string
func (*InvocationListQuery) ProtoMessage ¶
func (*InvocationListQuery) ProtoMessage()
func (*InvocationListQuery) Reset ¶
func (m *InvocationListQuery) Reset()
func (*InvocationListQuery) String ¶
func (m *InvocationListQuery) String() string
type ObjectEvents ¶
type ObjectEvents struct { Metadata *fission_workflows_types1.ObjectMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` Events []*fission_workflows_eventstore.Event `protobuf:"bytes,2,rep,name=events" json:"events,omitempty"` }
func (*ObjectEvents) Descriptor ¶
func (*ObjectEvents) Descriptor() ([]byte, []int)
func (*ObjectEvents) GetEvents ¶
func (m *ObjectEvents) GetEvents() []*fission_workflows_eventstore.Event
func (*ObjectEvents) GetMetadata ¶
func (m *ObjectEvents) GetMetadata() *fission_workflows_types1.ObjectMetadata
func (*ObjectEvents) ProtoMessage ¶
func (*ObjectEvents) ProtoMessage()
func (*ObjectEvents) Reset ¶
func (m *ObjectEvents) Reset()
func (*ObjectEvents) String ¶
func (m *ObjectEvents) String() string
type Workflow ¶
type Workflow struct {
// contains filtered or unexported fields
}
Workflow is responsible for all functionality related to managing workflows.
func NewWorkflow ¶
func (*Workflow) Create ¶
func (ga *Workflow) Create(ctx context.Context, spec *types.WorkflowSpec) (*types.ObjectMetadata, error)
func (*Workflow) CreateSync ¶
func (*Workflow) Events ¶
func (ga *Workflow) Events(ctx context.Context, md *types.ObjectMetadata) (*ObjectEvents, error)
type WorkflowAPIClient ¶
type WorkflowAPIClient interface { Create(ctx context.Context, in *fission_workflows_types1.WorkflowSpec, opts ...grpc.CallOption) (*fission_workflows_types1.ObjectMetadata, error) CreateSync(ctx context.Context, in *fission_workflows_types1.WorkflowSpec, opts ...grpc.CallOption) (*fission_workflows_types1.Workflow, error) List(ctx context.Context, in *google_protobuf3.Empty, opts ...grpc.CallOption) (*WorkflowList, error) Get(ctx context.Context, in *fission_workflows_types1.ObjectMetadata, opts ...grpc.CallOption) (*fission_workflows_types1.Workflow, error) Delete(ctx context.Context, in *fission_workflows_types1.ObjectMetadata, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) Validate(ctx context.Context, in *fission_workflows_types1.WorkflowSpec, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) Events(ctx context.Context, in *fission_workflows_types1.ObjectMetadata, opts ...grpc.CallOption) (*ObjectEvents, error) }
func NewWorkflowAPIClient ¶
func NewWorkflowAPIClient(cc *grpc.ClientConn) WorkflowAPIClient
type WorkflowAPIServer ¶
type WorkflowAPIServer interface { Create(context.Context, *fission_workflows_types1.WorkflowSpec) (*fission_workflows_types1.ObjectMetadata, error) CreateSync(context.Context, *fission_workflows_types1.WorkflowSpec) (*fission_workflows_types1.Workflow, error) List(context.Context, *google_protobuf3.Empty) (*WorkflowList, error) Get(context.Context, *fission_workflows_types1.ObjectMetadata) (*fission_workflows_types1.Workflow, error) Delete(context.Context, *fission_workflows_types1.ObjectMetadata) (*google_protobuf3.Empty, error) Validate(context.Context, *fission_workflows_types1.WorkflowSpec) (*google_protobuf3.Empty, error) Events(context.Context, *fission_workflows_types1.ObjectMetadata) (*ObjectEvents, error) }
type WorkflowInvocationAPIClient ¶
type WorkflowInvocationAPIClient interface { // Create a new workflow invocation // // In case the invocation specification is missing fields or contains invalid fields, a HTTP 400 is returned. Invoke(ctx context.Context, in *fission_workflows_types1.WorkflowInvocationSpec, opts ...grpc.CallOption) (*fission_workflows_types1.ObjectMetadata, error) InvokeSync(ctx context.Context, in *fission_workflows_types1.WorkflowInvocationSpec, opts ...grpc.CallOption) (*fission_workflows_types1.WorkflowInvocation, error) AddTask(ctx context.Context, in *AddTaskRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) // Cancel a workflow invocation // // This action is irreverisble. A canceled invocation cannot be resumed or restarted. // In case that an invocation already is canceled, has failed or has completed, nothing happens. // In case that an invocation does not exist a HTTP 404 error status is returned. Cancel(ctx context.Context, in *fission_workflows_types1.ObjectMetadata, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) List(ctx context.Context, in *InvocationListQuery, opts ...grpc.CallOption) (*WorkflowInvocationList, error) // Get the specification and status of a workflow invocation // // Get returns three different aspects of the workflow invocation, namely the spec (specification), status and logs. // To lighten the request load, consider using a more specific request. Get(ctx context.Context, in *fission_workflows_types1.ObjectMetadata, opts ...grpc.CallOption) (*fission_workflows_types1.WorkflowInvocation, error) Events(ctx context.Context, in *fission_workflows_types1.ObjectMetadata, opts ...grpc.CallOption) (*ObjectEvents, error) Validate(ctx context.Context, in *fission_workflows_types1.WorkflowInvocationSpec, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) }
func NewWorkflowInvocationAPIClient ¶
func NewWorkflowInvocationAPIClient(cc *grpc.ClientConn) WorkflowInvocationAPIClient
type WorkflowInvocationAPIServer ¶
type WorkflowInvocationAPIServer interface { // Create a new workflow invocation // // In case the invocation specification is missing fields or contains invalid fields, a HTTP 400 is returned. Invoke(context.Context, *fission_workflows_types1.WorkflowInvocationSpec) (*fission_workflows_types1.ObjectMetadata, error) InvokeSync(context.Context, *fission_workflows_types1.WorkflowInvocationSpec) (*fission_workflows_types1.WorkflowInvocation, error) AddTask(context.Context, *AddTaskRequest) (*google_protobuf3.Empty, error) // Cancel a workflow invocation // // This action is irreverisble. A canceled invocation cannot be resumed or restarted. // In case that an invocation already is canceled, has failed or has completed, nothing happens. // In case that an invocation does not exist a HTTP 404 error status is returned. Cancel(context.Context, *fission_workflows_types1.ObjectMetadata) (*google_protobuf3.Empty, error) List(context.Context, *InvocationListQuery) (*WorkflowInvocationList, error) // Get the specification and status of a workflow invocation // // Get returns three different aspects of the workflow invocation, namely the spec (specification), status and logs. // To lighten the request load, consider using a more specific request. Get(context.Context, *fission_workflows_types1.ObjectMetadata) (*fission_workflows_types1.WorkflowInvocation, error) Events(context.Context, *fission_workflows_types1.ObjectMetadata) (*ObjectEvents, error) Validate(context.Context, *fission_workflows_types1.WorkflowInvocationSpec) (*google_protobuf3.Empty, error) }
func NewInvocation ¶
func NewInvocation(api *api.Invocation, invocations *store.Invocations, workflows *store.Workflows, backend fes.Backend) WorkflowInvocationAPIServer
type WorkflowInvocationList ¶
type WorkflowInvocationList struct {
Invocations []string `protobuf:"bytes,1,rep,name=invocations" json:"invocations,omitempty"`
}
func (*WorkflowInvocationList) Descriptor ¶
func (*WorkflowInvocationList) Descriptor() ([]byte, []int)
func (*WorkflowInvocationList) GetInvocations ¶
func (m *WorkflowInvocationList) GetInvocations() []string
func (*WorkflowInvocationList) ProtoMessage ¶
func (*WorkflowInvocationList) ProtoMessage()
func (*WorkflowInvocationList) Reset ¶
func (m *WorkflowInvocationList) Reset()
func (*WorkflowInvocationList) String ¶
func (m *WorkflowInvocationList) String() string
type WorkflowList ¶
type WorkflowList struct {
Workflows []string `protobuf:"bytes,1,rep,name=workflows" json:"workflows,omitempty"`
}
func (*WorkflowList) Descriptor ¶
func (*WorkflowList) Descriptor() ([]byte, []int)
func (*WorkflowList) GetWorkflows ¶
func (m *WorkflowList) GetWorkflows() []string
func (*WorkflowList) ProtoMessage ¶
func (*WorkflowList) ProtoMessage()
func (*WorkflowList) Reset ¶
func (m *WorkflowList) Reset()
func (*WorkflowList) String ¶
func (m *WorkflowList) String() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package httpclient is a lightweight implementation of a client for the HTTP gateway.
|
Package httpclient is a lightweight implementation of a client for the HTTP gateway. |