models

package
v0.0.0-...-6f7e320 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelError = "error"
	LevelInfo  = "info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Time    time.Time
	Type    string
	Content string
	Err     error
}

func (*Event) GetString

func (this *Event) GetString() string

func (*Event) Print

func (this *Event) Print()

type ExeptionRules

type ExeptionRules struct {
	Type    string   `json:"type"`
	Content []string `json:"content"`
}

type Issue

type Issue interface {
	Weight() int
	GetAssignedUsers() []*User
	GetAuthor() *User
	Assing(u *User)
	ToString() string
}

type PR

type PR struct {
	Commits       int           `json:"commits"`
	Additions     int           `json:"additions"`
	Deletions     int           `json:"deletions"`
	Number        int           `json:"number"`
	Title         string        `json:"title"`
	Body          string        `json:"body"`
	Assignees     []interface{} `json:"assignees"`
	Repo          *Repo         `json:"repo"`
	Labels        []string      `json:"labels,omitempty"`
	AssignedUsers []*User
	AssigneesSize int
	User          *User `json:"user"`
	FetchedAt     time.Time
	RequestTime   int64
}

func (*PR) Assing

func (this *PR) Assing(u *User)

func (*PR) GetAssignedUsers

func (this *PR) GetAssignedUsers() []*User

func (*PR) GetAuthor

func (this *PR) GetAuthor() *User

func (*PR) SetEndTime

func (this *PR) SetEndTime(initTime time.Time)

func (*PR) ToString

func (this *PR) ToString() string

func (*PR) Weight

func (this *PR) Weight() int

type Repo

type Repo struct {
	Name          string `json:"name"`
	FullName      string `json:"full_name"`
	Description   string `json:"description"`
	Contributors  []*User
	Collaborators []*User
	PullRequests  []*PR
}

func NewRepo

func NewRepo(fullName string) Repo

type TaskSource

type TaskSource struct {
	ResourceType  string           `json:"resource_type"`
	Resources     []string         `json:"resources"`
	ExeptionRules []*ExeptionRules `json:"exeption_rules,omitempty"`
}

func (*TaskSource) Evaluate

func (this *TaskSource) Evaluate(pr *PR) *string

type User

type User struct {
	NickName          string `json:"login"`
	FetchedAt         time.Time
	RequestTime       int64
	AssignedTaskValue int
	AssignedIssues    []*Issue
}

func (*User) AssingIssue

func (this *User) AssingIssue(issue Issue) int

Jump to

Keyboard shortcuts

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