webhook

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateEvent

func ValidateEvent(eventName string) error

ValidateEvent provides validation checks for the event name of a webhook

func ValidateTargetURI

func ValidateTargetURI(targetURI string) error

ValidateTargetURI provides validation checks for the targetUri of a webhook

Types

type AddTargetURIReq

type AddTargetURIReq struct {
	Event     string `json:"-" valid:"required" URIParam:"yes"`
	TargetUri string `valid:"required" json:"targetUri"`
}

AddTargetURIReq represents a request to add a webhook. It will add a target uri to be called on a specific event.

func (*AddTargetURIReq) Validate

func (c *AddTargetURIReq) Validate() error

Validate provides custom validation for the AddTargetURIReq request

type Configuration

type Configuration struct {
	Recursive  bool
	TargetUris []TargetUri
}

type DeleteReq

type DeleteReq struct {
	Event string `json:"-" valid:"required" URIParam:"yes"`
}

DeleteReq represents a request to delete all the target uris associated with a webhook for a given event

func (*DeleteReq) Validate

func (c *DeleteReq) Validate() error

Validate provides custom validation for the AddTargetURIReq request

type DeleteTargetURIReq

type DeleteTargetURIReq struct {
	Event     string `json:"-" valid:"required" URIParam:"yes"`
	TargetUri string `URIParam:"yes" valid:"required"`
}

DeleteTargetURIReq represents a request to delete a specific target uri associated with a webhook for a given event

func (*DeleteTargetURIReq) Validate

func (c *DeleteTargetURIReq) Validate() error

Validate provides custom validation for the DeleteTargetURIReq request

type ListRes

type ListRes struct {
	Items []Webhook
}

ListRes represents a list of webhooks

type TargetUri

type TargetUri struct {
	TargetUri string
}

type UpdateReq

type UpdateReq struct {
	Event      string      `json:"-" valid:"required" URIParam:"yes"`
	Recursive  string      `json:"recursive" oneOf:"true,false"`
	TargetUris []TargetUri `json:"targetUris,omitempty"`
}

UpdateReq represents a request to update a webhook for a given event

func (*UpdateReq) Validate

func (c *UpdateReq) Validate() error

Validate provides custom validation for the UpdateReq request

type Webhook

type Webhook struct {
	Name          string
	Configuration Configuration
	Links         []models.LinkEntity
}

Jump to

Keyboard shortcuts

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