claimsprincipal

package
v0.1.201 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 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 AddSingletonIClaimsPrincipalByObj

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

AddSingletonIClaimsPrincipalByObj adds a prebuilt obj

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 RemoveAllIClaimsPrincipal added in v0.1.144

func RemoveAllIClaimsPrincipal(builder *di.Builder)

RemoveAllIClaimsPrincipal removes all IClaimsPrincipal from the DI

Types

type Claim

type Claim struct {
	Type  string
	Value string
}

Claim type

type IClaimsPrincipal

type IClaimsPrincipal interface {
	GetClaims() []Claim
	HasClaim(claim Claim) bool
	AddClaim(claim Claim)
	RemoveClaim(claim Claim)
	GetClaimsByType(claimType string) []Claim
}

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

Jump to

Keyboard shortcuts

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