Documentation ¶
Index ¶
- Variables
- func AddScopedIClaimsPrincipal(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddScopedIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedIClaimsPrincipalByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddScopedIClaimsPrincipalWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddSingletonIClaimsPrincipal(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddSingletonIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIClaimsPrincipalByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIClaimsPrincipalByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
- func AddSingletonIClaimsPrincipalByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, ...)
- func AddSingletonIClaimsPrincipalWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func AddTransientIClaimsPrincipal(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
- func AddTransientIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientIClaimsPrincipalByFuncWithMetadata(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientIClaimsPrincipalWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, ...)
- func GetIClaimsPrincipalDefinition(ctn di.Container) *di.Def
- func GetIClaimsPrincipalDefinitions(ctn di.Container) []*di.Def
- func RemoveAllIClaimsPrincipal(builder *di.Builder)
- type Claim
- type IClaimsPrincipal
- func GetIClaimsPrincipalFromContainer(ctn di.Container) IClaimsPrincipal
- func GetManyIClaimsPrincipalFromContainer(ctn di.Container) []IClaimsPrincipal
- func SafeGetIClaimsPrincipalFromContainer(ctn di.Container) (IClaimsPrincipal, error)
- func SafeGetManyIClaimsPrincipalFromContainer(ctn di.Container) ([]IClaimsPrincipal, error)
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeIClaimsPrincipal = di.GetInterfaceReflectType((*IClaimsPrincipal)(nil))
ReflectTypeIClaimsPrincipal used when your service claims to implement IClaimsPrincipal
Functions ¶
func AddScopedIClaimsPrincipal ¶
func AddScopedIClaimsPrincipal(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddScopedIClaimsPrincipal adds a type that implements IClaimsPrincipal
func AddScopedIClaimsPrincipalByFunc ¶
func AddScopedIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddScopedIClaimsPrincipalByFunc adds a type by a custom func
func AddScopedIClaimsPrincipalByFuncWithMetadata ¶ added in v0.1.217
func AddScopedIClaimsPrincipalByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedIClaimsPrincipalByFuncWithMetadata adds a type by a custom func
func AddScopedIClaimsPrincipalWithMetadata ¶ added in v0.1.217
func AddScopedIClaimsPrincipalWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddScopedIClaimsPrincipalWithMetadata adds a type that implements IClaimsPrincipal
func AddSingletonIClaimsPrincipal ¶
func AddSingletonIClaimsPrincipal(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddSingletonIClaimsPrincipal adds a type that implements IClaimsPrincipal
func AddSingletonIClaimsPrincipalByFunc ¶
func AddSingletonIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddSingletonIClaimsPrincipalByFunc adds a type by a custom func
func AddSingletonIClaimsPrincipalByFuncWithMetadata ¶ added in v0.1.217
func AddSingletonIClaimsPrincipalByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonIClaimsPrincipalByFuncWithMetadata adds a type by a custom func
func AddSingletonIClaimsPrincipalByObj ¶
func AddSingletonIClaimsPrincipalByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)
AddSingletonIClaimsPrincipalByObj adds a prebuilt obj
func AddSingletonIClaimsPrincipalByObjWithMetadata ¶ added in v0.1.217
func AddSingletonIClaimsPrincipalByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonIClaimsPrincipalByObjWithMetadata adds a prebuilt obj
func AddSingletonIClaimsPrincipalWithMetadata ¶ added in v0.1.217
func AddSingletonIClaimsPrincipalWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddSingletonIClaimsPrincipalWithMetadata adds a type that implements IClaimsPrincipal
func AddTransientIClaimsPrincipal ¶
func AddTransientIClaimsPrincipal(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)
AddTransientIClaimsPrincipal adds a type that implements IClaimsPrincipal
func AddTransientIClaimsPrincipalByFunc ¶
func AddTransientIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)
AddTransientIClaimsPrincipalByFunc adds a type by a custom func
func AddTransientIClaimsPrincipalByFuncWithMetadata ¶ added in v0.1.217
func AddTransientIClaimsPrincipalByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientIClaimsPrincipalByFuncWithMetadata adds a type by a custom func
func AddTransientIClaimsPrincipalWithMetadata ¶ added in v0.1.217
func AddTransientIClaimsPrincipalWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)
AddTransientIClaimsPrincipalWithMetadata adds a type that implements IClaimsPrincipal
func GetIClaimsPrincipalDefinition ¶ added in v0.1.217
GetIClaimsPrincipalDefinition returns that last definition registered that this container can provide
func GetIClaimsPrincipalDefinitions ¶ added in v0.1.217
GetIClaimsPrincipalDefinitions returns all definitions that this container can provide
func RemoveAllIClaimsPrincipal ¶ added in v0.1.144
RemoveAllIClaimsPrincipal removes all IClaimsPrincipal from the DI
Types ¶
type Claim ¶
type Claim struct { Type string `json:"type" mapstructure:"TYPE"` Value string `json:"value" mapstructure:"VALUE"` }
Claim type
type IClaimsPrincipal ¶
type IClaimsPrincipal interface { GetClaims() []Claim HasClaim(claim Claim) bool AddClaim(claim Claim) RemoveClaim(claim Claim) GetClaimsByType(claimType string) []Claim HasClaimType(claimType string) bool }
IClaimsPrincipal interface
func GetIClaimsPrincipalFromContainer ¶
func GetIClaimsPrincipalFromContainer(ctn di.Container) IClaimsPrincipal
GetIClaimsPrincipalFromContainer alternative to SafeGetIClaimsPrincipalFromContainer but panics of object is not present
func GetManyIClaimsPrincipalFromContainer ¶ added in v0.1.178
func GetManyIClaimsPrincipalFromContainer(ctn di.Container) []IClaimsPrincipal
GetManyIClaimsPrincipalFromContainer alternative to SafeGetManyIClaimsPrincipalFromContainer but panics of object is not present
func SafeGetIClaimsPrincipalFromContainer ¶
func SafeGetIClaimsPrincipalFromContainer(ctn di.Container) (IClaimsPrincipal, error)
SafeGetIClaimsPrincipalFromContainer trys to get the object by type, will not panic, returns nil and error
func SafeGetManyIClaimsPrincipalFromContainer ¶ added in v0.1.178
func SafeGetManyIClaimsPrincipalFromContainer(ctn di.Container) ([]IClaimsPrincipal, error)
SafeGetManyIClaimsPrincipalFromContainer trys to get the object by type, will not panic, returns nil and error