Documentation ¶
Index ¶
- Constants
- func AddPlugin(priority uint64, funcs Funcs)
- func LoadRemapStats(stats stat.Stats, httpConns *web.ConnMap, httpsConns *web.ConnMap) map[string]interface{}
- func LoadSystemStats(stats stat.Stats, interfaceName string) stat.StatsSystemJSON
- type AfterRespondData
- type AfterRespondFunc
- type BeforeCacheLookUpData
- type BeforeCacheLookupFunc
- type BeforeParentRequestData
- type BeforeParentRequestFunc
- type BeforeRespondData
- type BeforeRespondFunc
- type Funcs
- type LoadFunc
- type OnRequestData
- type OnRequestFunc
- type Plugins
- type StartupData
- type StartupFunc
Constants ¶
View Source
const CacheStatsEndpoint = "/_cacheinspect"
CacheStatsEndpoint is our reserved path
View Source
const CallGCEndpoint = "/_callgc"
View Source
const MAXINT64 = 1<<63 - 1
View Source
const MemStatsEndpoint = "/_memstats"
View Source
const NSPerSec = 1000000000
View Source
const StatsEndpoint = "/_astats"
Variables ¶
This section is empty.
Functions ¶
func LoadRemapStats ¶
func LoadSystemStats ¶
func LoadSystemStats(stats stat.Stats, interfaceName string) stat.StatsSystemJSON
Types ¶
type AfterRespondData ¶
type AfterRespondFunc ¶
type AfterRespondFunc func(icfg interface{}, d AfterRespondData)
type BeforeCacheLookUpData ¶
type BeforeCacheLookupFunc ¶
type BeforeCacheLookupFunc func(icfg interface{}, d BeforeCacheLookUpData)
type BeforeParentRequestData ¶
type BeforeParentRequestFunc ¶
type BeforeParentRequestFunc func(icfg interface{}, d BeforeParentRequestData)
type BeforeRespondData ¶
type BeforeRespondData struct { Req *http.Request // CacheObj is the object to be cached, containing information about the origin request. The code, headers, and body should not be considered authoritative. Look at Code, Hdr, and Body instead, as the actual values about to be sent. Note CacheObj may be nil, if an error occurred (e.g. the Origin failed to respond). CacheObj *cacheobj.CacheObj Code *int Hdr *http.Header Body *[]byte RemapRule string Context *interface{} }
BeforeRespondData holds the data passed to plugins. The objects pointed to MAY NOT be modified, however, the location pointed to may be changed for the Code, Hdr, and Body. That iss, `*d.Hdr = myHdr` is ok, but `d.Hdr.Add("a", "b") is not. If that's confusing, recall `http.Header` is a map, therefore Hdr and Body are both pointers-to-pointers.
type BeforeRespondFunc ¶
type BeforeRespondFunc func(icfg interface{}, d BeforeRespondData)
type LoadFunc ¶
type LoadFunc func(json.RawMessage) interface{}
type OnRequestData ¶
type OnRequestFunc ¶
type OnRequestFunc func(icfg interface{}, d OnRequestData) bool
type Plugins ¶
type Plugins interface { LoadFuncs() map[string]LoadFunc OnStartup(cfgs map[string]interface{}, context map[string]*interface{}, d StartupData) OnRequest(cfgs map[string]interface{}, context map[string]*interface{}, d OnRequestData) bool OnBeforeCacheLookup(cfgs map[string]interface{}, context map[string]*interface{}, d BeforeCacheLookUpData) OnBeforeParentRequest(cfgs map[string]interface{}, context map[string]*interface{}, d BeforeParentRequestData) OnBeforeRespond(cfgs map[string]interface{}, context map[string]*interface{}, d BeforeRespondData) OnAfterRespond(cfgs map[string]interface{}, context map[string]*interface{}, d AfterRespondData) }
type StartupData ¶
type StartupFunc ¶
type StartupFunc func(icfg interface{}, d StartupData)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.