router

package
v0.0.0-...-dff0e45 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequiredTag

func GetRequiredTag(tag reflect.StructTag, key string) string

func GetTag

func GetTag[T TagType](tag reflect.StructTag, key string, allowEmpty, required bool) T

func GetValue

func GetValue[T any](sv reflect.Value, retries int) (T, bool)

func GetValueDirection

func GetValueDirection[T any](sv reflect.Value, retries int, direction NextDirection) (t T, _ bool)

func IterStruct

func IterStruct(v reflect.Value, fn func(reflect.Value, reflect.Type, reflect.StructField))

func MustBeExported

func MustBeExported(sf reflect.StructField)

func ReflectToStruct

func ReflectToStruct(v reflect.Value) (reflect.Value, reflect.Type)

Types

type API

type API interface {
	Version() uint
}

type Handler

type Handler interface {
	Serve(ctx *gin.Context)
}

type NextDirection

type NextDirection interface {
	// contains filtered or unexported methods
}

func ReflectDown

func ReflectDown() NextDirection

func ReflectUp

func ReflectUp() NextDirection

type Router

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

func New

func New() *Router

func (*Router) AddAPI

func (r *Router) AddAPI(api API)

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(ctx context.Context, network, addr string) error

type TagType

type TagType interface {
	string | []string
}

Jump to

Keyboard shortcuts

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