helpers

package
v0.0.0-...-9214b66 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorWrapper

func ErrorWrapper(h APIFunc) echo.HandlerFunc

func InvalidJSON

func InvalidJSON() error

func ValidateLogData

func ValidateLogData(logData types.LogData) error

func WriteJSON

func WriteJSON(c echo.Context, statusCode int, v any) error

Types

type APIError

type APIError struct {
	StatusCode int    `json:"statusCode"`
	Msg        string `json:"msg"`
}

func NewAPIError

func NewAPIError(statusCode int, err error) APIError

func (APIError) Error

func (e APIError) Error() string

type APIFunc

type APIFunc func(c echo.Context) error

type KafkaConfig

type KafkaConfig struct {
	KafkaBroker  string
	Topic        string
	NumPartition int
	Replication  int
}

func NewKafkaConfig

func NewKafkaConfig(kafkaBroker, topic string, numPartition, replication int) *KafkaConfig

func ReadKafkaConfig

func ReadKafkaConfig() *KafkaConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