Documentation
¶
Index ¶
- func ErrInternalError(err error) render.Renderer
- func ErrInvalidJobRequest(err error) render.Renderer
- func ErrKafkaError(err error) render.Renderer
- type Correlation
- type ErrResponse
- type HandlerEventReq
- type Handlers
- func (h *Handlers) AddCorrelator(ccUUID string, respChan *chan jsonutils.JSONMap, evReq *HandlerEventReq) *Correlation
- func (h *Handlers) DeleteCorrelator(ccUUID string)
- func (h *Handlers) GetCorrelator(ccUUID string) *Correlation
- func (h *Handlers) InitKafka(service *jsonutils.JSONMap, kafkaCfg *jsonutils.JSONMap) *kafka.Writer
- func (h *Handlers) Kafka(service *jsonutils.JSONMap, kafkaCfg *jsonutils.JSONMap) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInternalError ¶
ErrInternalError return internal error
func ErrInvalidJobRequest ¶
ErrInvalidJobRequest return invalid job request error
Types ¶
type Correlation ¶
type Correlation struct {
// contains filtered or unexported fields
}
Correlation a correlator entry
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code StatusText string `json:"status"` // user-level status message AppCode int64 `json:"code,omitempty"` // application-specific error code ErrorText string `json:"error,omitempty"` // application-level error message, for debugging }
ErrResponse struct for http error responses
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
Render to render a http return code
type HandlerEventReq ¶
type HandlerEventReq struct { EventUUID string `json:"event_uuid"` Method string `json:"method"` Path string `json:"path"` Headers map[string][]string `json:"headers"` Body []byte `json:"body"` TransferEncoding []string `json:"transfer_encoding"` Form url.Values `json:"form"` }
HandlerEventReq a generic event struct for forwarding via an event queue embedded by handlers as a base structure
func CreateEventReq ¶
func CreateEventReq(servicePath *string, w http.ResponseWriter, r *http.Request) (*HandlerEventReq, error)
CreateEventReq map event to event structure
func (*HandlerEventReq) GetBytes ¶
func (hreq *HandlerEventReq) GetBytes() ([]byte, error)
GetBytes get event structure as json byte array
type Handlers ¶
type Handlers struct { }
Handlers smart proxy api handlers
func (*Handlers) AddCorrelator ¶
func (h *Handlers) AddCorrelator(ccUUID string, respChan *chan jsonutils.JSONMap, evReq *HandlerEventReq) *Correlation
AddCorrelator adds UUID lookup for a request's response to be fed back to the requestor.
func (*Handlers) DeleteCorrelator ¶
DeleteCorrelator deletes the UUID/response channel
func (*Handlers) GetCorrelator ¶
func (h *Handlers) GetCorrelator(ccUUID string) *Correlation
GetCorrelator Gets the response channel by request UUID
Click to show internal directories.
Click to hide internal directories.