api

package
v0.0.0-...-379c407 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectionAsc  string = "asc"
	DirectionDesc string = "desc"
)
View Source
const (
	ContributorLoginOrder           = "login"
	ContributorPRCountOrder         = "pr_count"
	ContributorFirstPRMergedAtOrder = "first_pr_merged_at"
)

Variables

This section is empty.

Functions

func ErrorMsgf

func ErrorMsgf(c *gin.Context, code int, err error, format string, a ...interface{})

Types

type ContributorHandler

type ContributorHandler struct {
	BaseURL string
	// contains filtered or unexported fields
}

func (*ContributorHandler) GetContributors

func (h *ContributorHandler) GetContributors(
	projectName string, includeBots bool, order, direction string,
) ([]ContributorItem, error)

func (*ContributorHandler) Init

func (h *ContributorHandler) Init(identifierDB *gorm.DB, projectDBs map[string]*gorm.DB, baseURL string)

type ContributorItem

type ContributorItem struct {
	GitHubID                uint                    `json:"github_id"`
	GitHubLogin             string                  `json:"github_login"`
	FirstPRMergedAt         time.Time               `json:"first_pr_merged_at"`
	ParticipateRepositories []ParticipateRepository `json:"participate_repositories"`
	PRCount                 uint                    `json:"pr_count"`
}

type MemberItem

type MemberItem struct {
	GitHubID         uint                  `json:"github_id"`
	GitHubLogin      string                `json:"github_login"`
	Name             string                `json:"name"`
	ParticipateTeams []ParticipateTeamItem `json:"participate_teams"`
}

type ParticipateRepository

type ParticipateRepository struct {
	RepoID   uint   `json:"repo_id"`
	RepoName string `json:"repo_name"`
	PRCount  uint   `json:"pr_count"`
}

type ParticipateTeamItem

type ParticipateTeamItem struct {
	TeamID         uint      `json:"team_id"`
	TeamName       string    `json:"team_name"`
	Level          string    `json:"level"`
	JoinDate       time.Time `json:"join_date"`
	LastUpdateDate time.Time `json:"last_update_date"`
}

type ProjectDetail

type ProjectDetail struct {
	DisplayName     string             `json:"display_name"`
	Name            string             `json:"name"`
	URL             string             `json:"url"`
	ContributorsURL string             `json:"contributor_url"`
	Stats           ProjectDetailStats `json:"stats,omitempty"`
}

type ProjectDetailStats

type ProjectDetailStats struct {
	PullRequests uint `json:"pull_requests"`
	Issues       uint `json:"issues"`
	Repositories uint `json:"repositories"`
	Contributors uint `json:"contributors"`
}

type ProjectHandler

type ProjectHandler struct {
	BaseURL string
	// contains filtered or unexported fields
}

func (*ProjectHandler) GetProject

func (h *ProjectHandler) GetProject(projectName string) (*ProjectDetail, error)

func (*ProjectHandler) GetProjects

func (h *ProjectHandler) GetProjects() ([]ProjectDetail, error)

func (*ProjectHandler) Init

func (h *ProjectHandler) Init(identifierDB *gorm.DB, projectDBs map[string]*gorm.DB, baseURL string)

type ProjectItem

type ProjectItem struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
}

type TeamDetail

type TeamDetail struct {
	Name         string               `json:"name"`
	Description  string               `json:"description"`
	Maintainers  []TeamMemberItem     `json:"maintainers"`
	Committers   []TeamMemberItem     `json:"committers"`
	Reviewers    []TeamMemberItem     `json:"reviewers"`
	Repositories []TeamRepositoryItem `json:"repositories"`
}

type TeamHandler

type TeamHandler struct {
	BaseURL string
	// contains filtered or unexported fields
}

func (*TeamHandler) GetMembers

func (h *TeamHandler) GetMembers(level string) ([]MemberItem, error)

func (*TeamHandler) GetTeam

func (h *TeamHandler) GetTeam(teamName string) (*TeamDetail, error)

func (*TeamHandler) GetTeams

func (h *TeamHandler) GetTeams() ([]TeamItem, error)

func (*TeamHandler) Init

func (h *TeamHandler) Init(identifierDB *gorm.DB, projectDBs map[string]*gorm.DB, baseURL string)

type TeamItem

type TeamItem struct {
	ID          uint        `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	URL         string      `json:"url"`
	Project     ProjectItem `json:"project"`
}

type TeamMemberItem

type TeamMemberItem struct {
	ID    uint   `json:"id"`
	Login string `json:"login"`
	Name  string `json:"name"`
}

type TeamRepositoryItem

type TeamRepositoryItem struct {
	ID    uint   `json:"id"`
	Owner string `json:"owner"`
	Name  string `json:"name"`
}

Jump to

Keyboard shortcuts

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