route

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: AGPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Handlers       map[string][]func(echo.RouteRegister)
	Namers         []func(string) string
	Middlewares    map[string][]interface{}
	PreMiddlewares map[string][]interface{}
	Metas          map[string]echo.H
}

func NewGroup

func NewGroup(groupNamers ...func(string) string) *Group

func (*Group) AddNamer

func (g *Group) AddNamer(namers ...func(string) string)

func (*Group) Apply

func (g *Group) Apply(e echo.RouteRegister, rootGroup string)

func (*Group) Pre

func (g *Group) Pre(groupName string, middlewares ...interface{})

func (*Group) Register

func (g *Group) Register(groupName string, fn func(echo.RouteRegister), middlewares ...interface{})

func (*Group) SetMeta

func (g *Group) SetMeta(groupName string, meta echo.H)

func (*Group) SetMetaKV

func (g *Group) SetMetaKV(groupName string, key string, val interface{})

func (*Group) SetNamer

func (g *Group) SetNamer(namers ...func(string) string)

func (*Group) Use

func (g *Group) Use(groupName string, middlewares ...interface{})

type Host

type Host struct {
	Name        string
	Alias       string
	Middlewares []interface{}
	Group       *Group
}

func (*Host) Register

func (h *Host) Register(groupName string, fn func(echo.RouteRegister), middlewares ...interface{})

func (*Host) SetAlias

func (h *Host) SetAlias(alias string) Hoster

func (*Host) Use

func (h *Host) Use(middlewares ...interface{})

type Hoster

type Hoster interface {
	Use(middlewares ...interface{})
	SetAlias(alias string) Hoster
	Register(groupName string, fn func(echo.RouteRegister), middlewares ...interface{})
}

type IRegister

type IRegister interface {
	Echo() *echo.Echo
	Routes() []*echo.Route
	Logger() logger.Logger
	Prefix() string
	SetPrefix(prefix string) IRegister
	SetSkipper(f func() bool) IRegister
	Skipped() bool
	MakeHandler(handler interface{}, requests ...interface{}) echo.Handler
	MetaHandler(m echo.H, handler interface{}, requests ...interface{}) echo.Handler
	MetaHandlerWithRequest(m echo.H, handler interface{}, request interface{}, methods ...string) echo.Handler
	HandlerWithRequest(handler interface{}, requests interface{}, methods ...string) echo.Handler
	AddGroupNamer(namers ...func(string) string) IRegister
	SetGroupNamer(namers ...func(string) string) IRegister
	SetRootGroup(groupName string) IRegister
	RootGroup() string
	Apply() IRegister
	Pre(middlewares ...interface{}) IRegister
	Use(middlewares ...interface{}) IRegister
	PreToGroup(groupName string, middlewares ...interface{}) IRegister
	UseToGroup(groupName string, middlewares ...interface{}) IRegister
	Register(fn func(echo.RouteRegister)) IRegister
	RegisterToGroup(groupName string, fn func(echo.RouteRegister), middlewares ...interface{}) MetaSetter
	Host(hostName string, middlewares ...interface{}) Hoster
	Clear() IRegister
}

func NewRegister

func NewRegister(e *echo.Echo, groupNamers ...func(string) string) IRegister

type MetaSetter

type MetaSetter interface {
	SetMeta(meta echo.H) MetaSetter
	SetMetaKV(key string, val interface{}) MetaSetter
}

type Register

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

func (*Register) AddGroupNamer

func (r *Register) AddGroupNamer(namers ...func(string) string) IRegister

func (*Register) Apply

func (r *Register) Apply() IRegister

func (*Register) Clear

func (r *Register) Clear() IRegister

func (*Register) Echo

func (r *Register) Echo() *echo.Echo

func (*Register) HandlerWithRequest

func (r *Register) HandlerWithRequest(handler interface{}, requests interface{}, methods ...string) echo.Handler

func (*Register) Host

func (r *Register) Host(hostName string, middlewares ...interface{}) Hoster

func (*Register) Logger

func (r *Register) Logger() logger.Logger

func (*Register) MakeHandler

func (r *Register) MakeHandler(handler interface{}, requests ...interface{}) echo.Handler

func (*Register) MetaHandler

func (r *Register) MetaHandler(m echo.H, handler interface{}, requests ...interface{}) echo.Handler

func (*Register) MetaHandlerWithRequest

func (r *Register) MetaHandlerWithRequest(m echo.H, handler interface{}, requests interface{}, methods ...string) echo.Handler

func (*Register) Pre

func (r *Register) Pre(middlewares ...interface{}) IRegister

func (*Register) PreToGroup

func (r *Register) PreToGroup(groupName string, middlewares ...interface{}) IRegister

func (*Register) Prefix

func (r *Register) Prefix() string

func (*Register) Register

func (r *Register) Register(fn func(echo.RouteRegister)) IRegister

func (*Register) RegisterToGroup

func (r *Register) RegisterToGroup(groupName string, fn func(echo.RouteRegister), middlewares ...interface{}) MetaSetter

func (*Register) RootGroup

func (r *Register) RootGroup() string

func (*Register) Routes

func (r *Register) Routes() []*echo.Route

func (*Register) SetGroupNamer

func (r *Register) SetGroupNamer(namers ...func(string) string) IRegister

func (*Register) SetPrefix

func (r *Register) SetPrefix(prefix string) IRegister

func (*Register) SetRootGroup

func (r *Register) SetRootGroup(groupName string) IRegister

func (*Register) SetSkipper

func (r *Register) SetSkipper(f func() bool) IRegister

func (*Register) Skipped

func (r *Register) Skipped() bool

func (*Register) Use

func (r *Register) Use(middlewares ...interface{}) IRegister

func (*Register) UseToGroup

func (r *Register) UseToGroup(groupName string, middlewares ...interface{}) IRegister

type Registers

type Registers []func(g echo.RouteRegister)

func (Registers) Apply

func (r Registers) Apply(g echo.RouteRegister)

func (*Registers) Register

func (r *Registers) Register(rg ...func(g echo.RouteRegister))

Jump to

Keyboard shortcuts

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