bot

package
v0.0.0-...-060301f Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 11 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

This section is empty.

Types

type Bot

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

Bot represents the bot.

func NewBot

func NewBot(id int, cert string) *Bot

NewBot creates a new bot instance.

func (*Bot) SayHello

func (b *Bot) SayHello(r *http.Request) error

SayHello will take a http request, decode the request body and write a hello comment.

type Config

type Config struct {
	Ignore struct {
		Users  []string `yaml:"users"`
		Labels []string `yaml:"labels"`
	} `yaml:"ignore"`
	Issue       Item `yaml:"issue"`
	PullRequest Item `yaml:"pull_request"`
}

Config represents `.hello.yml` file.

type Item

type Item struct {
	Disabled bool     `yaml:"disabled"`
	Labels   []string `yaml:"labels"`
	Message  string   `yaml:"message"`
}

type Payload

type Payload struct {
	Action string `json:"action"`
	Issue  struct {
		Number int `json:"number"`
		Labels []struct {
			Name string `json:"string"`
		} `json:"labels"`
	} `json:"issue"`
	PullRequest struct {
		Number int `json:"number"`
	} `json:"pull_request"`
	Repository struct {
		DefaultBranch string `json:"default_branch"`
		Name          string `json:"name"`
		Owner         struct {
			Login string `json:"login"`
		} `json:"owner"`
		Private bool `json:"private"`
	} `json:"repository"`
	Sender struct {
		Login string `json:"login"`
	} `json:"sender"`
	Installation struct {
		ID int `json:"id"`
	} `json:"installation"`
}

Payload struct of GitHub webhooks for issues and pull request.

func (*Payload) IsPullRequest

func (p *Payload) IsPullRequest() bool

IsPullRequest returns true when the payload it's a pull request payload.

Jump to

Keyboard shortcuts

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