handlers

package
v0.0.0-...-1ebf370 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package handlers contains the http handlers which receive requests to be processed by the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mainRouter *mux.Router, cfg *config.Config, kSvc services.KafkaService) error

Register defines all REST endpoints for the API.

Types

type DeltaHandler

type DeltaHandler struct {
	// contains filtered or unexported fields
}

DeltaHandler offers a handler by which to publish a chs-delta onto the a chosen delta kafka topic.

func NewDeltaHandler

func NewDeltaHandler(kSvc services.KafkaService, h helpers.Helper, chv validation.CHValidator,
	cfg *config.Config, doValidationOnly bool, isDelete bool, topic string) *DeltaHandler

NewDeltaHandler returns an DeltaHandler.

func (*DeltaHandler) ServeHTTP

func (kp *DeltaHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP accepts an incoming Delta request via a POST method, validates it and if doValidationOnly flag is set to false, passes it to a Kafka service for further processing along with a chosen chs-delta topic. If errors are encountered then they will be returned via the ResponseWriter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL