githubbot

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: BSD-3-Clause, MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultBranch

func GetDefaultBranch(repo string, client *github.Client) (branch string, err error)

Types

type DB

type DB struct {
	*base.BaseOAuthDB
}

func NewDB

func NewDB(db *sql.DB) *DB

func (*DB) CreateSubscription

func (d *DB) CreateSubscription(convID chat1.ConvIDStr, repo string, installationID int64) error

func (*DB) DeleteBranchesForRepo

func (d *DB) DeleteBranchesForRepo(convID chat1.ConvIDStr, repo string) error

func (*DB) DeleteFeaturesForRepo

func (d *DB) DeleteFeaturesForRepo(convID chat1.ConvIDStr, repo string) error

func (*DB) DeleteSubscription

func (d *DB) DeleteSubscription(convID chat1.ConvIDStr, repo string) error

func (*DB) DeleteSubscriptionsForRepo

func (d *DB) DeleteSubscriptionsForRepo(convID chat1.ConvIDStr, repo string) error

func (*DB) DeleteToken

func (d *DB) DeleteToken(identifier string) error

func (*DB) GetAllBranchesForRepo

func (d *DB) GetAllBranchesForRepo(convID chat1.ConvIDStr, repo string) ([]string, error)

func (*DB) GetAllSubscriptions

func (d *DB) GetAllSubscriptions() (res []DBSubscription, err error)

func (*DB) GetConvIDsFromRepoInstallation

func (d *DB) GetConvIDsFromRepoInstallation(repo string, installationID int64) (res []chat1.ConvIDStr, err error)

func (*DB) GetFeatures

func (d *DB) GetFeatures(convID chat1.ConvIDStr, repo string) (*Features, error)

func (*DB) GetFeaturesForAllRepos

func (d *DB) GetFeaturesForAllRepos(convID chat1.ConvIDStr) (map[string]Features, error)

func (*DB) GetSubscriptionForBranchExists

func (d *DB) GetSubscriptionForBranchExists(convID chat1.ConvIDStr, repo string, branch string) (exists bool, err error)

func (*DB) GetSubscriptionForRepoExists

func (d *DB) GetSubscriptionForRepoExists(convID chat1.ConvIDStr, repo string) (exists bool, err error)

func (*DB) GetToken

func (d *DB) GetToken(identifier string) (*oauth2.Token, error)

func (*DB) GetUserPreferences

func (d *DB) GetUserPreferences(username string, convID chat1.ConvIDStr) (*UserPreferences, error)

func (*DB) PutToken

func (d *DB) PutToken(identifier string, token *oauth2.Token) error

func (*DB) SetFeatures

func (d *DB) SetFeatures(convID chat1.ConvIDStr, repo string, features *Features) error

func (*DB) SetUserPreferences

func (d *DB) SetUserPreferences(username string, convID chat1.ConvIDStr, prefs *UserPreferences) error

func (*DB) UnwatchBranch

func (d *DB) UnwatchBranch(convID chat1.ConvIDStr, repo string, branch string) error

func (*DB) WatchBranch

func (d *DB) WatchBranch(convID chat1.ConvIDStr, repo string, branch string) error

type DBSubscription

type DBSubscription struct {
	ConvID         chat1.ConvIDStr
	Repo           string
	InstallationID int64
}

util

type Features

type Features struct {
	Issues       bool
	PullRequests bool
	Commits      bool
	Statuses     bool
}

func (*Features) String

func (f *Features) String() string

type HTTPSrv

type HTTPSrv struct {
	*base.OAuthHTTPSrv
	// contains filtered or unexported fields
}

func NewHTTPSrv

func NewHTTPSrv(stats *base.StatsRegistry, kbc *kbchat.API, debugConfig *base.ChatDebugOutputConfig, db *DB, handler *Handler,
	oauthConfig *oauth2.Config, atr *ghinstallation.AppsTransport, secret string) *HTTPSrv

type Handler

type Handler struct {
	*base.DebugOutput
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(stats *base.StatsRegistry, kbc *kbchat.API, debugConfig *base.ChatDebugOutputConfig, db *DB,
	oauthConfig *oauth2.Config, atr *ghinstallation.AppsTransport,
	httpPrefix, appName string) *Handler

func (*Handler) HandleAuth

func (h *Handler) HandleAuth(msg chat1.MsgSummary, _ string) error

func (*Handler) HandleCommand

func (h *Handler) HandleCommand(msg chat1.MsgSummary) error

func (*Handler) HandleNewConv

func (h *Handler) HandleNewConv(conv chat1.ConvSummary) error

type UserPreferences

type UserPreferences struct {
	Mention bool
}

Jump to

Keyboard shortcuts

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