Documentation ¶
Index ¶
- func AgreementReached(members []string, votes map[string]bool, opts *AgreementOptions) (bool, string)
- func GenerateReviewMap(reviews []*github.PullRequestReview) map[string]bool
- func GenerateTestWebhookRouter(secret []byte, apiToken, keyfile string) *mux.Router
- func NewWebhookHandler(secret []byte, integrationID int, keyfile string) *mux.Router
- func RemoveStaleReviews(currentSha string, reviews []*github.PullRequestReview) []*github.PullRequestReview
- type AgreementOptions
- type GithubWebhookHandler
- type UnirConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgreementReached ¶
func AgreementReached(members []string, votes map[string]bool, opts *AgreementOptions) (bool, string)
AgreementReached determines whether members have reached an agreement If the number of members who answered true is greater than the threshold the function returns true.
func GenerateReviewMap ¶
func GenerateReviewMap(reviews []*github.PullRequestReview) map[string]bool
func GenerateTestWebhookRouter ¶ added in v0.5.0
func NewWebhookHandler ¶
func RemoveStaleReviews ¶
func RemoveStaleReviews(currentSha string, reviews []*github.PullRequestReview) []*github.PullRequestReview
TODO: Write a test
Types ¶
type AgreementOptions ¶
type GithubWebhookHandler ¶
type GithubWebhookHandler struct { Secret []byte // contains filtered or unexported fields }
type UnirConfig ¶
type UnirConfig struct { Whitelist []string `yaml:"whitelist"` ApprovalsNeeded int `yaml:"approvals_needed"` ConsensusNeeded bool `yaml:"consensus_needed"` MergeMethod string `yaml:"merge_method"` MergeBlockKeywords []string `yaml:"merge_block_keywords"` }
func GrabConfig ¶
func ReadConfig ¶
func ReadConfig(input []byte) (UnirConfig, error)
Click to show internal directories.
Click to hide internal directories.