Help us shape the future of Go! Take the 2026 Go Developer Survey

archived

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token string `mapstructure:"token" validate:"required" json:"token" encrypt:"yes"`
}

type ApiUserResponse

type ApiUserResponse struct {
	Id   int
	Name string `json:"name"`
}

Using User because it requires authentication.

type BaseConnection

type BaseConnection struct {
	Name string `gorm:"type:varchar(100);uniqueIndex" json:"name" validate:"required"`
	archived.Model
}

type Config

type Config struct {
	PrType               string `mapstructure:"prType" env:"GITEE_PR_TYPE" json:"prType"`
	PrComponent          string `mapstructure:"prComponent" env:"GITEE_PR_COMPONENT" json:"prComponent"`
	PrBodyClosePattern   string `mapstructure:"prBodyClosePattern" json:"prBodyClosePattern"`
	IssueSeverity        string `mapstructure:"issueSeverity" env:"GITEE_ISSUE_SEVERITY" json:"issueSeverity"`
	IssuePriority        string `mapstructure:"issuePriority" env:"GITEE_ISSUE_PRIORITY" json:"issuePriority"`
	IssueComponent       string `mapstructure:"issueComponent" env:"GITEE_ISSUE_COMPONENT" json:"issueComponent"`
	IssueTypeBug         string `mapstructure:"issueTypeBug" env:"GITEE_ISSUE_TYPE_BUG" json:"issueTypeBug"`
	IssueTypeIncident    string `mapstructure:"issueTypeIncident" env:"GITEE_ISSUE_TYPE_INCIDENT" json:"issueTypeIncident"`
	IssueTypeRequirement string `mapstructure:"issueTypeRequirement" env:"GITEE_ISSUE_TYPE_REQUIREMENT" json:"issueTypeRequirement"`
}

type GiteeAccount

type GiteeAccount struct {
	ConnectionId      uint64 `gorm:"primaryKey"`
	Id                int    `json:"id" gorm:"primaryKey;autoIncrement:false"`
	Login             string `json:"login" gorm:"type:varchar(255)"`
	Name              string `json:"name" gorm:"type:varchar(255)"`
	AvatarUrl         string `json:"avatar_url" gorm:"type:varchar(255)"`
	EventsUrl         string `json:"events_url" gorm:"type:varchar(255)"`
	FollowersUrl      string `json:"followers_url" gorm:"type:varchar(255)"`
	FollowingUrl      string `json:"following_url" gorm:"type:varchar(255)"`
	GistsUrl          string `json:"gists_url" gorm:"type:varchar(255)"`
	HtmlUrl           string `json:"html_url" gorm:"type:varchar(255)"`
	OrganizationsUrl  string `json:"organizations_url" gorm:"type:varchar(255)"`
	ReceivedEventsUrl string `json:"received_events_url" gorm:"type:varchar(255)"`
	Remark            string `json:"remark" gorm:"type:varchar(255)"`
	ReposUrl          string `json:"repos_url" gorm:"type:varchar(255)"`
	StarredUrl        string `json:"starred_url" gorm:"type:varchar(255)"`
	SubscriptionsUrl  string `json:"subscriptions_url" gorm:"type:varchar(255)"`
	Url               string `json:"url" gorm:"type:varchar(255)"`
	Type              string `json:"type" gorm:"type:varchar(255)"`
	archived.NoPKModel
}

func (GiteeAccount) TableName

func (GiteeAccount) TableName() string

type GiteeCommit

type GiteeCommit struct {
	Sha            string `gorm:"primaryKey;type:varchar(40)"`
	CommentsUrl    string `gorm:"type:varchar(255)"`
	Message        string
	AuthorId       int
	AuthorName     string `gorm:"type:varchar(255)"`
	AuthorEmail    string `gorm:"type:varchar(255)"`
	AuthoredDate   time.Time
	CommitterId    int
	CommitterName  string `gorm:"type:varchar(255)"`
	CommitterEmail string `gorm:"type:varchar(255)"`
	CommittedDate  time.Time
	WebUrl         string `gorm:"type:varchar(255)"`
	Additions      int    `gorm:"comment:Added lines of code"`
	Deletions      int    `gorm:"comment:Deleted lines of code"`
	Total          int    `gorm:"comment:Sum of added/deleted lines of code"`
	archived.NoPKModel
}

func (GiteeCommit) TableName

