context

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKey = ""

ContextKey Context key value

View Source
var FileStorePath = ""

FileStorePath Path to file store

Functions

func BoolOption

func BoolOption(key string) bool

BoolOption return boolean settings option

func CaptureException added in v0.4.0

func CaptureException(err error, logMessage bool)

CaptureException capture error for sentry

func CaptureExceptionFromGin added in v0.6.3

func CaptureExceptionFromGin(gc *gin.Context, err error, logMessage bool)

CaptureExceptionFromGin capture error from gin for sentry

func CaptureMessage added in v0.4.0

func CaptureMessage(msg string, logMessage bool)

CaptureMessage capture message for sentry

func CreateContext

func CreateContext(value interface{}) gin.HandlerFunc

CreateContext Will add the application context to the context

func CreateLocation added in v0.14.2

func CreateLocation(host, scheme, headersScheme, headersHost string) gin.HandlerFunc

CreateLocation create location handler

func CreateSession

func CreateSession(appname string) gin.HandlerFunc

CreateSession Create new session and return handler.

func DefaultSession

func DefaultSession(gc *gin.Context) sessions.Session

DefaultSession is shortcut to get session

func DurationOption

func DurationOption(key string) time.Duration

DurationOption return time duration option

func FloatOption added in v0.14.0

func FloatOption(key string) float64

FloatOption return float option

func GetAppName added in v1.6.0

func GetAppName() string

GetAppName return application name

func GetAppVersion added in v1.6.0

func GetAppVersion() string

GetAppVersion return application version

func GetBaseURL

func GetBaseURL(gc *gin.Context) string

GetBaseURL return base URL as scheme + host + port

func GetSentryHub added in v0.4.0

func GetSentryHub(gc *gin.Context) *sentry.Hub

GetSentryHub return Sentry hub from gin context

func InitSentry added in v0.4.0

func InitSentry(release string) gin.HandlerFunc

InitSentry initialize Sentry

func IntOption

func IntOption(key string) int

IntOption return int settings option

func IntSliceOption added in v1.8.2

func IntSliceOption(key string) []int

IntSliceOption return int slice option

func RegisterAlias added in v0.10.0

func RegisterAlias(alias, key string)

RegisterAlias Register alias for option key

func SetBoolOption

func SetBoolOption(key string, value bool) error

SetBoolOption set bool option

func SetDefaultOption

func SetDefaultOption(key string, value interface{})

SetDefaultOption Set default value to option

func SetDefaults

func SetDefaults(appName, appVersion string)

SetDefaults Set application defaults

func SetFloatOption added in v0.14.0

func SetFloatOption(key string, value float64) error

SetFloatOption set float option

func SetIntOption

func SetIntOption(key string, value int) error

SetIntOption set int option

func SetIntSliceOption added in v1.8.2

func SetIntSliceOption(key string, value []int) error

SetIntSliceOption set int slice option

func SetStringOption

func SetStringOption(key string, value string) error

SetStringOption set string option

func SetStringSliceOption added in v1.0.0

func SetStringSliceOption(key string, value []string) error

StringSliceOption set string slice option

func SetUintOption

func SetUintOption(key string, value uint) error

SetUintOption set uint option

func SetupConfig

func SetupConfig(appname string)

SetupConfig return application context

func StringOption

func StringOption(key string) string

StringOption return string settings option

func StringSliceOption

func StringSliceOption(key string) []string

StringSliceOption return string slice option

func UintOption added in v0.14.0

func UintOption(key string) uint

UintOption return uint settings option

func WriteConfig

func WriteConfig() error

WriteConfig write config

Types

This section is empty.

Jump to

Keyboard shortcuts

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