github

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCLI

func NewFromCLI(c *cli.Context, tracer opentracing.Tracer) (eventsources.EventSource, error)

func NewSource

func NewSource(tracer opentracing.Tracer) (eventsources.EventSource, error)

func PostEvent

func PostEvent(payload []byte, eventType string, u *url.URL, client *http.Client) (*http.Response, error)

Types

type IssuesEvent

type IssuesEvent struct {
	*github.IssuesEvent
}

func (IssuesEvent) IsError

func (ie IssuesEvent) IsError() (bool, error)

func (IssuesEvent) OperationName

func (ie IssuesEvent) OperationName() string

func (IssuesEvent) ParentSpanID

func (ie IssuesEvent) ParentSpanID() (*string, error)

TODO - Issues can reference other issues inside their body to model 'epics' or issues of issues

func (IssuesEvent) SpanID

func (ie IssuesEvent) SpanID() (string, error)

ID identifies the issue event by its github Issue.ID

func (IssuesEvent) State

func (IssuesEvent) Tags

func (ie IssuesEvent) Tags() (map[string]interface{}, error)

func (IssuesEvent) Timings added in v0.3.0

func (ie IssuesEvent) Timings() (eventsources.EventTimings, error)

Timings parses github event data for start time, end time and calculates the duration.

type PREvent

type PREvent struct {
	*github.PullRequestEvent
}

func (PREvent) BranchRef

func (pr PREvent) BranchRef() *string

func (PREvent) IsError

func (pr PREvent) IsError() (bool, error)

func (PREvent) OperationName

func (pr PREvent) OperationName() string

func (PREvent) ParentSpanID

func (pr PREvent) ParentSpanID() (*string, error)

ParentSpanID inspects the PullRequestEvent payload for any references to a parent trace

func (PREvent) SpanID

func (pr PREvent) SpanID() (string, error)

func (PREvent) State

func (PREvent) Tags

func (pr PREvent) Tags() (map[string]interface{}, error)

func (PREvent) Timings added in v0.3.0

func (pr PREvent) Timings() (eventsources.EventTimings, error)

type Source

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

func (*Source) Event

func (s *Source) Event(r *http.Request, payload []byte) (eventsources.Event, error)

func (Source) Name

func (s Source) Name() string

func (*Source) SecretKey

func (s *Source) SecretKey() []byte

func (*Source) Tracer

func (s *Source) Tracer() opentracing.Tracer

func (*Source) ValidatePayload

func (s *Source) ValidatePayload(r *http.Request, secretKey []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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