func (GiteeCommit) TableName() string

type GiteeCommitStat

type GiteeCommitStat struct {
	ConnectionId  uint64    `gorm:"primaryKey"`
	Sha           string    `gorm:"primaryKey;type:varchar(40)"`
	Additions     int       `gorm:"comment:Added lines of code"`
	Deletions     int       `gorm:"comment:Deleted lines of code"`
	CommittedDate time.Time `gorm:"index"`
	archived.NoPKModel
}

func (GiteeCommitStat) TableName

func (GiteeCommitStat) TableName() string

type GiteeConnection

type GiteeConnection struct {
	RestConnection `mapstructure:",squash"`
	AccessToken    `mapstructure:",squash"`
}

func (GiteeConnection) TableName

func (GiteeConnection) TableName() string

type GiteeIssue

type GiteeIssue struct {
	ConnectionId    uint64 `gorm:"primaryKey"`
	GiteeId         int    `gorm:"primaryKey"`
	RepoId          int    `gorm:"index"`
	Number          string `gorm:"index;comment:Used in API requests ex. api/repo/1/issue/<THIS_NUMBER>"`
	State           string `gorm:"type:varchar(255)"`
	Title           string
	Body            string
	Priority        string `gorm:"type:varchar(255)"`
	Type            string `gorm:"type:varchar(100)"`
	Status          string `gorm:"type:varchar(255)"`
	AuthorId        int
	AuthorName      string `gorm:"type:varchar(255)"`
	AssigneeId      int
	AssigneeName    string `gorm:"type:varchar(255)"`
	LeadTimeMinutes uint
	Url             string `gorm:"type:varchar(255)"`
	ClosedAt        *time.Time
	GiteeCreatedAt  time.Time
	GiteeUpdatedAt  time.Time `gorm:"index"`
	Severity        string    `gorm:"type:varchar(255)"`
	Component       string    `gorm:"type:varchar(255)"`
	archived.NoPKModel
}

func (GiteeIssue) TableName

func (GiteeIssue) TableName() string

type GiteeIssueComment

type GiteeIssueComment struct {
	ConnectionId   uint64 `gorm:"primaryKey"`
	GiteeId        int    `gorm:"primaryKey"`
	IssueId        int    `gorm:"index;comment:References the Issue"`
	Body           string
	AuthorUsername string `gorm:"type:varchar(255)"`
	AuthorUserId   int
	GiteeCreatedAt time.Time
	GiteeUpdatedAt time.Time `gorm:"index"`
	archived.NoPKModel
}

func (GiteeIssueComment) TableName

func (GiteeIssueComment) TableName() string

type GiteeIssueLabel

type GiteeIssueLabel struct {
	ConnectionId uint64 `gorm:"primaryKey"`
	IssueId      int    `gorm:"primaryKey;autoIncrement:false"`
	LabelName    string `gorm:"primaryKey;type:varchar(255)"`
	archived.NoPKModel
}

func (GiteeIssueLabel) TableName

func (GiteeIssueLabel) TableName() string

type GiteePullRequest

type GiteePullRequest struct {
	ConnectionId   uint64 `gorm:"primaryKey"`
	GiteeId        int    `gorm:"primaryKey"`
	RepoId         int    `gorm:"index"`
	Number         int    `gorm:"index"` // This number is used in GET requests to the API associated to reviewers / comments / etc.
	State          string `gorm:"type:varchar(255)"`
	Title          string `gorm:"type:varchar(255)"`
	GiteeCreatedAt time.Time
	GiteeUpdatedAt time.Time `gorm:"index"`
	ClosedAt       *time.Time
	// In order to get the following fields, we need to collect PRs individually from Gitee
	Additions      int
	Deletions      int
	Comments       int
	Commits        int
	ReviewComments int
	Merged         bool
	MergedAt       *time.Time
	Body           string
	Type           string `gorm:"type:varchar(255)"`
	Component      string `gorm:"type:varchar(255)"`
	MergeCommitSha string `gorm:"type:varchar(40)"`
	HeadRef        string `gorm:"type:varchar(255)"`
	BaseRef        string `gorm:"type:varchar(255)"`
	BaseCommitSha  string `gorm:"type:varchar(255)"`
	HeadCommitSha  string `gorm:"type:varchar(255)"`
	Url            string `gorm:"type:varchar(255)"`
	AuthorName     string `gorm:"type:varchar(100)"`
	AuthorId       int
	archived.NoPKModel
}

