api

package
v1.1.1500 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

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

func NewEndpoints(operations workflow.Ops, auth Auth, listener *Listener) *Endpoints

NewEndpoints creates a new instance of the Endpoints of the SHAR API server

func (*Endpoints) StartListening added in v1.1.1460

func (s *Endpoints) StartListening() error

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

func (s *Listener) StartListening() error

StartListening iterates over the endpoint definitions and starts listening for requests to them

type MockAuth added in v1.1.1404

type MockAuth struct {
	mock.Mock
}

MockAuth is an autogenerated mock type for the Auth type

func NewMockAuth added in v1.1.1404

func NewMockAuth(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAuth

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

type MockAuth_authForNamedWorkflow_Call struct {
	*mock.Call
}

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 (*MockAuth_authForNamedWorkflow_Call) Run added in v1.1.1404

func (*MockAuth_authForNamedWorkflow_Call) RunAndReturn added in v1.1.1404

type MockAuth_authForNonWorkflow_Call added in v1.1.1404

type MockAuth_authForNonWorkflow_Call struct {
	*mock.Call
}

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 (*MockAuth_authForNonWorkflow_Call) Run added in v1.1.1404

func (*MockAuth_authForNonWorkflow_Call) RunAndReturn added in v1.1.1404

type MockAuth_authForWorkflowId_Call added in v1.1.1404

type MockAuth_authForWorkflowId_Call struct {
	*mock.Call
}

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 (*MockAuth_authForWorkflowId_Call) Run added in v1.1.1404

func (*MockAuth_authForWorkflowId_Call) RunAndReturn added in v1.1.1404

type MockAuth_authFromExecutionID_Call added in v1.1.1404

type MockAuth_authFromExecutionID_Call struct {
	*mock.Call
}

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 (*MockAuth_authFromExecutionID_Call) Run added in v1.1.1404

func (*MockAuth_authFromExecutionID_Call) RunAndReturn added in v1.1.1404

type MockAuth_authFromJobID_Call added in v1.1.1404

type MockAuth_authFromJobID_Call struct {
	*mock.Call
}

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 (*MockAuth_authFromJobID_Call) Run added in v1.1.1404

func (*MockAuth_authFromJobID_Call) RunAndReturn added in v1.1.1404

type MockAuth_authFromProcessInstanceID_Call added in v1.1.1404

type MockAuth_authFromProcessInstanceID_Call struct {
	*mock.Call
}

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 (*MockAuth_authFromProcessInstanceID_Call) Run added in v1.1.1404

func (*MockAuth_authFromProcessInstanceID_Call) RunAndReturn added in v1.1.1404

type MockAuth_authenticate_Call added in v1.1.1404

type MockAuth_authenticate_Call struct {
	*mock.Call
}

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 (*MockAuth_authenticate_Call) Run added in v1.1.1404

func (*MockAuth_authenticate_Call) RunAndReturn added in v1.1.1404

type MockAuth_authorize_Call added in v1.1.1404

type MockAuth_authorize_Call struct {
	*mock.Call
}

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 (*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL