Documentation ¶
Index ¶
- func ErrorHandler(logger *logr.Logger, h HandlerWithErrors) micro.HandlerFunc
- func HandleNotify(s micro.Service, healthFuncs ...func(chan<- string, micro.Service)) error
- func RequestLogger(l *logr.Logger, subject string) (*logr.Logger, error)
- func SubjectToRequestID(s string) (string, error)
- type ClientError
- type ClientOpt
- type HandlerWithErrors
- type NATSClient
- type NATSGraph
- type NatsLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶ added in v1.0.0
func ErrorHandler(logger *logr.Logger, h HandlerWithErrors) micro.HandlerFunc
ErrorHandler wraps a normal micro endpoint and allows for returning errors natively. Errors are checked and if an error is a client error, details are returned, otherwise a 500 is returned and logged
func HandleNotify ¶ added in v1.0.0
func RequestLogger ¶ added in v1.0.0
func SubjectToRequestID ¶ added in v1.0.0
Types ¶
type ClientError ¶ added in v1.0.0
type ClientOpt ¶
type ClientOpt func(*NATSClient)
func SetGraphQLExecutableSchema ¶
func SetGraphQLExecutableSchema(e graphql.ExecutableSchema) ClientOpt
func SetOptions ¶
func SetOptions(opts ...nats.Option) ClientOpt
func SetServers ¶
func SetSubject ¶
type HandlerWithErrors ¶ added in v1.0.0
type NATSClient ¶
type NATSClient struct { Subject string Servers string Options []nats.Option Conn *nats.Conn JS nats.JetStreamContext NATSGraph }
func NewNATSClient ¶
func NewNATSClient(subject string, servers []string, opts ...ClientOpt) *NATSClient
func (*NATSClient) Connect ¶
func (n *NATSClient) Connect() error
func (*NATSClient) HandleAndLogRequests ¶
func (n *NATSClient) HandleAndLogRequests(m *nats.Msg)
func (*NATSClient) Resolve ¶
func (n *NATSClient) Resolve(errChan chan<- error)
type NATSGraph ¶
type NATSGraph struct { ExecutableSchema graphql.ExecutableSchema Exec *executor.Executor }
type NatsLogger ¶ added in v1.0.0
type NatsLogger struct {
// contains filtered or unexported fields
}
func NewNatsLogger ¶ added in v1.0.0
func NewNatsLogger(subject string, nc *nats.Conn) NatsLogger
Click to show internal directories.
Click to hide internal directories.