handler

package
v0.1.234 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET     HTTPVERB = 0
	POST             = 1
	PUT              = 2
	DELETE           = 3
	PATCH            = 4
	OPTIONS          = 5
	HEAD             = 6
	CONNECT          = 7
	TRACE            = 8
)

Variables

View Source
var ReflectTypeIHandler = di.GetInterfaceReflectType((*IHandler)(nil))

ReflectTypeIHandler used when your service claims to implement IHandler

View Source
var ReflectTypeIHandlerFactory = di.GetInterfaceReflectType((*IHandlerFactory)(nil))

ReflectTypeIHandlerFactory used when your service claims to implement IHandlerFactory

Functions

func AddScopedIHandler

func AddScopedIHandler(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddScopedIHandler adds a type that implements IHandler

func AddScopedIHandlerByFunc

func AddScopedIHandlerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddScopedIHandlerByFunc adds a type by a custom func

func AddScopedIHandlerByFuncWithMetadata

func AddScopedIHandlerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIHandlerByFuncWithMetadata adds a type by a custom func

func AddScopedIHandlerEx

func AddScopedIHandlerEx(builder *di.Builder, reflectType reflect.Type, httpVerbs []HTTPVERB, path string)

AddScopedIHandlerEx ...

func AddScopedIHandlerFactory

func AddScopedIHandlerFactory(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddScopedIHandlerFactory adds a type that implements IHandlerFactory

func AddScopedIHandlerFactoryByFunc

func AddScopedIHandlerFactoryByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddScopedIHandlerFactoryByFunc adds a type by a custom func

func AddScopedIHandlerFactoryByFuncWithMetadata

func AddScopedIHandlerFactoryByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIHandlerFactoryByFuncWithMetadata adds a type by a custom func

func AddScopedIHandlerFactoryWithMetadata

func AddScopedIHandlerFactoryWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIHandlerFactoryWithMetadata adds a type that implements IHandlerFactory

func AddScopedIHandlerWithMetadata

func AddScopedIHandlerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedIHandlerWithMetadata adds a type that implements IHandler

func AddSingletonIHandler

func AddSingletonIHandler(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddSingletonIHandler adds a type that implements IHandler

func AddSingletonIHandlerByFunc

func AddSingletonIHandlerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddSingletonIHandlerByFunc adds a type by a custom func

func AddSingletonIHandlerByFuncWithMetadata

func AddSingletonIHandlerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerByFuncWithMetadata adds a type by a custom func

func AddSingletonIHandlerByObj

func AddSingletonIHandlerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerByObj adds a prebuilt obj

func AddSingletonIHandlerByObjWithMetadata

func AddSingletonIHandlerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerByObjWithMetadata adds a prebuilt obj

func AddSingletonIHandlerFactory

func AddSingletonIHandlerFactory(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddSingletonIHandlerFactory adds a type that implements IHandlerFactory

func AddSingletonIHandlerFactoryByFunc

func AddSingletonIHandlerFactoryByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddSingletonIHandlerFactoryByFunc adds a type by a custom func

func AddSingletonIHandlerFactoryByFuncWithMetadata

func AddSingletonIHandlerFactoryByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerFactoryByFuncWithMetadata adds a type by a custom func

func AddSingletonIHandlerFactoryByObj

func AddSingletonIHandlerFactoryByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerFactoryByObj adds a prebuilt obj

func AddSingletonIHandlerFactoryByObjWithMetadata

func AddSingletonIHandlerFactoryByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerFactoryByObjWithMetadata adds a prebuilt obj

func AddSingletonIHandlerFactoryWithMetadata

func AddSingletonIHandlerFactoryWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerFactoryWithMetadata adds a type that implements IHandlerFactory

func AddSingletonIHandlerWithMetadata

func AddSingletonIHandlerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonIHandlerWithMetadata adds a type that implements IHandler

func AddTransientIHandler

func AddTransientIHandler(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddTransientIHandler adds a type that implements IHandler

func AddTransientIHandlerByFunc

func AddTransientIHandlerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddTransientIHandlerByFunc adds a type by a custom func

func AddTransientIHandlerByFuncWithMetadata

func AddTransientIHandlerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIHandlerByFuncWithMetadata adds a type by a custom func

func AddTransientIHandlerFactory

func AddTransientIHandlerFactory(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddTransientIHandlerFactory adds a type that implements IHandlerFactory

func AddTransientIHandlerFactoryByFunc

func AddTransientIHandlerFactoryByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddTransientIHandlerFactoryByFunc adds a type by a custom func

func AddTransientIHandlerFactoryByFuncWithMetadata

func AddTransientIHandlerFactoryByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIHandlerFactoryByFuncWithMetadata adds a type by a custom func

func AddTransientIHandlerFactoryWithMetadata

func AddTransientIHandlerFactoryWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIHandlerFactoryWithMetadata adds a type that implements IHandlerFactory

func AddTransientIHandlerWithMetadata

func AddTransientIHandlerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientIHandlerWithMetadata adds a type that implements IHandler

func GetIHandlerDefinition

func GetIHandlerDefinition(ctn di.Container) *di.Def

GetIHandlerDefinition returns that last definition registered that this container can provide

func GetIHandlerDefinitions

func GetIHandlerDefinitions(ctn di.Container) []*di.Def

GetIHandlerDefinitions returns all definitions that this container can provide

func GetIHandlerFactoryDefinition

func GetIHandlerFactoryDefinition(ctn di.Container) *di.Def

GetIHandlerFactoryDefinition returns that last definition registered that this container can provide

func GetIHandlerFactoryDefinitions

func GetIHandlerFactoryDefinitions(ctn di.Container) []*di.Def

GetIHandlerFactoryDefinitions returns all definitions that this container can provide

func RemoveAllIHandler

func RemoveAllIHandler(builder *di.Builder)

RemoveAllIHandler removes all IHandler from the DI

func RemoveAllIHandlerFactory

func RemoveAllIHandlerFactory(builder *di.Builder)

RemoveAllIHandlerFactory removes all IHandlerFactory from the DI

Types

type HTTPVERB

type HTTPVERB uint

HTTPVERB is a list of HTTP verbs

func (HTTPVERB) String

func (s HTTPVERB) String() string

type IHandler

type IHandler interface {
	GetMiddleware() []echo.MiddlewareFunc
	Do(c echo.Context) error
}

IHandler ...

func GetIHandlerFromContainer

func GetIHandlerFromContainer(ctn di.Container) IHandler

GetIHandlerFromContainer alternative to SafeGetIHandlerFromContainer but panics of object is not present

func GetManyIHandlerFromContainer

func GetManyIHandlerFromContainer(ctn di.Container) []IHandler

GetManyIHandlerFromContainer alternative to SafeGetManyIHandlerFromContainer but panics of object is not present

func SafeGetIHandlerFromContainer

func SafeGetIHandlerFromContainer(ctn di.Container) (IHandler, error)

SafeGetIHandlerFromContainer trys to get the object by type, will not panic, returns nil and error

func SafeGetManyIHandlerFromContainer

func SafeGetManyIHandlerFromContainer(ctn di.Container) ([]IHandler, error)

SafeGetManyIHandlerFromContainer trys to get the object by type, will not panic, returns nil and error

type IHandlerFactory

type IHandlerFactory interface {
	RegisterHandlers(app *echo.Group)
}

IHandlerFactory ...

func GetIHandlerFactoryFromContainer

func GetIHandlerFactoryFromContainer(ctn di.Container) IHandlerFactory

GetIHandlerFactoryFromContainer alternative to SafeGetIHandlerFactoryFromContainer but panics of object is not present

func GetManyIHandlerFactoryFromContainer

func GetManyIHandlerFactoryFromContainer(ctn di.Container) []IHandlerFactory

GetManyIHandlerFactoryFromContainer alternative to SafeGetManyIHandlerFactoryFromContainer but panics of object is not present

func SafeGetIHandlerFactoryFromContainer

func SafeGetIHandlerFactoryFromContainer(ctn di.Container) (IHandlerFactory, error)

SafeGetIHandlerFactoryFromContainer trys to get the object by type, will not panic, returns nil and error

func SafeGetManyIHandlerFactoryFromContainer

func SafeGetManyIHandlerFactoryFromContainer(ctn di.Container) ([]IHandlerFactory, error)

SafeGetManyIHandlerFactoryFromContainer trys to get the object by type, will not panic, returns nil and error

Jump to

Keyboard shortcuts

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