mod_userid

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package mod_userid generate user identity to trace one user in different request this mod will auto set user id for request if user id not exited in cookie to cookie

Index

Constants

View Source
const (
	ModName   = "mod_userid"
	UidCtxKey = "mod_userid.uid_cookie"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfModUserID

type ConfModUserID struct {
	Basic struct {
		DataPath string // path of config data
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

func ConfLoad(filePath, confRoot string) (*ConfModUserID, error)

type Config

type Config struct {
	Version  string
	Products map[string][]ProductRule
}

Config config

func NewConfigFromFile

func NewConfigFromFile(fileName string) (*Config, error)

NewConfigFromFile new one config

func (*Config) FindProductRules

func (c *Config) FindProductRules(productName string) []ProductRule

FindProductRules find by name。no locker because of nobody will write it

type ConfigData

type ConfigData struct {
	Version string
	Config  map[string][]ProductRuleData
}

ConfigData the config for this module

type ModuleUserID

type ModuleUserID struct {
	// contains filtered or unexported fields
}

func NewModuleUserID

func NewModuleUserID() *ModuleUserID

func (*ModuleUserID) Init

func (*ModuleUserID) Name

func (m *ModuleUserID) Name() string

type ProductRule

type ProductRule struct {
	Params ProductRuleParams
	Cond   condition.Condition
}

ProductRule productRule

type ProductRuleData

type ProductRuleData struct {
	Cond   string
	Params *struct {
		Name   string
		Domain string
		Path   string
		MaxAge int
	}
}

ProductRuleData config for one product line

type ProductRuleParams

type ProductRuleParams struct {
	Name   string
	Domain string
	Path   string
	MaxAge time.Duration
}

ProductRuleParams config params

Jump to

Keyboard shortcuts

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