api

package
v1.1.1380 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 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.

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 {
	// contains filtered or unexported fields
}

Endpoints provides API endpoints for SHAR

func New

func New(operations workflow.Ops, nc *natz.NatsConnConfiguration, auth Auth, options *option.ServerOptions) (*Endpoints, error)

New creates a new instance of the SHAR API server

func (*Endpoints) Listen added in v1.1.1131

func (s *Endpoints) Listen() error

Listen starts the SHAR API server listening to incoming requests

func (*Endpoints) Shutdown added in v1.1.1131

func (s *Endpoints) Shutdown()

Shutdown gracefully shuts down the SHAR API server

type SharAuth added in v1.1.1377

type SharAuth struct {
	// contains filtered or unexported fields
}

SharAuth is a struct implementing the Auth interface

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

Jump to

Keyboard shortcuts

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