http

package
v0.0.0-...-febeaf7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseModule = fx.Provide(
	NewConfig,
	NewRouter,
)

Functions

func NewRouter

func NewRouter(cfg *Config, lifecycle fx.Lifecycle, logger *zap.Logger) *gin.Engine

Types

type Config

type Config struct {
	Port int `yaml:"port"`
}

func NewConfig

func NewConfig(cfg *config.YAML) (*Config, error)

type Error

type Error struct {
	Code    int     `json:"code"`
	Details []gin.H `json:"details,omitempty"`
	Message string  `json:"message"`
}

func NewError

func NewError(code int, message string) *Error

func (*Error) WithDetails

func (e *Error) WithDetails(details ...gin.H) *Error

func (*Error) WriteJSON

func (e *Error) WriteJSON(ctx *gin.Context)

Jump to

Keyboard shortcuts

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