...

Source file src/github.com/go-kit/kit/transport/nats/request_response_funcs.go

Documentation: github.com/go-kit/kit/transport/nats

     1  package nats
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/nats-io/nats.go"
     7  )
     8  
     9  // RequestFunc may take information from a publisher request and put it into a
    10  // request context. In Subscribers, RequestFuncs are executed prior to invoking the
    11  // endpoint.
    12  type RequestFunc func(context.Context, *nats.Msg) context.Context
    13  
    14  // SubscriberResponseFunc may take information from a request context and use it to
    15  // manipulate a Publisher. SubscriberResponseFuncs are only executed in
    16  // subscribers, after invoking the endpoint but prior to publishing a reply.
    17  type SubscriberResponseFunc func(context.Context, *nats.Conn) context.Context
    18  
    19  // PublisherResponseFunc may take information from an NATS request and make the
    20  // response available for consumption. ClientResponseFuncs are only executed in
    21  // clients, after a request has been made, but prior to it being decoded.
    22  type PublisherResponseFunc func(context.Context, *nats.Msg) context.Context
    23  

View as plain text