package module
v0.0.0-...-ec710cb Latest Latest

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 10 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Client

type Client struct {
	Receiver chan *http.Request
	// contains filtered or unexported fields

Client contains all the information needed to connect to the CaptainHook server

func NewClient

func NewClient(secret string, rootCAs *x509.CertPool) (Client, error)

NewClient creates a new CaptainHook client. Use the secret you received from your server administrator. rootCAs can contain additional certifactes for SSL validation, e.g. snakeoil/self-signed. Set to nil if you don't expect that

func (*Client) AddHook

func (c *Client) AddHook(identifier string) error

AddHook will add a new Webhook to the server identified by identifier.

func (*Client) Connect

func (c *Client) Connect(host, port string, useSSL bool) (*http.Response, error)

Connect to the captainhook server. Provide the hostname and port of the server. If the server offers an SSL connection, you should set useSSL to true.

func (*Client) Disconnect

func (c *Client) Disconnect() error

Disconnect disconnects the websocket from the server

func (*Client) RemoveHook

func (c *Client) RemoveHook(identifier string) error

RemoveHook deletes the Webhook identified by the identifier on the server.

Jump to

Keyboard shortcuts

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