Documentation ¶
Index ¶
- Variables
- type Binlog
- type Hit
- type Service
- func (s *Service) AddSite(host string) error
- func (s *Service) HandleHit(w http.ResponseWriter, req *http.Request) error
- func (s *Service) Hit(host string, uri string, referer, ip string, userAgent string, ssid string, ...) error
- func (s *Service) Save(h *Hit)
- func (s *Service) Stat(host string) (*Stat, error)
- type Site
- type Stat
- type Store
- func (s *Store) ArchiveBinlog() error
- func (s *Store) ArchiveBinlogIfNeeded() error
- func (s *Store) ArchiveBinlogIfNeededEvery(d time.Duration)
- func (s *Store) Binlog() *Binlog
- func (s *Store) CreateBucket(bucket string) error
- func (s *Store) Flush(siteId int64) error
- func (s *Store) Get(bucket string, key string) (id int64, e error)
- func (s *Store) GetBytes(bucket string, key []byte) (id int64, e error)
- func (s *Store) GetOrInsert(bucket string, key string) (id int64, e error)
- func (s *Store) GetOrInsertBytes(bucket string, key []byte) (id int64, e error)
- func (s *Store) Has(bucket string, key string) (has bool, e error)
- func (s *Store) HasBucket(bucket string) (has bool, e error)
- func (s *Store) HasBytes(bucket string, key []byte) (has bool, e error)
- func (s *Store) HasSite(host string) (bool, error)
- func (s *Store) HitCount(siteId int64) (cnt int64, e error)
- func (s *Store) IncHit(siteId int64) (int64, error)
- func (s *Store) InsertAutoInc(bucket string, key string) (int64, error)
- func (s *Store) InsertAutoIncBytes(bucket string, key []byte) (int64, error)
- func (s *Store) LastFlush(siteId int64) (time.Time, error)
- func (s *Store) NeedFlush(siteId int64) (bool, error)
- func (s *Store) Rank(siteId int64) (rank int64, e error)
- func (s *Store) RefererId(ref string) (siteId int64, uriId int64, e error)
- func (s *Store) SessionId(ssid string) (int64, error)
- func (s *Store) SetFlush(siteId int64) error
- func (s *Store) SiteId(host string) (id int64, e error)
- func (s *Store) TodayUnique(siteId int64, uid int64) (cnt int64, e error)
- func (s *Store) TodayUniqueCount(siteId int64) (cnt int64, e error)
- func (s *Store) UriId(uri string) (int64, error)
- func (s *Store) UserAgentId(uri string) (int64, error)
- func (s *Store) UserId(uid string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UidCookieName = "u" SsidCookieName = "s" )
View Source
var ( ErrUnknownSite = fmt.Errorf("unknown site") UidCookieMaxAge = 60 * 60 * 24 * 366 * 5 )
View Source
var ( SITE_BUCKET = "sites" URI_BUCKET = "uri" USER_AGENT_BUCKET = "ua" USER_ID_BUCKET = "uuids" SESSION_ID_BUCKET = "session" HITS_LEDIS_KEY = "hits" BINLOGS_DIR = "binlogs" HyperlogPrecision uint8 = 7 )
View Source
var (
DefaultBlockLen = 36
)
Functions ¶
This section is empty.
Types ¶
type Binlog ¶
type Binlog struct {
// contains filtered or unexported fields
}
func NewWriteBinLog ¶
func (*Binlog) SetBlockLen ¶
type Hit ¶
type Store ¶
type Store struct { DbPath string // contains filtered or unexported fields }
func (*Store) ArchiveBinlog ¶
func (*Store) ArchiveBinlogIfNeeded ¶
func (*Store) ArchiveBinlogIfNeededEvery ¶
func (*Store) CreateBucket ¶
func (*Store) GetOrInsert ¶
func (*Store) GetOrInsertBytes ¶
func (*Store) InsertAutoInc ¶
func (*Store) InsertAutoIncBytes ¶
func (*Store) TodayUnique ¶
func (*Store) TodayUniqueCount ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.