api

package
v1.1.1035 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 34 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 SharServer

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

SharServer provides API endpoints for SHAR

func New

func New(ns *storage.Nats, panicRecovery bool, apiAuthZFn authz.APIFunc, apiAuthNFn authn.Check, telemetryCfg telemetry.Config) (*SharServer, error)

New creates a new instance of the SHAR API server

func (*SharServer) Listen

func (s *SharServer) Listen() error

Listen starts the SHAR API server listening to incoming requests

func (*SharServer) Shutdown

func (s *SharServer) Shutdown()

Shutdown gracefully shuts down the SHAR API server and Engine

Jump to

Keyboard shortcuts

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