github

package
v0.0.0-...-70c028e Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package github provides both a server and a client that can be used to interact with the GitHub API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client holds logic to create a new GitHub client

func NewClient

func NewClient(options ...ClientOption) *Client

NewClient creates a new instance of Client, taking in Client options and creating a GitHub client

func (*Client) CreateClient

func (c *Client) CreateClient(installationID int) *github.Client

CreateClient instantiates a new GitHub client, handling verification of the application id and private key

type ClientOption

type ClientOption func(*Client)

ClientOption an option function to customize Client

func WithAppID

func WithAppID(appID int) ClientOption

WithAppID sets client's GitHub app id

func WithPrivateKeyPath

func WithPrivateKeyPath(privateKeyPath string) ClientOption

WithPrivateKeyPath sets client's privateKeyPath

type EventHandler

type EventHandler interface {
	HandleEvent(event interface{})
}

EventHandler interface to allow hooking into GitHub events

type Server

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

Server used to listen for and pass off GitHub events

func NewServer

func NewServer(options ...ServerOption) *Server

NewServer creates a new instance of Server, taking in ServerOptions

func (*Server) Start

func (s *Server) Start()

Start starts the server

type ServerOption

type ServerOption func(*Server)

ServerOption an option function to customize Server

func WithEventHandler

func WithEventHandler(eventHandler EventHandler) ServerOption

WithEventHandler sets Server's eventHandler

func WithWebhookSecretKey

func WithWebhookSecretKey(webhookSecretKey string) ServerOption

WithWebhookSecretKey sets Server's webhookSecretKey

Jump to

Keyboard shortcuts

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