ctx

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set added in v1.0.11

func Set(ctx context.Context, value *Ctx) context.Context

Set sets the request context

Types

type Ctx added in v1.0.11

type Ctx struct {
	RequestID            primitive.ObjectID
	Profile              *models.Profile
	Auth                 *auth.Helper
	Key                  *models.APIKey // The key used to make the request
	APIKeyFromParam      *models.APIKey
	Logger               *log.Entry
	DBConn               db.Connection
	MatcherProfilesCache *MatcherProfilesCache
	OnMatchHook          *models.OnMatchHook
}

Ctx contains the request context

func Get added in v1.0.11

func Get(c *fiber.Ctx) *Ctx

Get returns the request context

func (*Ctx) GetOrGenMatcherProfilesCache added in v1.0.19

func (c *Ctx) GetOrGenMatcherProfilesCache() (*MatcherProfilesCache, error)

GetOrGenMatcherProfilesCache returns the cached profiles or creates a new cache content

func (*Ctx) ResetMatcherProfilesCache added in v1.0.11

func (c *Ctx) ResetMatcherProfilesCache()

ResetMatcherProfilesCache sets the profiles cache to an empty object

type MatcherProfilesCache

type MatcherProfilesCache struct {
	InsertionTime time.Time
	ScanProfiles  []*models.Profile
	ListProfiles  []*models.Profile
}

MatcherProfilesCache contains the matcher profiles cache

Jump to

Keyboard shortcuts

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