webhooks

package
v0.0.0-...-d761283 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventTypeDatabaseHealthy = eventType{
		Value: eventTypeData{Key: "database_healthy", Name: "Database healthy"},
	}
	EventTypeDatabaseUnhealthy = eventType{
		Value: eventTypeData{Key: "database_unhealthy", Name: "Database unhealthy"},
	}

	EventTypeDestinationHealthy = eventType{
		Value: eventTypeData{Key: "destination_healthy", Name: "Destination healthy"},
	}
	EventTypeDestinationUnhealthy = eventType{
		Value: eventTypeData{Key: "destination_unhealthy", Name: "Destination unhealthy"},
	}

	EventTypeExecutionSuccess = eventType{
		Value: eventTypeData{Key: "execution_success", Name: "Execution success"},
	}
	EventTypeExecutionFailed = eventType{
		Value: eventTypeData{Key: "execution_failed", Name: "Execution failed"},
	}
)

Functions

This section is empty.

Types

type PaginateWebhookExecutionsParams

type PaginateWebhookExecutionsParams struct {
	WebhookID uuid.UUID
	Page      int
	Limit     int
}

type PaginateWebhooksParams

type PaginateWebhooksParams struct {
	Page  int
	Limit int
}

type Service

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

func New

func New(
	dbgen *dbgen.Queries,
) *Service

func (*Service) CreateWebhook

func (s *Service) CreateWebhook(
	ctx context.Context, params dbgen.WebhooksServiceCreateWebhookParams,
) (dbgen.Webhook, error)

func (*Service) DeleteWebhook

func (s *Service) DeleteWebhook(
	ctx context.Context, id uuid.UUID,
) error

func (*Service) DuplicateWebhook

func (s *Service) DuplicateWebhook(
	ctx context.Context, webhookID uuid.UUID,
) (dbgen.Webhook, error)

func (*Service) GetWebhook

func (s *Service) GetWebhook(
	ctx context.Context, id uuid.UUID,
) (dbgen.Webhook, error)

func (*Service) PaginateWebhooks

func (s *Service) PaginateWebhooks(
	ctx context.Context, params PaginateWebhooksParams,
) (paginateutil.PaginateResponse, []dbgen.Webhook, error)

func (*Service) RunDatabaseHealthy

func (s *Service) RunDatabaseHealthy(databaseID uuid.UUID)

RunDatabaseHealthy runs the healthy webhooks for the given database ID.

func (*Service) RunDatabaseUnhealthy

func (s *Service) RunDatabaseUnhealthy(databaseID uuid.UUID)

RunDatabaseUnhealthy runs the unhealthy webhooks for the given database ID.

func (*Service) RunDestinationHealthy

func (s *Service) RunDestinationHealthy(destinationID uuid.UUID)

RunDestinationHealthy runs the healthy webhooks for the given destination ID.

func (*Service) RunDestinationUnhealthy

func (s *Service) RunDestinationUnhealthy(destinationID uuid.UUID)

RunDestinationUnhealthy runs the unhealthy webhooks for the given destination ID.

func (*Service) RunExecutionFailed

func (s *Service) RunExecutionFailed(backupID uuid.UUID)

RunExecutionFailed runs the failed webhooks for the given execution ID.

func (*Service) RunExecutionSuccess

func (s *Service) RunExecutionSuccess(backupID uuid.UUID)

RunExecutionSuccess runs the success webhooks for the given execution ID.

func (*Service) SendWebhookRequest

func (s *Service) SendWebhookRequest(
	ctx context.Context, webhook dbgen.Webhook,
) error

SendWebhookRequest sends a webhook request to the given webhook and stores the result in the database.

func (*Service) UpdateWebhook

func (s *Service) UpdateWebhook(
	ctx context.Context, params dbgen.WebhooksServiceUpdateWebhookParams,
) (dbgen.Webhook, error)

Jump to

Keyboard shortcuts

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