accessctl

package
v0.0.0-...-3da5846 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Timeformat = time.RFC1123

Functions

func IsInAccessLog

func IsInAccessLog(in *InLog) bool

以下のいずれかを満たす場合はAccessLogとして集計しない

  • 正しいUserAgentか
  • Refererが存在するか
  • 自サイトのRefererではないか(conf.httphostを使用)
  • 自サイトのRefererではないか(RefererとrequestURLのドメインが同一)

Types

type InLog

type InLog struct {
	RemoteHost string `json: "remoteHost"`
	Time       string `json: "time"`
	Method     string `json: "method"`
	Url        string `json: "url"`
	Status     string `json: "status"`
	Referer    string `json: "referer"`
	UserAgent  string `json: "userAgent"`
}

func BytesToInLog

func BytesToInLog(bytes []byte) (inlog *InLog)

type ScoringInLog

type ScoringInLog struct {
	InLogs  []*InLog
	Cleaned bool
}

func NewScoringInLog

func NewScoringInLog() *ScoringInLog

func (*ScoringInLog) Bootstrap

func (sin *ScoringInLog) Bootstrap() (err error)

func (*ScoringInLog) Find

func (sin *ScoringInLog) Find(key string) (inlogs []*InLog, err error)

func (*ScoringInLog) Scoring

func (sin *ScoringInLog) Scoring(url string) (score int, err error)

- IsInAccessLogで非カウント対象を弾いている - UserAgent, RemoteAddr, 1時間で UU(1セッション)とする

type ShowCounter

type ShowCounter struct {
	Cleaned bool
	// contains filtered or unexported fields
}

func NewShowCounter

func NewShowCounter() *ShowCounter

func (*ShowCounter) Bootstrap

func (c *ShowCounter) Bootstrap() (err error)

func (*ShowCounter) Clean

func (c *ShowCounter) Clean(path string)

func (*ShowCounter) Counting

func (c *ShowCounter) Counting(key string) (r []ShowResult, err error)

func (*ShowCounter) Findlist

func (c *ShowCounter) Findlist(path string) (list []string)

type ShowResult

type ShowResult struct {
	ID    int64
	Count int64
}

Jump to

Keyboard shortcuts

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