listener

package
v0.0.0-...-03812c6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLogger

func WithLogger(logger *zap.Logger) func(*Listener)

func WithPollTimeout

func WithPollTimeout(pollTimeout time.Duration) func(*Listener)

Types

type Event

type Event struct {
	Mapping storage.Mapping
	Type    string
	Payload Payload
}

type Handler

type Handler func(ctx context.Context, e Event) error
type Link struct {
	Name string
	URL  string
}

type Listener

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

func NewListener

func NewListener(gh *github.Client, storage storage.Storage, handler Handler, opts ...func(*Listener)) Listener

func (Listener) Run

func (s Listener) Run(ctx context.Context) error

type Payload

type Payload struct {
	Data  interface{}
	Links []Link
}
func (p *Payload) AddLink(name, url string)

Jump to

Keyboard shortcuts

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