bot

package
v0.0.0-...-20250eb Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BotContextKey contextKey = "botContext"

Variables

This section is empty.

Functions

func NewEnterpriseClient

func NewEnterpriseClient(app *App, installation Installation) (*github.Client, error)

NewEnterpriseClient instantiates a new GitHub Client using the App and Installation

Types

type App

type App struct {
	BaseURL string
	ID      int64
	Key     []byte
	Secret  string
}

App encapsulates the fields needed to define a GitHub App

func NewApp

func NewApp() *App

NewApp instantiates a GitHub App from environment variables

type Context

type Context struct {
	App     *App
	Payload interface{}
	GitHub  *github.Client
}

Context encapsulates the fields passed to webhook handlers

func FromContext

func FromContext(context context.Context) (*Context, bool)

func NewContext

func NewContext(app *App) *Context

NewContext instantiates a new context

type Installation

type Installation struct {
	ID int64
}

Installation encapsulates the fields needed to define an installation of a GitHub App

Jump to

Keyboard shortcuts

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