func (GiteePullRequest) TableName

func (GiteePullRequest) TableName() string

type GiteePullRequestComment

type GiteePullRequestComment struct {
	ConnectionId   uint64 `gorm:"primaryKey"`
	GiteeId        int    `gorm:"primaryKey"`
	PullRequestId  int    `gorm:"index"`
	Body           string
	AuthorUsername string `gorm:"type:varchar(255)"`
	AuthorUserId   int
	GiteeCreatedAt time.Time
	GiteeUpdatedAt time.Time `gorm:"index"`
	archived.NoPKModel
}

func (GiteePullRequestComment) TableName

func (GiteePullRequestComment) TableName() string

type GiteePullRequestCommit

type GiteePullRequestCommit struct {
	ConnectionId  uint64 `gorm:"primaryKey"`
	CommitSha     string `gorm:"primaryKey;type:varchar(40)"`
	PullRequestId int    `gorm:"primaryKey;autoIncrement:false"`
	archived.NoPKModel
}

func (GiteePullRequestCommit) TableName

func (GiteePullRequestCommit) TableName() string

type GiteePullRequestIssue

type GiteePullRequestIssue struct {
	ConnectionId      uint64 `gorm:"primaryKey"`
	PullRequestId     int    `gorm:"primaryKey"`
	IssueId           int    `gorm:"primaryKey"`
	PullRequestNumber int
	IssueNumber       int
	archived.NoPKModel
}

func (GiteePullRequestIssue) TableName

func (GiteePullRequestIssue) TableName() string

type GiteePullRequestLabel

type GiteePullRequestLabel struct {
	ConnectionId uint64 `gorm:"primaryKey"`
	PullId       int    `gorm:"primaryKey;autoIncrement:false"`
	LabelName    string `gorm:"primaryKey;type:varchar(255)"`
	archived.NoPKModel
}

func (GiteePullRequestLabel) TableName

func (GiteePullRequestLabel) TableName() string

type GiteeRepo

type GiteeRepo struct {
	ConnectionId  uint64 `gorm:"primaryKey"`
	GiteeId       int    `gorm:"primaryKey"`
	Name          string `gorm:"type:varchar(255)"`
	HTMLUrl       string `gorm:"type:varchar(255)"`
	Description   string
	OwnerId       int        `json:"ownerId"`
	OwnerLogin    string     `json:"ownerLogin" gorm:"type:varchar(255)"`
	Language      string     `json:"language" gorm:"type:varchar(255)"`
	ParentGiteeId int        `json:"parentId"`
	ParentHTMLUrl string     `json:"parentHtmlUrl"`
	CreatedDate   time.Time  `json:"createdDate"`
	UpdatedDate   *time.Time `json:"updatedDate"`
	archived.NoPKModel
}

func (GiteeRepo) TableName

func (GiteeRepo) TableName() string

type GiteeRepoCommit

type GiteeRepoCommit struct {
	ConnectionId uint64 `gorm:"primaryKey"`
	RepoId       int    `gorm:"primaryKey"`
	CommitSha    string `gorm:"primaryKey;type:varchar(40)"`
	archived.NoPKModel
}

func (GiteeRepoCommit) TableName

func (GiteeRepoCommit) TableName() string

type GiteeReviewer

type GiteeReviewer struct {
	ConnectionId  uint64 `gorm:"primaryKey"`
	GiteeId       int    `gorm:"primaryKey"`
	Login         string `gorm:"type:varchar(255)"`
	PullRequestId int    `gorm:"primaryKey"`

	archived.NoPKModel
}

func (GiteeReviewer) TableName

func (GiteeReviewer) TableName() string

type GitlabResponse

type GitlabResponse struct {
	Name string `json:"name"`
	ID   int    `json:"id"`
	GiteeConnection
}

GitlabResponse is this object conforms to what the frontend currently expects.

type RestConnection

type RestConnection struct {
	BaseConnection   `mapstructure:",squash"`
	Endpoint         string `mapstructure:"endpoint" validate:"required" json:"endpoint"`
	Proxy            string `mapstructure:"proxy" json:"proxy"`
	RateLimitPerHour int    `comment:"api request rate limt per hour" json:"rateLimit"`
}

Jump to

Keyboard shortcuts

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