controllers

package
v0.0.0-...-c60c6d1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = time.Duration(5) * time.Second
View Source
var ErrAlreadyConfirmed = errors.New("user is already confirmed")
View Source
var ErrBountyAddrEmpty = errors.New("the bounty address has no funds")
View Source
var ErrInternalError = errors.New("internal error occurred")
View Source
var ErrInvalidConfirmationCode = errors.New("invalid confirmation code")
View Source
var ErrInvalidID = errors.New("invalid object id")
View Source
var ErrInvalidModel = errors.New("invalid model")
View Source
var ErrInvalidModelDeletion = errors.New("invalid model deletion")
View Source
var ErrInvalidModelUpdate = errors.New("invalid model update")
View Source
var ErrInvalidQuery = errors.New("invalid query")
View Source
var ErrIssueDoesntExist = errors.New("issue doesn't exist")
View Source
var ErrIssueIsClosed = errors.New("issue is closed")
View Source
var ErrIssuesDeactivated = errors.New("repository has issues deactivated")
View Source
var ErrRepositoryNotInPlatform = errors.New("repository not added to platform")

Functions

func DefaultCtx

func DefaultCtx() context.Context

func ShutdownWebHookListener

func ShutdownWebHookListener()

Types

type AppCtrl

type AppCtrl struct {
}

func (*AppCtrl) Init

func (ac *AppCtrl) Init() error

type Bot

type Bot struct {
	Config     *config.Configuration `inject:""`
	GHClient   *github.Client        `inject:""`
	RepoCtrl   *RepoCtrl             `inject:""`
	BountyCtrl *BountyCtrl           `inject:""`
	Mongo      *mongo.Client         `inject:""`
	// contains filtered or unexported fields
}

func (*Bot) HandleBountyRelease

func (b *Bot) HandleBountyRelease(issuePayload gwb.IssueCommentPayload, bounty *models.Bounty, repo *models.Repository, comment string)

func (*Bot) HandleBountyTransfer

func (b *Bot) HandleBountyTransfer(issuePayload gwb.IssueCommentPayload, bounty *models.Bounty, repo *models.Repository, addr string)

func (*Bot) HandleIssueComment

func (b *Bot) HandleIssueComment(issuePayload gwb.IssueCommentPayload, bounty *models.Bounty, repo *models.Repository)

func (*Bot) Init

func (b *Bot) Init() error

func (*Bot) InstallWebHooks

func (b *Bot) InstallWebHooks()

func (*Bot) ListenToWebHooks

func (b *Bot) ListenToWebHooks()

func (*Bot) PostBountyDeletedFromPlatformMessage

func (b *Bot) PostBountyDeletedFromPlatformMessage(owner string, repo string, bounty *models.Bounty) error

func (*Bot) PostBountyReceiverUpdatedMessage

func (b *Bot) PostBountyReceiverUpdatedMessage(owner string, repo string, bounty *models.Bounty) error

func (*Bot) PostBountyReleasedMessage

func (b *Bot) PostBountyReleasedMessage(owner string, repo string, bounty *models.Bounty) error

func (*Bot) PostBountySentMessage

func (b *Bot) PostBountySentMessage(owner string, repo string, bounty *models.Bounty, value uint64, bundleHash string) error

func (*Bot) PostNewBountyMessage

func (b *Bot) PostNewBountyMessage(owner string, repo string, bounty *models.Bounty) error

func (*Bot) Run

func (b *Bot) Run()

func (*Bot) Sync

func (b *Bot) Sync()

type BountyCtrl

type BountyCtrl struct {
	Config   *config.Configuration `inject:""`
	GHClient *github.Client        `inject:""`
	RepoCtrl *RepoCtrl             `inject:""`
	Mongo    *mongo.Client         `inject:""`
	Coll     *mongo.Collection
	DelColl  *mongo.Collection
	Bot      *Bot `inject:""`
	// contains filtered or unexported fields
}

func (*BountyCtrl) Add

func (bc *BountyCtrl) Add(owner string, repoName string, issueID int) (*models.Bounty, error)

func (*BountyCtrl) Delete

func (bc *BountyCtrl) Delete(id int64, repo ...*models.Repository) error

func (*BountyCtrl) GetAccountBalance

func (bc *BountyCtrl) GetAccountBalance(seed string) (uint64, error)

func (*BountyCtrl) GetAll

func (bc *BountyCtrl) GetAll() ([]models.Bounty, error)

func (*BountyCtrl) GetByID

func (bc *BountyCtrl) GetByID(id int64) (*models.Bounty, error)

func (*BountyCtrl) GetByIssueNumber

func (bc *BountyCtrl) GetByIssueNumber(repoID int64, issueID int) (*models.Bounty, error)

func (*BountyCtrl) GetOfRepository

func (bc *BountyCtrl) GetOfRepository(owner string, name string) ([]models.Bounty, error)

func (*BountyCtrl) Init

func (bc *BountyCtrl) Init() error

func (*BountyCtrl) LoadAccount

func (bc *BountyCtrl) LoadAccount(seed string) (account.Account, error)

func (*BountyCtrl) LoadAccountForSending

func (bc *BountyCtrl) LoadAccountForSending(seed string) (account.Account, error)

func (*BountyCtrl) ReleaseBounty

func (bc *BountyCtrl) ReleaseBounty(bounty *models.Bounty, receiverID int64) error

func (*BountyCtrl) SyncBounties

func (bc *BountyCtrl) SyncBounties()

func (*BountyCtrl) SyncBounty

func (bc *BountyCtrl) SyncBounty(bounty *models.Bounty) error

func (*BountyCtrl) TransferBounty

func (bc *BountyCtrl) TransferBounty(bounty *models.Bounty, addr string) (bundle.Bundle, uint64, error)

type Controller

type Controller interface {
	Init() error
}

type RepoCtrl

type RepoCtrl struct {
	Config     *config.Configuration `inject:""`
	BountyCtrl *BountyCtrl           `inject:""`
	Bot        *Bot                  `inject:""`
	GHClient   *github.Client        `inject:""`
	Mongo      *mongo.Client         `inject:""`
	Coll       *mongo.Collection
	DelColl    *mongo.Collection
	// contains filtered or unexported fields
}

func (*RepoCtrl) Add

func (rc *RepoCtrl) Add(owner string, name string) (*models.Repository, error)

func (*RepoCtrl) AddViaURL

func (rc *RepoCtrl) AddViaURL(url string) (*models.Repository, error)

func (*RepoCtrl) Delete

func (rc *RepoCtrl) Delete(id int64) error

func (*RepoCtrl) GetAll

func (rc *RepoCtrl) GetAll() ([]models.Repository, error)

func (*RepoCtrl) GetByID

func (rc *RepoCtrl) GetByID(id int64) (*models.Repository, error)

func (*RepoCtrl) GetByOwnerAndName

func (rc *RepoCtrl) GetByOwnerAndName(owner string, name string) (*models.Repository, error)

func (*RepoCtrl) Init

func (rc *RepoCtrl) Init() error

func (*RepoCtrl) SyncRepo

func (rc *RepoCtrl) SyncRepo(repo *models.Repository) error

func (*RepoCtrl) SyncRepositories

func (rc *RepoCtrl) SyncRepositories()

Jump to

Keyboard shortcuts

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