server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API        = "api"
	MIDDLEWARE = "middleware"
)

Variables

This section is empty.

Functions

func Assemble

func Assemble(ctx *fiber.Ctx, field *reflect.StructField) (values []reflect.Value, err error)

func RegisterController

func RegisterController(bean ControllerBean)

func RegisterGlobalMiddleware

func RegisterGlobalMiddleware(middleware GlobalMiddleware)

func RunServer

func RunServer(ctx context.Context) error

func ShutdownServer

func ShutdownServer(context context.Context) error

func Validate

func Validate(items []reflect.Value) (err error)

Types

type Config

type Config struct {
	Server struct {
		Port        string `mapstructure:"port"`
		Swagger     string `mapstructure:"swagger"`
		ContextPath string `mapstructure:"context-path"`
	} `mapstructure:"server"`
}

type ControllerBean

type ControllerBean interface {
	GetControllerPath() string
}

type GlobalMiddleware

type GlobalMiddleware interface {
	GetMiddleware() fiber.Handler
	GetPathPrefix() string
	GetPriority() int
}
type Header struct{}

type PathParam

type PathParam struct{}

type QueryParam

type QueryParam struct{}

type RequestBody

type RequestBody struct{}

type SelfValidator

type SelfValidator interface {
	SelfValidate() error
}

type Valid

type Valid struct{}

type ValidError

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

func NewValidError

func NewValidError(msg string) *ValidError

func (*ValidError) Error

func (e *ValidError) Error() string

Jump to

Keyboard shortcuts

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