router

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type After

type After[T any] func(stream T) error

type Before

type Before[T any] func(stream T) error

type Func

type Func[T any] func(stream T) error

type Group

type Group[T any, P any] struct {
	// contains filtered or unexported fields
}

func (*Group[T, P]) After

func (g *Group[T, P]) After(after ...After[T]) *Group[T, P]

func (*Group[T, P]) Before

func (g *Group[T, P]) Before(before ...Before[T]) *Group[T, P]

func (*Group[T, P]) CancelAfter

func (g *Group[T, P]) CancelAfter() *Group[T, P]

func (*Group[T, P]) CancelBefore

func (g *Group[T, P]) CancelBefore() *Group[T, P]

func (*Group[T, P]) Create

func (g *Group[T, P]) Create() *Handler[T, P]

func (*Group[T, P]) Desc

func (g *Group[T, P]) Desc(desc ...string) *Group[T, P]

func (*Group[T, P]) Handler

func (g *Group[T, P]) Handler(fn func(handler *Handler[T, P]))

func (*Group[T, P]) Remove

func (g *Group[T, P]) Remove(path ...string)

func (*Group[T, P]) RemoveAfter

func (g *Group[T, P]) RemoveAfter(after ...After[T]) *Group[T, P]

func (*Group[T, P]) RemoveBefore

func (g *Group[T, P]) RemoveBefore(before ...Before[T]) *Group[T, P]

type Handler

type Handler[T any, P any] struct {
	// contains filtered or unexported fields
}

func (*Handler[T, P]) Connect

func (rh *Handler[T, P]) Connect(path ...string) *Route[T, P]

func (*Handler[T, P]) Delete

func (rh *Handler[T, P]) Delete(path ...string) *Route[T, P]

func (*Handler[T, P]) Get

func (rh *Handler[T, P]) Get(path ...string) *Route[T, P]

func (*Handler[T, P]) Group

func (rh *Handler[T, P]) Group(path ...string) *Group[T, P]

func (*Handler[T, P]) Head

func (rh *Handler[T, P]) Head(path ...string) *Route[T, P]

func (*Handler[T, P]) Method

func (rh *Handler[T, P]) Method(method ...string) *MethodsHandler[T, P]

func (*Handler[T, P]) Options

func (rh *Handler[T, P]) Options(path ...string) *Route[T, P]

func (*Handler[T, P]) Patch

func (rh *Handler[T, P]) Patch(path ...string) *Route[T, P]

func (*Handler[T, P]) Post

func (rh *Handler[T, P]) Post(path ...string) *Route[T, P]

func (*Handler[T, P]) Put

func (rh *Handler[T, P]) Put(path ...string) *Route[T, P]

func (*Handler[T, P]) Remove

func (rh *Handler[T, P]) Remove(path ...string)

func (*Handler[T, P]) Route

func (rh *Handler[T, P]) Route(path ...string) *Route[T, P]

func (*Handler[T, P]) Trace

func (rh *Handler[T, P]) Trace(path ...string) *Route[T, P]

type MethodsHandler

type MethodsHandler[T any, P any] struct {
	// contains filtered or unexported fields
}

func (*MethodsHandler[T, P]) Route

func (m *MethodsHandler[T, P]) Route(path ...string) *Route[T, P]

type MethodsRouter

type MethodsRouter[T any, P any] struct {
	// contains filtered or unexported fields
}

func (*MethodsRouter[T, P]) Route

func (m *MethodsRouter[T, P]) Route(path ...string) *Route[T, P]

type Middle

type Middle[T any] func(T)

type Node

type Node[T any, P any] struct {
	Data     P
	Info     string
	Desc     []string
	Route    []byte
	Function Func[T]
	Before   []Before[T]
	After    []After[T]
	Method   []string
}

type Route

type Route[T any, P any] struct {
	// contains filtered or unexported fields
}

func (*Route[T, P]) After

func (r *Route[T, P]) After(after ...After[T]) *Route[T, P]

func (*Route[T, P]) Before

func (r *Route[T, P]) Before(before ...Before[T]) *Route[T, P]

func (*Route[T, P]) CancelAfter

func (r *Route[T, P]) CancelAfter() *Route[T, P]

func (*Route[T, P]) CancelBefore

func (r *Route[T, P]) CancelBefore() *Route[T, P]

func (*Route[T, P]) Data

func (r *Route[T, P]) Data(data P) *Route[T, P]

func (*Route[T, P]) Desc

func (r *Route[T, P]) Desc(desc ...string) *Route[T, P]

func (*Route[T, P]) Handler

func (r *Route[T, P]) Handler(fn Func[T])

func (*Route[T, P]) RemoveAfter

func (r *Route[T, P]) RemoveAfter(after ...After[T]) *Route[T, P]

func (*Route[T, P]) RemoveBefore

func (r *Route[T, P]) RemoveBefore(before ...Before[T]) *Route[T, P]

type Router

type Router[T any, P any] struct {
	StrictMode bool
	// contains filtered or unexported fields
}

func (*Router[T, P]) Create

func (r *Router[T, P]) Create() *Handler[T, P]

func (*Router[T, P]) GetAllRouters

func (r *Router[T, P]) GetAllRouters() []*Node[T, P]

func (*Router[T, P]) GetRoute

func (r *Router[T, P]) GetRoute(path string) (*trie.Node[*Node[T, P]], string)

func (*Router[T, P]) Group

func (r *Router[T, P]) Group(path ...string) *Group[T, P]

func (*Router[T, P]) Method

func (r *Router[T, P]) Method(method ...string) *MethodsRouter[T, P]

func (*Router[T, P]) Remove

func (r *Router[T, P]) Remove(path ...string)

func (*Router[T, P]) Route

func (r *Router[T, P]) Route(path ...string) *Route[T, P]

func (*Router[T, P]) SetGlobalAfter

func (r *Router[T, P]) SetGlobalAfter(after ...After[T])

func (*Router[T, P]) SetGlobalBefore

func (r *Router[T, P]) SetGlobalBefore(before ...Before[T])

Jump to

Keyboard shortcuts

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