Documentation
¶
Index ¶
Constants ¶
View Source
const (
Header = "Computantis-Web-Hooks"
)
Variables ¶
View Source
var ( ErrNotAuthorized = errors.New("not authorized") ErrProcessingFailure = errors.New("processing failed") )
Functions ¶
func Run ¶
func Run( ctx context.Context, cfg Config, sub NodesCommunicationSubscriber, log logger.Logger, ver verifier, wh WebhookCreateRemovePoster, ) error
Run initializes webhooks server and GRPC API server. It will block until the context is canceled.
Types ¶
type Config ¶
type Config struct {
Port int `yaml:"port"` // port on which validator will listen for http requests
}
Config contains configuration of the validator.
type NodesCommunicationSubscriber ¶
type NodesCommunicationSubscriber interface {
SubscribeNewTransactionsForAddresses(call transaction.TrxAddressesSubscriberCallback, log logger.Logger) error
}
NodesCommunicationSubscriber provides facade access to communication between nodes publisher endpoint.
type WebhookCreateRemovePoster ¶
type WebhookCreateRemovePoster interface {
CreateWebhook(trigger byte, address string, h webhooks.Hook) error
RemoveWebhook(trigger byte, address string, h webhooks.Hook) error
PostWebhookNewTransaction(publicAddresses []string, storingNodeURL string)
}
WebhookCreateRemovePoster provides methods to create, remove webhooks and post messages to webhooks.
Click to show internal directories.
Click to hide internal directories.