Documentation
¶
Index ¶
- func Request[T any, V any](ctx *NatsContext, sub string, send *T, receive *V) (*V, error)
- func Respond[T any](req NatsRequest, data *T, err error)
- type BaseController
- type Config
- type Controller
- type Message
- type NatsClient
- type NatsContext
- type NatsGroup
- type NatsHandlerFunc
- type NatsRequest
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Request ¶
func Request[T any, V any](ctx *NatsContext, sub string, send *T, receive *V) (*V, error)
func Respond ¶
func Respond[T any](req NatsRequest, data *T, err error)
Types ¶
type BaseController ¶
type BaseController interface { network.BaseController SetNatsContext(ctx *NatsContext) NatsContext() *NatsContext }
func NewBaseController ¶
func NewBaseController(basePath string, authProvider network.AuthenticationProvider, authorizeProvider network.AuthorizationProvider) BaseController
type Controller ¶
type Controller interface { BaseController MountNats(group NatsGroup) }
type Message ¶
type Message[T any] struct { Data *T `json:"data,omitempty"` Error *string `json:"error,omitempty"` }
func NewMessage ¶
type NatsClient ¶
func NewNatsClient ¶
func NewNatsClient(config Config) *NatsClient
type NatsContext ¶
type NatsContext struct { context.Context Client *NatsClient Subject string }
func NewNatsContext ¶
func NewNatsContext(client *NatsClient, baseSub string) *NatsContext
type NatsHandlerFunc ¶
type NatsHandlerFunc = micro.HandlerFunc
type NatsRequest ¶
type Router ¶
type Router interface { network.BaseRouter NatsClient() *NatsClient Disconnect() LoadControllers(controllers []Controller) }
Click to show internal directories.
Click to hide internal directories.