model

package
v0.0.0-...-796c538 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ISSUE_COMMENT_WEIGHT is a default weight of Issue Comment relation.
	ISSUE_COMMENT_WEIGHT = 10
)
View Source
const (
	// PULL_REQUEST_COMMENT_WEIGHT is a default weight of Pull Request Comment.
	PULL_REQUEST_COMMENT_WEIGHT = 16
)
View Source
const (
	// REVIEW_WEIGHT is a default weight of Reviewer relation.
	REVIEW_WEIGHT = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IssueComment

type IssueComment struct {
	RequesterID    int64
	PullRequestID  int64
	IssuerID       int64
	IssuerUserName string
	Weight         int64
}

IssueComment represents PullRequest/Issue comment author relation with PullRequest/Issue author.

func CreateIssueComment

func CreateIssueComment(prr *github.IssueComment, pullRequestID, requesterID, weight int64) IssueComment

CreateIssueComment will return IssueComment model object

func (IssueComment) ID

func (ic IssueComment) ID() int64

ID returns IssueComment IssuerID

func (IssueComment) Neo

func (ic IssueComment) Neo() neo.Query

Neo returns IssueComment neo.Query relation with RequesterID

type PullRequestComment

type PullRequestComment struct {
	RequesterID       int64
	PullRequestID     int64
	CommenterID       int64
	CommenterUserName string
	Weight            int64
}

PullRequestComment represents PullRequest comment author relation with PullRequest author - pull request comment is a different entity than issue comment. Issue comment is for both PRs and Issues, PR Comment is for PR code snippet comments.

func CreatePullRequestComment

func CreatePullRequestComment(prc *github.PullRequestComment, pullRequestID, requesterID, weight int64) PullRequestComment

CreatePullRequestComment will return PullRequestComment model object

func (PullRequestComment) ID

func (prc PullRequestComment) ID() int64

ID returns IssueComment CommenterID

func (PullRequestComment) Neo

func (prc PullRequestComment) Neo() neo.Query

Neo returns PullRequestComment neo.Query relation with RequesterID

type Repository

type Repository struct {
	RepoID  int64
	Name    string
	OwnerID int64
	Owner   string
}

Repository represents repository as a graph node.

func CreateRepository

func CreateRepository(ghRepository *github.Repository) Repository

CreateRepository will create model Repository object from GitHub API Repository.

func (Repository) ID

func (r Repository) ID() int64

ID will return Repository.RepoID

func (Repository) Neo

func (r Repository) Neo() neo.Query

Neo is an implementation of neo.Resource interface. It will return Repository as neo4j query string. There will be created Repository and owner user nodes. Repository will be connected with owner node with relation OWNER.

func (Repository) String

func (r Repository) String() string

type Requester

type Requester struct {
	PullRequestID int64
	RequesterID   int64
	UserName      string
}

Requester represents Pull Request Author node entity.

func CreateRequester

func CreateRequester(pr *github.PullRequest) Requester

CreateRequester will return Requester model object

func (Requester) ID

func (r Requester) ID() int64

ID returns Requester IssuerID

func (Requester) Neo

func (r Requester) Neo() neo.Query

Neo returns Requester neo.Query node representation

type Reviewer

type Reviewer struct {
	RequesterID      int64
	PullRequestID    int64
	ReviewerID       int64
	ReviewerUserName string
	Weight           int64
}

Reviewer represents Review author relation with PullRequest/Issue author.

func CreateReviewer

func CreateReviewer(prr *github.PullRequestReview, pullRequestID, requesterID, weight int64) Reviewer

CreateReviewer will return Reviewer model object

func (Reviewer) ID

func (r Reviewer) ID() int64

ID returns Reviewer ReviewerID

func (Reviewer) Neo

func (r Reviewer) Neo() neo.Query

Neo returns Reviewer neo.Query relation with RequesterID

Jump to

Keyboard shortcuts

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