model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package model is domain model and business logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	// Author is author user
	Author *User
	// Committer is commiter user
	Committer *User
	// Date is commit date
	Date *Timestamp
}

Commit is git commit information

type PullRequest

type PullRequest struct {
	// ID is PR's id.
	ID *int64
	// Number is PR number
	Number *int
	// State is PR state(e.g. closed)
	State *string
	// Title is PR title
	Title *string
	// CreatedAt is date of PR creation
	CreatedAt *Timestamp
	// ClosedAt is date of PR close
	ClosedAt *Timestamp
	// MergedAt is date of PR merged
	MergedAt *Timestamp
	// User is user information
	User *User
	// Comments is PR comment count
	Comments *int
	// Additions is number of addition lines
	Additions *int
	// Deletions is number of deletions line
	Deletions *int
	// ChangedFiles is number of changed files
	ChangedFiles *int
}

PullRequest represents a GitHub pull request on a repository.

func (*PullRequest) IsClosed

func (pr *PullRequest) IsClosed() bool

IsClosed check whether pull request is closed or not.

type Repository

type Repository struct {
	// ID is repository id
	ID *int64 `json:"id,omitempty"`
	// Owner is repository owner
	Owner *User `json:"owner,omitempty"`
	// Name is repository name
	Name *string `json:"name,omitempty"`
	// FullName is repository full name
	FullName *string `json:"full_name,omitempty"`
	// Description is repository description
	Description *string `json:"description,omitempty"`
}

Repository represents GitHub repository information

type Timestamp

type Timestamp struct {
	Time time.Time
}

Timestamp represents a time.

type Token

type Token string

Token is token (e.g. github access token)

func (Token) String

func (t Token) String() string

type User

type User struct {
	// Name is user name.
	Name *string `json:"name,omitempty"`
	// Bot is whether user is bot or not
	Bot bool
}

User represents a GitHub user.

func (*User) IsBot added in v0.0.3

func (u *User) IsBot() bool

Jump to

Keyboard shortcuts

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