models

package
v0.0.0-...-a8d482f Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcTotalHeartbeatsDuration

func CalcTotalHeartbeatsDuration(user User, heartbeats []Heartbeat) int64

func SaveHeartbeatIfNotExist

func SaveHeartbeatIfNotExist(heartbeat Heartbeat) bool

Types

type GitIntegration

type GitIntegration struct {
	Id      int64
	Name    string
	IsOauth bool
}

type Heartbeat

type Heartbeat struct {
	Id          int64 // Database ID
	UserId      int64
	Project     string // Associated project on Wakatime (git project)
	Branch      string // Git branch
	Entity      string
	Wid         string // Wakatime heartbeat ID
	IsDebugging bool   // If the heartbeat was sent during a debug
	IsWrite     bool   // If the heartbeat was sent during a write
	Language    string // Language of the file being edited during the heartbeat
	Type        string
	Time        time.Time // Time of the heartbeat
}

func NewHeartbeatFromWakaTime

func NewHeartbeatFromWakaTime(heartbeat wakatime.Heartbeat) Heartbeat

func (Heartbeat) HumanTime

func (h Heartbeat) HumanTime() string

type PmIntegration

type PmIntegration struct {
	Id int64
	// contains filtered or unexported fields
}

type Project

type Project struct {
	Id                  int64
	UserId              int64
	Name                string `form:"name"`
	GitIntegrationName  string `form:"gitIntegrationName"`
	GitRepoName         string `form:"gitRepoName"`
	PmIntegrationName   string `form:"pmIntegrationName"`
	NumRecievedWebhooks int
	CreatedAt           time.Time
}

func (Project) TotalHours

func (p Project) TotalHours() float64

type TimeTracked

type TimeTracked struct {
	Id        int64
	UserId    int64
	ProjectId int64
	CommitSHA string
	Duration  int64
	CreatedAt time.Time
}

type User

type User struct {
	Id                int64  `form:"id"`
	Name              string `form:"name"`
	Email             string `form:"email"`
	Password          string `form:"password"`
	WakaTimeApiKey    string `form:"wakaTimeApiKey"`
	IsSyncingWakaTime bool
	LastWakaTimeSync  time.Time
	CreatedAt         time.Time

	// Associated Models
	Projects []Project
}

func (*User) AfterFind

func (u *User) AfterFind(db *gorm.DB) error

func (User) Heartbeats

func (u User) Heartbeats() []Heartbeat

func (User) NumHeartbeatsChartData

func (u User) NumHeartbeatsChartData() string

func (User) NumReceivedPushes

func (u User) NumReceivedPushes() int

func (User) PullNewestHeartbeats

func (u User) PullNewestHeartbeats()

func (User) TimeTrackedChartData

func (u User) TimeTrackedChartData() string

func (User) TopThreeLanguages

func (u User) TopThreeLanguages() [][]string

func (User) TotalMonthTimeTacked

func (u User) TotalMonthTimeTacked() string

func (User) TotalYearTimeTacked

func (u User) TotalYearTimeTacked() string

func (User) Verify

func (u User) Verify() []error

type WebhookEvent

type WebhookEvent struct {
	Id        int64
	ProjectId int64
	UserId    int64
	Payload   string `sql:"type:text"`
	CreatedAt time.Time
}

Jump to

Keyboard shortcuts

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