request

package
v0.1.194 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeIItems = di.GetInterfaceReflectType((*IItems)(nil))

ReflectTypeIItems used when your service claims to implement IItems

View Source
var ReflectTypeIRequest = di.GetInterfaceReflectType((*IRequest)(nil))

ReflectTypeIRequest used when your service claims to implement IRequest

Functions

func AddScopedIItems

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

AddScopedIItems adds a type that implements IItems

func AddScopedIItemsByFunc

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

AddScopedIItemsByFunc adds a type by a custom func

func AddScopedIRequest

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

AddScopedIRequest adds a type that implements IRequest

func AddScopedIRequestByFunc

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

AddScopedIRequestByFunc adds a type by a custom func

func AddSingletonIItems

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

AddSingletonIItems adds a type that implements IItems

func AddSingletonIItemsByFunc

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

AddSingletonIItemsByFunc adds a type by a custom func

func AddSingletonIItemsByObj

func AddSingletonIItemsByObj(builder *di.Builder, obj interface{})

AddSingletonIItemsByObj adds a prebuilt obj

func AddSingletonIRequest

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

AddSingletonIRequest adds a type that implements IRequest

func AddSingletonIRequestByFunc

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

AddSingletonIRequestByFunc adds a type by a custom func

func AddSingletonIRequestByObj

func AddSingletonIRequestByObj(builder *di.Builder, obj interface{})

AddSingletonIRequestByObj adds a prebuilt obj

func AddTransientIItems

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

AddTransientIItems adds a type that implements IItems

func AddTransientIItemsByFunc

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

AddTransientIItemsByFunc adds a type by a custom func

func AddTransientIRequest

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

AddTransientIRequest adds a type that implements IRequest

func AddTransientIRequestByFunc

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

AddTransientIRequestByFunc adds a type by a custom func

func RemoveAllIItems

func RemoveAllIItems(builder *di.Builder)

RemoveAllIItems removes all IItems from the DI

func RemoveAllIRequest

func RemoveAllIRequest(builder *di.Builder)

RemoveAllIRequest removes all IRequest from the DI

Types

type IInnerRequest

type IInnerRequest interface {
	IRequest
	SetMetadata(md metautils.NiceMD)
	SetUnaryServerInfo(info *grpc.UnaryServerInfo)
	SetContext(context.Context)
}

IInnerRequest ...

type IItems

type IItems interface {
	Set(key string, value interface{})
	Get(key string) interface{}
	Delete(key string)
	Clear()
	Keys() []string
	GetItems() map[string]interface{}
}

IItems ...

func GetIItemsFromContainer

func GetIItemsFromContainer(ctn di.Container) IItems

GetIItemsFromContainer alternative to SafeGetIItemsFromContainer but panics of object is not present

func GetManyIItemsFromContainer added in v0.1.178

func GetManyIItemsFromContainer(ctn di.Container) []IItems

GetManyIItemsFromContainer alternative to SafeGetManyIItemsFromContainer but panics of object is not present

func SafeGetIItemsFromContainer

func SafeGetIItemsFromContainer(ctn di.Container) (IItems, error)

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

func SafeGetManyIItemsFromContainer added in v0.1.178

func SafeGetManyIItemsFromContainer(ctn di.Container) ([]IItems, error)

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

type IRequest

type IRequest interface {
	GetMetadata() metautils.NiceMD
	GetItems() IItems
	GetUnaryServerInfo() *grpc.UnaryServerInfo
	GetContext() context.Context
	GetContainer() di.Container
	GetClaimsPrincipal() contracts_claimsprincipal.IClaimsPrincipal
	GetServiceProvider() contracts_serviceprovider.IServiceProvider
}

IRequest ...

func GetIRequestFromContainer

func GetIRequestFromContainer(ctn di.Container) IRequest

GetIRequestFromContainer alternative to SafeGetIRequestFromContainer but panics of object is not present

func GetManyIRequestFromContainer added in v0.1.178

func GetManyIRequestFromContainer(ctn di.Container) []IRequest

GetManyIRequestFromContainer alternative to SafeGetManyIRequestFromContainer but panics of object is not present

func SafeGetIRequestFromContainer

func SafeGetIRequestFromContainer(ctn di.Container) (IRequest, error)

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

func SafeGetManyIRequestFromContainer added in v0.1.178

func SafeGetManyIRequestFromContainer(ctn di.Container) ([]IRequest, error)

SafeGetManyIRequestFromContainer 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