Documentation ¶
Index ¶
- Variables
- func AddIClaimsPrincipalByObj(builder *di.Builder, obj interface{})
- func AddScopedIClaimsPrincipal(builder *di.Builder, implType reflect.Type)
- func AddScopedIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonIClaimsPrincipal(builder *di.Builder, implType reflect.Type)
- func AddSingletonIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddTransientIClaimsPrincipal(builder *di.Builder, implType reflect.Type)
- func AddTransientIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, ...)
- type Claim
- type IClaimsPrincipal
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeIClaimsPrincipal = di.GetInterfaceReflectType((*IClaimsPrincipal)(nil))
ReflectTypeIClaimsPrincipal used when your service claims to implement IClaimsPrincipal
Functions ¶
func AddIClaimsPrincipalByObj ¶
AddIClaimsPrincipalByObj adds a prebuilt obj
func AddScopedIClaimsPrincipal ¶
AddScopedIClaimsPrincipal adds a type that implements IClaimsPrincipal
func AddScopedIClaimsPrincipalByFunc ¶
func AddScopedIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddScopedIClaimsPrincipalByFunc adds a type by a custom func
func AddSingletonIClaimsPrincipal ¶
AddSingletonIClaimsPrincipal adds a type that implements IClaimsPrincipal
func AddSingletonIClaimsPrincipalByFunc ¶
func AddSingletonIClaimsPrincipalByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddSingletonIClaimsPrincipalByFunc adds a type by a custom func
func AddTransientIClaimsPrincipal ¶
AddTransientIClaimsPrincipal adds a type that implements IClaimsPrincipal
Types ¶
type IClaimsPrincipal ¶
type IClaimsPrincipal interface { GetClaims() []Claim HasClaim(claim Claim) bool AddClaim(claim Claim) RemoveClaim(claim Claim) }
IClaimsPrincipal interface
func GetIClaimsPrincipalFromContainer ¶
func GetIClaimsPrincipalFromContainer(ctn di.Container) IClaimsPrincipal
GetIClaimsPrincipalFromContainer alternative to SafeGetIClaimsPrincipalFromContainer 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