Documentation ¶
Index ¶
- func Request[T any, V any](ctx *Context, subject string, send *T, receive *V) (*V, error)
- func Respond[T any](req NatsRequest, data *T, err error)
- type BaseController
- type Config
- type Context
- type Controller
- type Message
- type Module
- type NatsClient
- type NatsGroup
- type NatsHandlerFunc
- type NatsRequest
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Respond ¶
func Respond[T any](req NatsRequest, data *T, err error)
Types ¶
type BaseController ¶
type BaseController interface { network.BaseController Context() *Context }
func NewBaseController ¶
func NewBaseController(basePath string, authProvider network.AuthenticationProvider, authorizeProvider network.AuthorizationProvider) BaseController
type Context ¶ added in v1.1.3
type Context struct { context.Context NatsClient *NatsClient NatsSubject string }
func EmptyContext ¶ added in v1.1.3
func EmptyContext() *Context
func NewContext ¶ added in v1.1.3
func NewContext(natsClient *NatsClient, baseSub string) *Context
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 Module ¶ added in v1.1.2
type Module[T any] interface { network.BaseModule[T] Controllers() []Controller }
type NatsClient ¶
func NewNatsClient ¶
func NewNatsClient(config *Config) *NatsClient
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.