cookies

package
v0.1.318 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeISecureCookie = di.GetInterfaceReflectType((*ISecureCookie)(nil))

ReflectTypeISecureCookie used when your service claims to implement ISecureCookie

View Source
var ReflectTypeSecureCookieConfigAccessor = reflect.TypeOf(SecureCookieConfigAccessor(nil))

ReflectTypeSecureCookieConfigAccessor used when your service claims to implement SecureCookieConfigAccessor

Functions

func AddScopedISecureCookie

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

AddScopedISecureCookie adds a type that implements ISecureCookie

func AddScopedISecureCookieByFunc

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

AddScopedISecureCookieByFunc adds a type by a custom func

func AddScopedISecureCookieByFuncWithMetadata

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

AddScopedISecureCookieByFuncWithMetadata adds a type by a custom func

func AddScopedISecureCookieWithMetadata

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

AddScopedISecureCookieWithMetadata adds a type that implements ISecureCookie

func AddSecureCookieConfigAccessorFunc

func AddSecureCookieConfigAccessorFunc(builder *di.Builder, fnc SecureCookieConfigAccessor)

AddSingletonSecureCookieConfigAccessorFunc adds a func to the DI

func AddSingletonISecureCookie

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

AddSingletonISecureCookie adds a type that implements ISecureCookie

func AddSingletonISecureCookieByFunc

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

AddSingletonISecureCookieByFunc adds a type by a custom func

func AddSingletonISecureCookieByFuncWithMetadata

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

AddSingletonISecureCookieByFuncWithMetadata adds a type by a custom func

func AddSingletonISecureCookieByObj

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

AddSingletonISecureCookieByObj adds a prebuilt obj

func AddSingletonISecureCookieByObjWithMetadata

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

AddSingletonISecureCookieByObjWithMetadata adds a prebuilt obj

func AddSingletonISecureCookieWithMetadata

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

AddSingletonISecureCookieWithMetadata adds a type that implements ISecureCookie

func AddTransientISecureCookie

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

AddTransientISecureCookie adds a type that implements ISecureCookie

func AddTransientISecureCookieByFunc

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

AddTransientISecureCookieByFunc adds a type by a custom func

func AddTransientISecureCookieByFuncWithMetadata

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

AddTransientISecureCookieByFuncWithMetadata adds a type by a custom func

func AddTransientISecureCookieWithMetadata

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

AddTransientISecureCookieWithMetadata adds a type that implements ISecureCookie

func GetISecureCookieDefinition

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

GetISecureCookieDefinition returns that last definition registered that this container can provide

func GetISecureCookieDefinitions

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

GetISecureCookieDefinitions returns all definitions that this container can provide

func RemoveAllISecureCookie

func RemoveAllISecureCookie(builder *di.Builder)

RemoveAllISecureCookie removes all ISecureCookie from the DI

func RemoveAllSecureCookieConfigAccessorFunc

func RemoveAllSecureCookieConfigAccessorFunc(builder *di.Builder)

RemoveAllSecureCookieConfigAccessorFunc removes all SecureCookieConfigAccessor functions from the DI

Types

type ISecureCookie

type ISecureCookie interface {
	SetCookieValue(name string, value string, expires time.Time) error
	GetCookieValue(name string) (string, error)
	DeleteCookie(name string) error
	RefreshCookie(name string, durration time.Duration) error
}

ISecureCookie ...

func GetISecureCookieFromContainer

func GetISecureCookieFromContainer(ctn di.Container) ISecureCookie

GetISecureCookieFromContainer alternative to SafeGetISecureCookieFromContainer but panics of object is not present

func GetManyISecureCookieFromContainer

func GetManyISecureCookieFromContainer(ctn di.Container) []ISecureCookie

GetManyISecureCookieFromContainer alternative to SafeGetManyISecureCookieFromContainer but panics of object is not present

func SafeGetISecureCookieFromContainer

func SafeGetISecureCookieFromContainer(ctn di.Container) (ISecureCookie, error)

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

func SafeGetManyISecureCookieFromContainer

func SafeGetManyISecureCookieFromContainer(ctn di.Container) ([]ISecureCookie, error)

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

type SecureCookieConfig

type SecureCookieConfig struct {
	SecureCookieHashKey       string
	SecureCookieEncryptionKey string
}

SecureCookieConfig ...

type SecureCookieConfigAccessor

type SecureCookieConfigAccessor func() *SecureCookieConfig

SecureCookieConfigAccessor func in the DI

func GetManySecureCookieConfigAccessorFromContainer

func GetManySecureCookieConfigAccessorFromContainer(ctn di.Container) []SecureCookieConfigAccessor

GetManySecureCookieConfigAccessorFromContainer alternative to SafeGetManySecureCookieConfigAccessorFromContainer but panics of object is not present

func GetSecureCookieConfigAccessorFromContainer

func GetSecureCookieConfigAccessorFromContainer(ctn di.Container) SecureCookieConfigAccessor

GetSecureCookieConfigAccessorFromContainer alternative to SafeGetSecureCookieConfigAccessorFromContainer but panics of object is not present

func SafeGetManySecureCookieConfigAccessorFromContainer

func SafeGetManySecureCookieConfigAccessorFromContainer(ctn di.Container) ([]SecureCookieConfigAccessor, error)

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

func SafeGetSecureCookieConfigAccessorFromContainer

func SafeGetSecureCookieConfigAccessorFromContainer(ctn di.Container) (SecureCookieConfigAccessor, error)

SafeGetSecureCookieConfigAccessorFromContainer 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