event

package
v0.0.0-...-f44d1fc Latest Latest
Warning

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

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

Documentation

Overview

Package event parses github webhooks and converts their data to a manageable Event type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Signature string
	Type      string
	Received  time.Time
	Payload   []byte
	RepoInfo  *RepoInfo `json:"-"` // Do not want to encode this in PubSub
}

Event is a parsed representation of an Event from GitHub.

func ParseFromRequest

func ParseFromRequest(r *http.Request, received time.Time) (*Event, error)

ParseFromRequest returns a parsed Event from the incoming HTTP webhook payload.

func (Event) String

func (e Event) String() string

String formats the event as a pretty printed string (multi-line).

type RepoInfo

type RepoInfo struct {
	IsPrivate        bool
	Name             string
	OwnerName        string
	OrganizationName string
}

RepoInfo Contains information about the repository the Event is from.

Jump to

Keyboard shortcuts

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