channel

package
v0.0.0-...-86f25e9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpCallbackChannel

type HttpCallbackChannel struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewHttpCallbackChannel

func NewHttpCallbackChannel(router *mux.Router, callbackBaseURL string) *HttpCallbackChannel

func (*HttpCallbackChannel) HandleResponse

func (l *HttpCallbackChannel) HandleResponse(w http.ResponseWriter, r *http.Request)

HandleResponse handles the response from the node.

func (*HttpCallbackChannel) OnResponse

func (p *HttpCallbackChannel) OnResponse(reqID uint64, payload string) error

func (*HttpCallbackChannel) SendRequest

func (p *HttpCallbackChannel) SendRequest(c context.Context, url string, message WebhookMessage, rw http.ResponseWriter) (string, error)

type PendingRequest

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

type WebhookChannel

type WebhookChannel interface {
	SendRequest(context context.Context, url string, message WebhookMessage, rw http.ResponseWriter) (string, error)
}

type WebhookMessage

type WebhookMessage struct {
	Template string                 `json:"template"`
	Data     map[string]interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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