Help us shape the future of Go! Take the 2026 Go Developer Survey

webhooks

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultWebHookPath ..
	DefaultWebHookPath = "webhooks/webhook.example.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailabilityHooks

type AvailabilityHooks struct {
	OnDroppedBelowThreshold string `yaml:"on-dropped-below-threshold"`
}

AvailabilityHooks ..

type BadBlockHooks

type BadBlockHooks struct {
	OnCannotCommit string `yaml:"on-cannot-commit-block"`
}

BadBlockHooks ..

type DoubleSignWebHooks

type DoubleSignWebHooks struct {
	OnNoticeDoubleSign string `yaml:"on-notice-double-sign"`
}

DoubleSignWebHooks ..

type Hooks

type Hooks struct {
	Slashing       *DoubleSignWebHooks `yaml:"slashing-hooks"`
	Availability   *AvailabilityHooks  `yaml:"availability-hooks"`
	ProtocolIssues *BadBlockHooks      `yaml:"protocol-hooks"`
}

Hooks ..

func NewWebHooksFromPath

func NewWebHooksFromPath(yamlPath string) (*Hooks, error)

NewWebHooksFromPath ..

type ReportResult

type ReportResult struct {
	Result  string `json:"result"`
	Payload string `json:"payload"`
}

ReportResult ..

func DoPost

func DoPost(url string, record interface{}) (*ReportResult, error)

DoPost is a fire and forget helper

func NewFailure

func NewFailure(payload string) *ReportResult

NewFailure ..

func NewSuccess

func NewSuccess(payload string) *ReportResult

NewSuccess ..

Jump to

Keyboard shortcuts

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