object

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProgramName = ""
View Source
var Url = ""

Functions

func AddIssue

func AddIssue(issueWebhook *Issue) bool

func AddMachine

func AddMachine(machine *Machine) bool

func AddMachines

func AddMachines(machines []*Machine) bool

func AddProgram

func AddProgram(program *Program) bool

func AddReport

func AddReport(report *Report) bool

func AddRound

func AddRound(round *Round) bool

func AddStudent

func AddStudent(student *Student) bool

func AutoUpdateReportText

func AutoUpdateReportText(id string, author string, startDate time.Time, endDate time.Time, student Student) string

func DeleteIssue

func DeleteIssue(issueWebhook *Issue) bool

func DeleteMachine

func DeleteMachine(machine *Machine) bool

func DeleteProgram

func DeleteProgram(program *Program) bool

func DeleteReport

func DeleteReport(report *Report) bool

func DeleteRound

func DeleteRound(round *Round) bool

func DeleteStudent

func DeleteStudent(student *Student) bool

func GetPRState

func GetPRState(org string, repo string, pullNumber int) string

func GetReportTextByEvents

func GetReportTextByEvents(events []*Event) string

func GetStudentGithubMap

func GetStudentGithubMap(students []*Student, users []*casdoorsdk.User) map[string]string

func GetWebhookOrgs

func GetWebhookOrgs() []string

func InitAdapter

func InitAdapter()

func InitConfig

func InitConfig()

func ReDeliverOrgWebhook

func ReDeliverOrgWebhook(orgWebhook OrgWebhook)

func RedeliverAllOrgWebhook

func RedeliverAllOrgWebhook()

func RegularRedeliver

func RegularRedeliver()

func RegularUpdate

func RegularUpdate()

func TimingAutoUpdate

func TimingAutoUpdate()

func UpdateIssue

func UpdateIssue(name string, issueWebhook *Issue) bool

func UpdateMachine

func UpdateMachine(id string, machine *Machine) bool

func UpdateProgram

func UpdateProgram(id string, program *Program) bool

func UpdateReport

func UpdateReport(id string, report *Report) bool

func UpdateRound

func UpdateRound(id string, round *Round) bool

func UpdateStudent

func UpdateStudent(owner string, name string, program string, student *Student) bool

Types

type Adapter

type Adapter struct {
	Engine *xorm.Engine
	// contains filtered or unexported fields
}

Adapter represents the MySQL adapter for policy storage.

func NewAdapter

func NewAdapter(driverName string, dataSourceName string, dbName string) *Adapter

NewAdapter is the constructor for Adapter.

type Event

type Event struct {
	Type     string `json:"type"`
	Title    string `json:"title"`
	HtmlURL  string `json:"html_url"`
	CreateAt string `json:"create_at"`
	State    string `json:"state"`
	OrgName  string `json:"org_name"`
	RepoName string `json:"repo_name"`
	Number   int    `json:"number"`
}

func GetEvents

func GetEvents(author string, orgMap map[string]bool, startDate time.Time, endDate time.Time) []*Event

type Issue

type Issue struct {
	Name        string   `xorm:"varchar(100) notnull pk" json:"name"`
	Org         string   `xorm:"varchar(100)" json:"org"`
	Repo        string   `xorm:"varchar(100)"  json:"repo"`
	Assignee    string   `xorm:"varchar(1000)" json:"assignee"`
	ProjectName string   `xorm:"varchar(1000)" json:"project_name"`
	ProjectId   int64    `xorm:"varchar(100)"  json:"project_id"`
	AtPeople    []string `xorm:"varchar(1000)" json:"at_people"`
}

func GetIssueByName

func GetIssueByName(name string) *Issue

func GetIssueByOrgAndRepo

func GetIssueByOrgAndRepo(org string, repo string) *Issue

func GetIssueIfExist

func GetIssueIfExist(owner string, repo string) *Issue

func GetIssues

func GetIssues() []*Issue

type Machine

type Machine struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Description string `xorm:"varchar(100)" json:"description"`
	Ip          string `xorm:"varchar(100)" json:"ip"`
	Port        int    `json:"port"`
	Username    string `xorm:"varchar(100)" json:"username"`
	Password    string `xorm:"varchar(100)" json:"password"`
	Language    string `xorm:"varchar(100)" json:"language"`
	AutoQuery   bool   `json:"autoQuery"`
	IsPermanent bool   `json:"isPermanent"`

	Services []*Service `json:"services"`
}

