Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Endpoint
- type EndpointFilter
- type EndpointRepository
- type Event
- type Secret
- type Service
- func (s Service) CreateEndpoint(ctx context.Context, endpoint Endpoint) (Endpoint, error)
- func (s Service) DeleteEndpoint(ctx context.Context, id string) error
- func (s Service) ListEndpoints(ctx context.Context, filter EndpointFilter) ([]Endpoint, error)
- func (s Service) Publish(ctx context.Context, evt Event) error
- func (s Service) UpdateEndpoint(ctx context.Context, endpoint Endpoint) (Endpoint, error)
- type State
Constants ¶
View Source
const ( DefaultSecretID = "1" SignatureHeader = "X-Signature" EndpointRetryCount = 3 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
EncryptionKey string `yaml:"encryption_key" mapstructure:"encryption_key" default:"hash-secret-should-be-32-chars--"`
}
type Endpoint ¶
type Endpoint struct {
ID string
// Description is the description of the webhook
Description string
// URL is the URL of the webhook
URL string
// SubscribedEvents is the list of events that the webhook is subscribed to
SubscribedEvents []string
// Headers is the headers to be sent with the webhook
Headers map[string]string
// Secrets is the list of secrets to sign the payload
Secrets []Secret
// State is the state of the webhook
State State
// Metadata is the metadata of the webhook
Metadata metadata.Metadata
// CreatedAt is the creation time of the webhook
CreatedAt time.Time
// UpdatedAt is the update time of the webhook
UpdatedAt time.Time
}
type EndpointFilter ¶
type EndpointFilter struct {
State State
}
type EndpointRepository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(eRepo EndpointRepository) *Service
func (Service) CreateEndpoint ¶
func (Service) DeleteEndpoint ¶
func (Service) ListEndpoints ¶
Click to show internal directories.
Click to hide internal directories.