models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubUser

type GitHubUser struct {
	gorm.Model
	Login             string `gorm:"uniqueIndex;not null"`
	ID                int64  `gorm:"uniqueIndex;not null"`
	NodeID            string `gorm:"not null"`
	AvatarURL         string
	GravatarID        string
	URL               string
	HTMLURL           string
	FollowersURL      string
	FollowingURL      string
	GistsURL          string
	StarredURL        string
	SubscriptionsURL  string
	OrganizationsURL  string
	ReposURL          string
	EventsURL         string
	ReceivedEventsURL string
	Type              string
	SiteAdmin         bool
	Name              string
	Company           string
	Blog              string
	Location          string
	Email             string
	Hireable          bool
	Bio               string
	TwitterUsername   string
	PublicRepos       int
	PublicGists       int
	Followers         int
	Following         int
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

GitHubUser represents a GitHub user based on the GitHub API

type PullRequest

type PullRequest struct {
	gorm.Model
	URL    string
	Number int
}

PullRequest represents a pull request associated with a workflow run

type Repository

type Repository struct {
	gorm.Model
	Name        string `gorm:"index;not null"`
	FullName    string `gorm:"uniqueIndex;not null"`
	Description string
	Private     bool
	Fork        bool
	CreatedAt   time.Time
	UpdatedAt   time.Time
	PushedAt    time.Time
	Size        int
	StarCount   int
	Language    string
	HasIssues   bool
	HasProjects bool
	HasWiki     bool
	OwnerID     uint
	Owner       GitHubUser `gorm:"foreignKey:OwnerID"`
}

Repository represents a GitHub repository

type Statistics

type Statistics struct {
	ID          uint `gorm:"primaryKey"`
	TotalRuns   int64
	SuccessRate float64
	// Add fields for additional statistics
	UpdatedAt time.Time
}

type Workflow

type Workflow struct {
	gorm.Model
	Name         string    `gorm:"type:varchar(255);not null"`
	Path         string    `gorm:"type:varchar(255);not null"`
	State        string    `gorm:"type:varchar(50)"`
	CreatedAt    time.Time `gorm:"not null"`
	UpdatedAt    time.Time `gorm:"not null"`
	URL          string    `gorm:"type:varchar(255)"`
	HTMLURL      string    `gorm:"column:html_url;type:varchar(255)"`
	BadgeURL     string    `gorm:"column:badge_url;type:varchar(255)"`
	RepositoryID uint      `gorm:"not null"`
}

Workflow represents a GitHub workflow

func (Workflow) TableName

func (Workflow) TableName() string

TableName specifies the table name for the Workflow model

type WorkflowRun

type WorkflowRun struct {
	gorm.Model
	WorkflowID       int64 `gorm:"index"`
	Name             string
	HeadBranch       string
	HeadSHA          string
	Status           string
	Conclusion       string
	EventType        string
	URL              string
	HTMLURL          string
	JobsURL          string
	LogsURL          string
	CheckSuiteURL    string
	ArtifactsURL     string
	CancelURL        string
	RerunURL         string
	WorkflowURL      string
	RunNumber        int
	RunAttempt       int
	CreatedAt        time.Time
	UpdatedAt        time.Time
	RunStartedAt     *time.Time
	JobsCount        int
	PullRequests     []PullRequest `gorm:"many2many:workflow_run_pull_requests;"`
	RepositoryID     int64         `gorm:"index"`
	HeadRepository   Repository    `gorm:"foreignKey:HeadRepositoryID"`
	HeadRepositoryID int64
}

WorkflowRun represents a workflow run from GitHub API

Jump to

Keyboard shortcuts

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