Documentation ¶
Index ¶
Constants ¶
View Source
const ( // InMemory is an enum that represents the in-memory store InMemory = 0 // Consul is an enum that represents the consul store Consul = 1 )
View Source
const (
// Nats enum is the queue option
Nats = 0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Name string `json:"name"` Description string `json:"description"` Label string `json:"label"` Enabled bool `json:"enable"` }
Event represents the individual events that are available for subscription
type Func ¶
type Func func([]byte)
Func represents a function that takes byte as parameter type Func func(params []byte)
type Option ¶
type Option func(*webhook)
Option returns a function to the pointer of webhook
func SetDescription ¶
SetDescription takes a description and overwrites the default description
type Payload ¶
Payload represents the message that is passed through the queue with additional metadata
type Queue ¶
type Queue interface { Publish(evt string, payload []byte) error Subscribe(evt string, fn Func) error }
Queue represents the interface for the queue
type Store ¶
type Store interface { Put(key string, val []byte) error Get(key string) ([]byte, error) Delete(key string) error List(key string) ([]string, error) }
Store represents the interface for the different stores available
func NewInMemoryStore ¶
func NewInMemoryStore() Store
NewInMemoryStore returns a new in-memory store
type Webhook ¶
type Webhook interface { Register(events ...Event) error Unregister(name string) error Publish(name string, payload interface{}) error Subscribe(name string, fn Func) error Post(url string, payload []byte) error Disco(name string) error Fetch(event string) ([]string, error) Enable(resource, event, callbackURL string) error Disable(resource, event, callbackURL string) error }
Webhook represents the interface for the webhook package
Click to show internal directories.
Click to hide internal directories.