func GetMachine

func GetMachine(id string) *Machine

func GetMachines

func GetMachines(owner string) []*Machine

func GetProcessIdSyncedMachine

func GetProcessIdSyncedMachine(id string) *Machine

func (*Machine) DoActions

func (machine *Machine) DoActions()

type OrgRepositories

type OrgRepositories struct {
	Organization string   `json:"organization"`
	Repositories []string `json:"repositories"`
}

func GetRepositoryByOrganization

func GetRepositoryByOrganization(org string) OrgRepositories

type OrgWebhook

type OrgWebhook struct {
	Org      string         `json:"org"`
	Webhooks []*github.Hook `json:"webhooks"`
}

func GetAllOrgWebhooks

func GetAllOrgWebhooks() []*OrgWebhook

type PayLoad

type PayLoad struct {
	Review      github.PullRequestReview  `json:"review"`
	PullRequest github.PullRequest        `json:"pull_request"`
	Issue       github.Issue              `json:"issue"`
	Comment     github.PullRequestComment `json:"comment"`
}

type Program

type Program struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Title     string `xorm:"varchar(100)" json:"title"`
	Url       string `xorm:"varchar(100)" json:"url"`
	StartDate string `xorm:"varchar(100)" json:"startDate"`
	EndDate   string `xorm:"varchar(100)" json:"endDate"`
	Provider2 string `xorm:"varchar(100)" json:"provider2"`
	CanApply  bool   `json:"canApply"`
	Type      string `xorm:"varchar(100)" json:"type"`
}

func GetProgram

func GetProgram(id string) *Program

func GetPrograms

func GetPrograms(owner string) []*Program

type Report

type Report struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Program string   `xorm:"varchar(100)" json:"program"`
	Round   string   `xorm:"varchar(100)" json:"round"`
	Student string   `xorm:"varchar(100)" json:"student"`
	Mentor  string   `xorm:"varchar(100)" json:"mentor"`
	Text    string   `xorm:"mediumtext" json:"text"`
	Score   int      `json:"score"`
	Events  []*Event `json:"events"`
}

func GetFilteredReports

func GetFilteredReports(owner string, program string) []*Report

func GetNewReport

func GetNewReport(roundName string, student Student) *Report

func GetReport

func GetReport(id string) *Report

func GetReports

func GetReports(owner string) []*Report

type Round

type Round struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	Title     string `xorm:"varchar(100)" json:"title"`
	Program   string `xorm:"varchar(100)" json:"program"`
	StartDate string `xorm:"varchar(100)" json:"startDate"`
	EndDate   string `xorm:"varchar(100)" json:"endDate"`
}

func GetFilteredRounds

func GetFilteredRounds(owner string, program string) []*Round

func GetLateRound

func GetLateRound(owner string, program string) *Round

func GetRound

func GetRound(id string) *Round

func GetRounds

func GetRounds(owner string) []*Round

type Service

type Service struct {
	No             int    `json:"no"`
	Name           string `json:"name"`
	Path           string `json:"path"`
	Port           int    `json:"port"`
	ProcessId      int    `json:"processId"`
	ExpectedStatus string `json:"expectedStatus"`
	Status         string `json:"status"`
	SubStatus      string `json:"subStatus"`
	Message        string `json:"message"`
}

type Student

type Student struct {
	Owner           string             `xorm:"varchar(100) notnull pk" json:"owner"`
	Name            string             `xorm:"varchar(100) notnull pk" json:"name"`
	Program         string             `xorm:"varchar(100) notnull pk" json:"program"`
	CreatedTime     string             `xorm:"varchar(100)" json:"createdTime"`
	OrgRepositories []*OrgRepositories `xorm:"varchar(1000)" json:"org_repositories"`
	Mentor          string             `xorm:"varchar(100)" json:"mentor"`
}

func GetFilteredStudents

func GetFilteredStudents(owner string, program string) []*Student

func GetStudent

func GetStudent(owner string, name string, program string) *Student

func GetStudents

func GetStudents(owner string) []*Student

type TopicInfo

type TopicInfo struct {
	IsHit  bool   `json:"isHit"`
	Title  string `json:"title"`
	Member string `json:"member"`
}

Jump to

Keyboard shortcuts

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