model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contributor

type Contributor struct {
	gorm.Model

	Login  string
	NodeID string

	Company   string
	Location  string
	AvatarURL string

	RepoNodeID    string
	Contributions int
}

Contributor use github rest api Contributor one to many Issue (Author) Contributor one to many PullRequest (Author) Contributor many to many Issue (Assignees) Contributor many to many PullRequest (Assignees)

type Cursor

type Cursor struct {
	gorm.Model
	RepoNodeID        string
	RepoNameWithOwner string
	// used by issue
	LastUpdate time.Time
	// used by pr
	EndCursor string
}

type Group

type Group struct {
	gorm.Model

	Name string

	IssueCount       int
	PullRequestCount int
	StarCount        int
	ForkCount        int
	ContributorCount int
}

type GroupsOrganizations

type GroupsOrganizations struct {
	GroupName string
	OrgNodeID string
}

type GroupsRepositories

type GroupsRepositories struct {
	GroupName  string
	RepoNodeID string
}

type Issue

type Issue struct {
	gorm.Model

	NodeID string

	Author       string
	AuthorNodeID string
	RepoNodeID   string
	Number       int

	// OPEN | CLOSED
	State string

	IssueCreatedAt time.Time
	IssueClosedAt  *time.Time
}

Issue many to many Contributor

type IssueAssignees

type IssueAssignees struct {
	gorm.Model

	IssueNodeID string
	IssueNumber int
	IssueURL    string
	// repo name with owner
	IssueRepoName string

	AssigneeNodeID string
	AssigneeLogin  string
}

IssueAssignees an issue can have multi assignees a user can be assigned to multi issues

type Organization

type Organization struct {
	gorm.Model

	Login  string
	NodeID string

	IssueCount       int
	PullRequestCount int
	StarCount        int
	ForkCount        int
	ContributorCount int
}

Organization one to many Repository

type PullRequest

type PullRequest struct {
	gorm.Model

	NodeID string

	Author       string
	AuthorNodeID string
	RepoNodeID   string
	Number       int

	// CLOSED | MERGED | OPEN
	State string

	PRCreatedAt time.Time
	PRMergedAt  *time.Time
	PRClosedAt  *time.Time
}

PullRequest many to many Contributor

type PullRequestAssignees

type PullRequestAssignees struct {
	gorm.Model

	PullRequestNodeID string
	PullRequestNumber int
	PullRequestURL    string
	// repo name with owner
	PullRequestRepoName string

	AssigneeNodeID string
	AssigneeLogin  string
}

PullRequestAssignees a pr can have multi reviewers a user can be assigned to multi pull requests

type Repository

type Repository struct {
	gorm.Model

	Owner  string // might be a user or org
	Name   string
	NodeID string

	OwnerNodeID string

	IssueCount       int
	PullRequestCount int
	StarCount        int
	ForkCount        int
	ContributorCount int
}

Repository one to many Contributor

Jump to

Keyboard shortcuts

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