tracker

package
v0.0.0-...-ddbfeb3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDoesNotExist = fmt.Errorf("does not exist")
)
View Source
var (
	InactiveError = fmt.Errorf("Issue is not active")
)

Functions

This section is empty.

Types

type BountyIssue

type BountyIssue struct {
	Id            int64
	Bounty        int64
	Url           string
	Active        bool
	Owner         string
	Repo          string
	Number        int64
	CommentId     int64
	Pubkey        string
	TotalPayments int
	LndConnect    string
	// map that matches rhash and whether they are paid
	Payments map[string]bool
}

type BountyIssueStore

type BountyIssueStore struct {
	// contains filtered or unexported fields
}

func NewBountyIssueStore

func NewBountyIssueStore(db *bbolt.DB) (*BountyIssueStore, error)

func (*BountyIssueStore) Add

func (store *BountyIssueStore) Add(ctx context.Context, issue *BountyIssue) error

func (*BountyIssueStore) Delete

func (store *BountyIssueStore) Delete(ctx context.Context, id int64) error

func (*BountyIssueStore) Get

func (store *BountyIssueStore) Get(ctx context.Context, id int64) (*BountyIssue, error)

func (*BountyIssueStore) ListAll

func (u *BountyIssueStore) ListAll(ctx context.Context) ([]*BountyIssue, error)

func (*BountyIssueStore) Update

func (store *BountyIssueStore) Update(ctx context.Context, issue *BountyIssue) error

type GithubCommenter

type GithubCommenter interface {
	AddComment(ctx context.Context, bountyIssue *BountyIssue) (int64, error)
	UpdateBountyComment(ctx context.Context, bountyIssue *BountyIssue) error
	CloseBountyComment(ctx context.Context, bountyIssue *BountyIssue) error
}

type GithubService

type GithubService struct {
	// contains filtered or unexported fields
}

func NewGithubService

func NewGithubService(baseUrl string, client *github.Client) *GithubService

func (*GithubService) AddComment

func (g *GithubService) AddComment(ctx context.Context, bountyIssue *BountyIssue) (int64, error)

func (*GithubService) CloseBountyComment

func (g *GithubService) CloseBountyComment(ctx context.Context, bountyIssue *BountyIssue) error

func (*GithubService) UpdateBountyComment

func (g *GithubService) UpdateBountyComment(ctx context.Context, bountyIssue *BountyIssue) error

type InvoicePageData

type InvoicePageData struct {
	Invoice string
}

type InvoiceResponse

type InvoiceResponse struct {
	Invoice string `json:"invoice"`
}

type IssueService

type IssueService struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewIssueService

func NewIssueService(cfg *config.Config, store IssueStore, ghClient GithubCommenter, lndClient lnrpc.LightningClient) *IssueService

func (*IssueService) AddBountyIssue

func (srv *IssueService) AddBountyIssue(ctx context.Context, id int64, link string, owner string, repo string, number int64, lndconnect string) (*BountyIssue, error)

func (*IssueService) CloseIssue

func (srv *IssueService) CloseIssue(ctx context.Context, id int64) error

func (*IssueService) GetBountyInvoice

func (srv *IssueService) GetBountyInvoice(ctx context.Context, id, sats int64) (string, error)

func (*IssueService) ListenPayment

func (srv *IssueService) ListenPayment(issue *BountyIssue, rHash []byte, payreqString string, sats int64)

func (*IssueService) RecoverPayments

func (srv *IssueService) RecoverPayments(ctx context.Context) error

func (*IssueService) RemovePayment

func (srv *IssueService) RemovePayment(ctx context.Context, issue *BountyIssue, payreqString string) error

func (*IssueService) SettleInvoice

func (srv *IssueService) SettleInvoice(ctx context.Context, issue *BountyIssue, payreqString string, sats int64) error

type IssueStore

type IssueStore interface {
	Add(context.Context, *BountyIssue) error
	Update(context.Context, *BountyIssue) error
	Get(context.Context, int64) (*BountyIssue, error)
	Delete(context.Context, int64) error
	ListAll(ctx context.Context) ([]*BountyIssue, error)
}

type WebhookHandler

type WebhookHandler struct {
	// contains filtered or unexported fields
}

func NewWebhookHandler

func NewWebhookHandler(cfg *config.Config, is *IssueService, ipRange []string) (*WebhookHandler, error)

func (*WebhookHandler) SetupIpaddress

func (wh *WebhookHandler) SetupIpaddress(ip string)

func (*WebhookHandler) StartHandler

func (wh *WebhookHandler) StartHandler(address string) error

Jump to

Keyboard shortcuts

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