Documentation ¶
Index ¶
- func ListenReturnStream[T proto.Message, U proto.Message](con common.NatsConn, panicRecovery bool, subList *sync.Map, subject string, ...) error
- func NewSharAuth(apiAuthZFn authz.APIFunc, apiAuthNFn authn.Check, operations workflow.Ops) *sharAuth
- func RegisterEndpointFn[Req proto.Message, Res proto.Message](l *Listener, name string, endpointSubject string, reqBuilderFn func() Req, ...)
- func RegisterEndpointStreamingFn[Req proto.Message, Res proto.Message](l *Listener, name string, endpointSubject string, reqBuilderFn func() Req, ...)
- type Auth
- type Endpoints
- type Listener
- type MockAuth
- type MockAuth_Expecter
- type MockAuth_authForNamedWorkflow_Call
- func (_c *MockAuth_authForNamedWorkflow_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authForNamedWorkflow_Call
- func (_c *MockAuth_authForNamedWorkflow_Call) Run(run func(ctx context.Context, name string)) *MockAuth_authForNamedWorkflow_Call
- func (_c *MockAuth_authForNamedWorkflow_Call) RunAndReturn(run func(context.Context, string) (context.Context, error)) *MockAuth_authForNamedWorkflow_Call
- type MockAuth_authForNonWorkflow_Call
- func (_c *MockAuth_authForNonWorkflow_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authForNonWorkflow_Call
- func (_c *MockAuth_authForNonWorkflow_Call) Run(run func(ctx context.Context)) *MockAuth_authForNonWorkflow_Call
- func (_c *MockAuth_authForNonWorkflow_Call) RunAndReturn(run func(context.Context) (context.Context, error)) *MockAuth_authForNonWorkflow_Call
- type MockAuth_authForWorkflowId_Call
- func (_c *MockAuth_authForWorkflowId_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authForWorkflowId_Call
- func (_c *MockAuth_authForWorkflowId_Call) Run(run func(ctx context.Context, workflowId string)) *MockAuth_authForWorkflowId_Call
- func (_c *MockAuth_authForWorkflowId_Call) RunAndReturn(run func(context.Context, string) (context.Context, error)) *MockAuth_authForWorkflowId_Call
- type MockAuth_authFromExecutionID_Call
- func (_c *MockAuth_authFromExecutionID_Call) Return(_a0 context.Context, _a1 *model.Execution, _a2 error) *MockAuth_authFromExecutionID_Call
- func (_c *MockAuth_authFromExecutionID_Call) Run(run func(ctx context.Context, executionID string)) *MockAuth_authFromExecutionID_Call
- func (_c *MockAuth_authFromExecutionID_Call) RunAndReturn(run func(context.Context, string) (context.Context, *model.Execution, error)) *MockAuth_authFromExecutionID_Call
- type MockAuth_authFromJobID_Call
- func (_c *MockAuth_authFromJobID_Call) Return(_a0 context.Context, _a1 *model.WorkflowState, _a2 error) *MockAuth_authFromJobID_Call
- func (_c *MockAuth_authFromJobID_Call) Run(run func(ctx context.Context, trackingID string)) *MockAuth_authFromJobID_Call
- func (_c *MockAuth_authFromJobID_Call) RunAndReturn(...) *MockAuth_authFromJobID_Call
- type MockAuth_authFromProcessInstanceID_Call
- func (_c *MockAuth_authFromProcessInstanceID_Call) Return(_a0 context.Context, _a1 *model.ProcessInstance, _a2 error) *MockAuth_authFromProcessInstanceID_Call
- func (_c *MockAuth_authFromProcessInstanceID_Call) Run(run func(ctx context.Context, instanceID string)) *MockAuth_authFromProcessInstanceID_Call
- func (_c *MockAuth_authFromProcessInstanceID_Call) RunAndReturn(...) *MockAuth_authFromProcessInstanceID_Call
- type MockAuth_authenticate_Call
- func (_c *MockAuth_authenticate_Call) Return(_a0 context.Context, _a1 header.Values, _a2 error) *MockAuth_authenticate_Call
- func (_c *MockAuth_authenticate_Call) Run(run func(ctx context.Context)) *MockAuth_authenticate_Call
- func (_c *MockAuth_authenticate_Call) RunAndReturn(run func(context.Context) (context.Context, header.Values, error)) *MockAuth_authenticate_Call
- type MockAuth_authorize_Call
- func (_c *MockAuth_authorize_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authorize_Call
- func (_c *MockAuth_authorize_Call) Run(run func(ctx context.Context, workflowName string)) *MockAuth_authorize_Call
- func (_c *MockAuth_authorize_Call) RunAndReturn(run func(context.Context, string) (context.Context, error)) *MockAuth_authorize_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenReturnStream ¶ added in v1.1.1032
func ListenReturnStream[T proto.Message, U proto.Message](con common.NatsConn, panicRecovery bool, subList *sync.Map, subject string, receiveAPIMiddleware []middleware.Receive, req T, fn func(ctx context.Context, req T, res chan<- U, errs chan<- error)) error
ListenReturnStream is a function that sets up a NATS subscription to handle streaming reply messages. It executes the provided function to process the request and send the response messages. The function runs in a separate goroutine that continuously listens for return messages and error messages, and publishes them to the reply inbox. the function exits when an error or cancellation occurs.
func NewSharAuth ¶ added in v1.1.1377
func NewSharAuth(apiAuthZFn authz.APIFunc, apiAuthNFn authn.Check, operations workflow.Ops) *sharAuth
NewSharAuth constructs a new Shar Auth instance
func RegisterEndpointFn ¶ added in v1.1.1460
func RegisterEndpointFn[Req proto.Message, Res proto.Message](l *Listener, name string, endpointSubject string, reqBuilderFn func() Req, endpointFn func(ctx context.Context, req Req) (Res, error))
RegisterEndpointFn define an endpoint with request/reply behaviour
func RegisterEndpointStreamingFn ¶ added in v1.1.1460
func RegisterEndpointStreamingFn[Req proto.Message, Res proto.Message](l *Listener, name string, endpointSubject string, reqBuilderFn func() Req, endpointStreamingFn func(ctx context.Context, req Req, res chan<- Res, errs chan<- error))
RegisterEndpointStreamingFn define an endpoint with request/ streaming reply behaviour
Types ¶
type Auth ¶ added in v1.1.1377
type Auth interface {
// contains filtered or unexported methods
}
Auth is a struct with various methods to provide authentication and authorisation capabilities for the api
type Endpoints ¶ added in v1.1.1131
type Endpoints struct { Listener *Listener // contains filtered or unexported fields }
Endpoints provides API Endpoints for SHAR
func NewEndpoints ¶ added in v1.1.1460
NewEndpoints creates a new instance of the Endpoints of the SHAR API server
func (*Endpoints) StartListening ¶ added in v1.1.1460
StartListening registers shar endspoints and starts listening for requests to them
type Listener ¶ added in v1.1.1460
type Listener struct {
// contains filtered or unexported fields
}
Listener provides the mechanism via which api requests are received and responded to
func NewListener ¶ added in v1.1.1460
func NewListener(nc *natz.NatsConnConfiguration, options *option.ServerOptions) *Listener
NewListener creates a new Listener
func (*Listener) Shutdown ¶ added in v1.1.1460
func (s *Listener) Shutdown()
Shutdown gracefully shuts down the SHAR API server
func (*Listener) StartListening ¶ added in v1.1.1460
StartListening iterates over the endpoint definitions and starts listening for requests to them
type MockAuth ¶ added in v1.1.1404
MockAuth is an autogenerated mock type for the Auth type
func NewMockAuth ¶ added in v1.1.1404
NewMockAuth creates a new instance of MockAuth. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockAuth) EXPECT ¶ added in v1.1.1404
func (_m *MockAuth) EXPECT() *MockAuth_Expecter
type MockAuth_Expecter ¶ added in v1.1.1404
type MockAuth_Expecter struct {
// contains filtered or unexported fields
}
type MockAuth_authForNamedWorkflow_Call ¶ added in v1.1.1404
MockAuth_authForNamedWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authForNamedWorkflow'
func (*MockAuth_authForNamedWorkflow_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authForNamedWorkflow_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authForNamedWorkflow_Call
func (*MockAuth_authForNamedWorkflow_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authForNamedWorkflow_Call) Run(run func(ctx context.Context, name string)) *MockAuth_authForNamedWorkflow_Call
func (*MockAuth_authForNamedWorkflow_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authForNamedWorkflow_Call) RunAndReturn(run func(context.Context, string) (context.Context, error)) *MockAuth_authForNamedWorkflow_Call
type MockAuth_authForNonWorkflow_Call ¶ added in v1.1.1404
MockAuth_authForNonWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authForNonWorkflow'
func (*MockAuth_authForNonWorkflow_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authForNonWorkflow_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authForNonWorkflow_Call
func (*MockAuth_authForNonWorkflow_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authForNonWorkflow_Call) Run(run func(ctx context.Context)) *MockAuth_authForNonWorkflow_Call
func (*MockAuth_authForNonWorkflow_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authForNonWorkflow_Call) RunAndReturn(run func(context.Context) (context.Context, error)) *MockAuth_authForNonWorkflow_Call
type MockAuth_authForWorkflowId_Call ¶ added in v1.1.1404
MockAuth_authForWorkflowId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authForWorkflowId'
func (*MockAuth_authForWorkflowId_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authForWorkflowId_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authForWorkflowId_Call
func (*MockAuth_authForWorkflowId_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authForWorkflowId_Call) Run(run func(ctx context.Context, workflowId string)) *MockAuth_authForWorkflowId_Call
func (*MockAuth_authForWorkflowId_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authForWorkflowId_Call) RunAndReturn(run func(context.Context, string) (context.Context, error)) *MockAuth_authForWorkflowId_Call
type MockAuth_authFromExecutionID_Call ¶ added in v1.1.1404
MockAuth_authFromExecutionID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authFromExecutionID'
func (*MockAuth_authFromExecutionID_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authFromExecutionID_Call) Return(_a0 context.Context, _a1 *model.Execution, _a2 error) *MockAuth_authFromExecutionID_Call
func (*MockAuth_authFromExecutionID_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authFromExecutionID_Call) Run(run func(ctx context.Context, executionID string)) *MockAuth_authFromExecutionID_Call
func (*MockAuth_authFromExecutionID_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authFromExecutionID_Call) RunAndReturn(run func(context.Context, string) (context.Context, *model.Execution, error)) *MockAuth_authFromExecutionID_Call
type MockAuth_authFromJobID_Call ¶ added in v1.1.1404
MockAuth_authFromJobID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authFromJobID'
func (*MockAuth_authFromJobID_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authFromJobID_Call) Return(_a0 context.Context, _a1 *model.WorkflowState, _a2 error) *MockAuth_authFromJobID_Call
func (*MockAuth_authFromJobID_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authFromJobID_Call) Run(run func(ctx context.Context, trackingID string)) *MockAuth_authFromJobID_Call
func (*MockAuth_authFromJobID_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authFromJobID_Call) RunAndReturn(run func(context.Context, string) (context.Context, *model.WorkflowState, error)) *MockAuth_authFromJobID_Call
type MockAuth_authFromProcessInstanceID_Call ¶ added in v1.1.1404
MockAuth_authFromProcessInstanceID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authFromProcessInstanceID'
func (*MockAuth_authFromProcessInstanceID_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authFromProcessInstanceID_Call) Return(_a0 context.Context, _a1 *model.ProcessInstance, _a2 error) *MockAuth_authFromProcessInstanceID_Call
func (*MockAuth_authFromProcessInstanceID_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authFromProcessInstanceID_Call) Run(run func(ctx context.Context, instanceID string)) *MockAuth_authFromProcessInstanceID_Call
func (*MockAuth_authFromProcessInstanceID_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authFromProcessInstanceID_Call) RunAndReturn(run func(context.Context, string) (context.Context, *model.ProcessInstance, error)) *MockAuth_authFromProcessInstanceID_Call
type MockAuth_authenticate_Call ¶ added in v1.1.1404
MockAuth_authenticate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authenticate'
func (*MockAuth_authenticate_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authenticate_Call) Return(_a0 context.Context, _a1 header.Values, _a2 error) *MockAuth_authenticate_Call
func (*MockAuth_authenticate_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authenticate_Call) Run(run func(ctx context.Context)) *MockAuth_authenticate_Call
func (*MockAuth_authenticate_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authenticate_Call) RunAndReturn(run func(context.Context) (context.Context, header.Values, error)) *MockAuth_authenticate_Call
type MockAuth_authorize_Call ¶ added in v1.1.1404
type MockAuth_authorize_Call struct {
}MockAuth_authorize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'authorize'
func (*MockAuth_authorize_Call) Return ¶ added in v1.1.1404
func (_c *MockAuth_authorize_Call) Return(_a0 context.Context, _a1 error) *MockAuth_authorize_Call
func (*MockAuth_authorize_Call) Run ¶ added in v1.1.1404
func (_c *MockAuth_authorize_Call) Run(run func(ctx context.Context, workflowName string)) *MockAuth_authorize_Call
func (*MockAuth_authorize_Call) RunAndReturn ¶ added in v1.1.1404
func (_c *MockAuth_authorize_Call) RunAndReturn(run func(context.Context, string) (context.Context, error)) *MockAuth_authorize_Call