Versions in this module Expand all Collapse all v0 v0.0.1 Jan 15, 2024 Changes in this version + const RequestIDKey + const UserIDKey + var MetaKeys = []string + func DecodeNatsResponseFunc(ctx context.Context, msg *nats.Msg) (response interface{}, err error) + func DecodeResponseFunc(ctx context.Context, req micro.Request) (response interface{}, err error) + func GetContextFromNatsMicroRequest(ctx context.Context, request micro.Request) context.Context + func GetContextFromNatsMsg(ctx context.Context, msg *nats.Msg) context.Context + func GetStringFromContext(ctx context.Context, key string) (result string, err error) + func MakeNatsClientEndpoint(publisher *nats.Conn, sub string, options ...PublisherOption) endpoint.Endpoint + func MakeSubjectName(env, serviceName, endpointName string) string + func RegisterEndpointNode[REQ, RESP any](ec EndpointCollector, endpointName string, ...) + func SetNatsMsgFormContext(ctx context.Context, msg *nats.Msg) context.Context + func SetStringToContext(ctx context.Context, k, v string) context.Context + type EmptyReq struct + type EmptyResp struct + type EndpointCollector interface + GetEndpointNode func(key string) EndpointMaker + GetEndpointNodesMapper func() map[string]EndpointMaker + Middlewares func() []gokitendpoint.Middleware + RegisterMiddlewares func(mws ...gokitendpoint.Middleware) + SetEndpointNode func(key string, et EndpointMaker) + type EndpointMaker interface + Endpoint func(mws ...gokitendpoint.Middleware) gokitendpoint.Endpoint + GenerateHttpTransport func() HttpTransportI + GenerateNatsMicroTransport func() NatsMicroTransportI + Middlewares func() []gokitendpoint.Middleware + Name func() string + RegisterMiddlewares func(mws ...gokitendpoint.Middleware) + Request func() interface{} + Response func() interface{} + type EndpointNode struct + EndpointName string + ServiceFunc func(context.Context, REQ) (RESP, error) + func (e *EndpointNode[REQ, RESP]) Endpoint(mws ...gokitendpoint.Middleware) gokitendpoint.Endpoint + func (e *EndpointNode[REQ, RESP]) GenerateHttpTransport() HttpTransportI + func (e *EndpointNode[REQ, RESP]) GenerateNatsMicroTransport() NatsMicroTransportI + func (e *EndpointNode[REQ, RESP]) Middlewares() []gokitendpoint.Middleware + func (e *EndpointNode[REQ, RESP]) Name() string + func (e *EndpointNode[REQ, RESP]) RegisterMiddlewares(mws ...gokitendpoint.Middleware) + func (e *EndpointNode[REQ, RESP]) Request() interface{} + func (e *EndpointNode[REQ, RESP]) Response() interface{} + type EndpointNodeMapper struct + func NewEndpointNodeMapper() EndpointNodeMapper + func (e *EndpointNodeMapper) GetEndpointNode(key string) EndpointMaker + func (e *EndpointNodeMapper) GetEndpointNodesMapper() map[string]EndpointMaker + func (e *EndpointNodeMapper) Middlewares() []gokitendpoint.Middleware + func (e *EndpointNodeMapper) RegisterMiddlewares(mws ...gokitendpoint.Middleware) + func (e *EndpointNodeMapper) SetEndpointNode(key string, et EndpointMaker) + type ErrDetail struct + Detail string + type GenericCommonResponse struct + Code int + Data T + Msg string + type GenericModelList struct + List []T + type GenericResponse struct + Code int + Data T + Msg string + func ErrResp(msg string, err error) GenericResponse[interface{}] + func NewResponse(code int, msg string, data interface{}) GenericResponse[interface{}] + func SuccessResp(msg string, data interface{}) GenericResponse[interface{}] + type HttpTransport struct + EndpointName string + func (t *HttpTransport[REQ, RESP]) MakeDecodeRequestFunc() coder.DecodeHttpRequestFunc + func (t *HttpTransport[REQ, RESP]) MakeDecodeResponseFunc() coder.DecodeHttpResponseFunc + func (t *HttpTransport[REQ, RESP]) MakeEncodeRequestFunc() coder.EncodeHttpRequestFunc + func (t *HttpTransport[REQ, RESP]) MakeEncodeResponseFunc() coder.EncodeHttpResponseFunc + type HttpTransportI interface + MakeDecodeRequestFunc func() coder.DecodeHttpRequestFunc + MakeDecodeResponseFunc func() coder.DecodeHttpResponseFunc + MakeEncodeRequestFunc func() coder.EncodeHttpRequestFunc + MakeEncodeResponseFunc func() coder.EncodeHttpResponseFunc + type IdPathReq struct + Id string + type IdReq struct + Id string + type IdsReq struct + Ids []string + type MapReq map[string]interface + type NatsMicroTransport struct + EndpointName string + func (t *NatsMicroTransport[REQ, RESP]) MakeDecodeRequestFunc() coder.DecodeNatsMicroRequestFunc + func (t *NatsMicroTransport[REQ, RESP]) MakeDecodeResponseFunc() coder.DecodeNatsMicroResponseFunc + func (t *NatsMicroTransport[REQ, RESP]) MakeEncodeRequestFunc() coder.EncodeNatsMicroRequestFunc + func (t *NatsMicroTransport[REQ, RESP]) MakeEncodeResponseFunc() coder.EncodeNatsMicroResponseFunc + type NatsMicroTransportI interface + MakeDecodeRequestFunc func() coder.DecodeNatsMicroRequestFunc + MakeDecodeResponseFunc func() coder.DecodeNatsMicroResponseFunc + MakeEncodeRequestFunc func() coder.EncodeNatsMicroRequestFunc + MakeEncodeResponseFunc func() coder.EncodeNatsMicroResponseFunc + type NatsTransport struct + EndpointName string + func (t *NatsTransport[REQ, RESP]) MakeDecodeRequestFunc() natstransport.DecodeRequestFunc + func (t *NatsTransport[REQ, RESP]) MakeDecodeResponseFunc() natstransport.DecodeResponseFunc + func (t *NatsTransport[REQ, RESP]) MakeEncodeRequestFunc() natstransport.EncodeRequestFunc + func (t *NatsTransport[REQ, RESP]) MakeEncodeResponseFunc() natstransport.EncodeResponseFunc + type NatsTransportI interface + MakeDecodeRequestFunc func() natstransport.DecodeRequestFunc + MakeDecodeResponseFunc func() natstransport.DecodeResponseFunc + MakeEncodeRequestFunc func() natstransport.EncodeRequestFunc + MakeEncodeResponseFunc func() natstransport.EncodeResponseFunc + type PageReq struct + Page int64 + PageSize int64 + type PageResp struct + Page int64 + PageSize int64 + Total int64 + type Publisher struct + func NewNatsPublisher(publisher *nats.Conn, subject string, enc natstransport.EncodeRequestFunc, ...) *Publisher + func NewPublisher(publisher *nats.Conn, sub string, options ...PublisherOption) *Publisher + func (p Publisher) Endpoint() endpoint.Endpoint + type PublisherOption func(*Publisher) + func PublisherAfter(after ...natstransport.PublisherResponseFunc) PublisherOption + func PublisherBefore(before ...natstransport.RequestFunc) PublisherOption + func PublisherTimeout(timeout time.Duration) PublisherOption + type RequestFunc func(ctx context.Context, req any) (resp GenericResponse[T], err error) + func NewNatsClientRequest[T any](nc *nats.Conn, envGroup string, serviceName string, endpointName string, ...) RequestFunc[T] + type Response struct + Code int + Data interface{} + Msg string + type SearchReq struct + Search string