Documentation ¶
Index ¶
Constants ¶
View Source
const HourFormat = "2006-01-02-15"
Variables ¶
This section is empty.
Functions ¶
func DownloadArchive ¶
func DownloadArchive(t time.Time) (io.ReadCloser, error)
func IsRateLimit ¶
Types ¶
type CreateEvent ¶
type CreateEvent struct {
RefType string `json:"ref_type"`
}
type ForkEvent ¶
type ForkEvent struct { Forkee struct { FullName string `json:"full_name"` } `json:"forkee"` }
type Repo ¶
func (Repo) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type StarTracker ¶
type StarTracker struct {
// contains filtered or unexported fields
}
StarTracker keeps track of how many stars a repository has. It is backed by a db on disk, goes to GitHub for never-seen-before, and it assumes it will be told about every WatchEvent ever since so that it can keep the number accurate without ever going to the network again.
A StarTracker is not safe to use by multiple goroutines at the same time, and it assumes WatchEvents and Gets are submited sequentially anyway. However, it is fully idempotent.
func NewStarTracker ¶
func NewStarTracker(db *bolt.DB, gitHubToken string) *StarTracker
func (*StarTracker) CreateEvent ¶
func (s *StarTracker) CreateEvent(name, parent string, created time.Time) error
func (*StarTracker) Expvar ¶
func (s *StarTracker) Expvar() *expvar.Map
func (*StarTracker) Get ¶
func (s *StarTracker) Get(name string) (stars int, parent string, err error)
func (*StarTracker) WatchEvent ¶
func (s *StarTracker) WatchEvent(name string, created time.Time) error
type TimelineArchiveReader ¶
type TimelineArchiveReader struct {
// contains filtered or unexported fields
}
TimelineArchiveReader reads a .json.gz like those offered by githubarchive.org
func NewTimelineArchiveReader ¶
func NewTimelineArchiveReader(r io.Reader) (*TimelineArchiveReader, error)
func (*TimelineArchiveReader) Close ¶
func (t *TimelineArchiveReader) Close() error
func (*TimelineArchiveReader) Read ¶
func (t *TimelineArchiveReader) Read(e *Event) error
Click to show internal directories.
Click to hide internal directories.