services

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GithubBaseURL  = "https://api.github.com"
	ConfigFilePath = "config.json"
)

Variables

This section is empty.

Functions

func PrintAndClear

func PrintAndClear(logFileName string) error

func PrintAndClearWhithBeginTime

func PrintAndClearWhithBeginTime(logFileName string, startTime time.Time) error

func TraceError

func TraceError(message string)

func TraceError0

func TraceError0(err error) error

func TraceErrorf

func TraceErrorf(format string, arguments ...interface{})

func TraceInfo

func TraceInfo(message string)

func TraceInfof

func TraceInfof(format string, arguments ...interface{})

func TraceTime

func TraceTime(eventName string, startTime time.Time)

Types

type AllPrTaskLoader

type AllPrTaskLoader struct {
	RepoNames []string
	// contains filtered or unexported fields
}

func (*AllPrTaskLoader) GetAllTask

func (this *AllPrTaskLoader) GetAllTask(dones chan bool, errors chan error)

func (*AllPrTaskLoader) GetTotalTask

func (this *AllPrTaskLoader) GetTotalTask() int

type AssignmentService

type AssignmentService struct {
	UserServiceInstance *UserService
	// contains filtered or unexported fields
}

func NewAssignmentService

func NewAssignmentService(configFilePath string) (*AssignmentService, error)

func (*AssignmentService) Run

func (this *AssignmentService) Run() error

type JsonConfig

type JsonConfig struct {
	UsersNicknames    []string             `json:"users_niknames"`
	ReviewersPerIssue int                  `json:"reviewers_per_issue"`
	TaskSoruce        []*models.TaskSource `json:"task_source"`
	Users             []*models.User

	IssueList   []models.Issue
	UserService *UserService
	// contains filtered or unexported fields
}

func Load

func Load(configFilePath string) (*JsonConfig, error)

type PRService

type PRService struct {
	RestClient          *resty.Client
	UserServiceInstance *UserService
	GithubBaseURL       string
	TotalRequestTime    int64
	// contains filtered or unexported fields
}

func NewPRService

func NewPRService() *PRService

func NewPRService0

func NewPRService0(userDao dao.UserDaoInterface, prDao dao.PrDaoInterface) *PRService

func (*PRService) GetOpenPRs

func (this *PRService) GetOpenPRs(repo *models.Repo, source *models.TaskSource) ([]*models.PR, error)

func (*PRService) GetOpenPRsAsinc

func (this *PRService) GetOpenPRsAsinc(repo *models.Repo, source *models.TaskSource, topic chan bool, errors chan error)

func (*PRService) GetPrByNumber

func (this *PRService) GetPrByNumber(repo *models.Repo, number int, dones chan bool, errors chan error)

type PrListTaskLoader

type PrListTaskLoader struct {
	PrList []string
	// contains filtered or unexported fields
}

func (*PrListTaskLoader) GetAllTask

func (this *PrListTaskLoader) GetAllTask(dones chan bool, errors chan error)

func (*PrListTaskLoader) GetTotalTask

func (this *PrListTaskLoader) GetTotalTask() int

type TaskLoader

type TaskLoader interface {
	// returns number of task will be loaded
	GetAllTask(dones chan bool, errors chan error)

	//
	GetTotalTask() int
}

type UserService

type UserService struct {
	RestClient    *resty.Client
	GithubBaseURL string
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(dao dao.UserDaoInterface) *UserService

func NewUserService0

func NewUserService0() *UserService

func (*UserService) GetSortedUsersByAssignations

func (this *UserService) GetSortedUsersByAssignations(config *JsonConfig) []*models.User

This func calculate ondeman the sorted list. each time this function is called, the result will be calculated from users in cache defined in dao.GetAllCached().

func (*UserService) GetUser

func (this *UserService) GetUser(nickname string) (*models.User, error)

func (*UserService) GetUserAsinc

func (this *UserService) GetUserAsinc(nickname string, topic chan string, errors chan error)

Jump to

Keyboard shortcuts

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