protoconnect

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebhookServiceRegisterWebhookProcedure is the fully-qualified name of the WebhookService's
	// RegisterWebhook RPC.
	WebhookServiceRegisterWebhookProcedure = "/webhook.WebhookService/RegisterWebhook"
	// WebhookServiceUnregisterWebhookProcedure is the fully-qualified name of the WebhookService's
	// UnregisterWebhook RPC.
	WebhookServiceUnregisterWebhookProcedure = "/webhook.WebhookService/UnregisterWebhook"
	// WebhookServicePushEventProcedure is the fully-qualified name of the WebhookService's PushEvent
	// RPC.
	WebhookServicePushEventProcedure = "/webhook.WebhookService/PushEvent"
	// WebhookServiceGetWebhookStatusProcedure is the fully-qualified name of the WebhookService's
	// GetWebhookStatus RPC.
	WebhookServiceGetWebhookStatusProcedure = "/webhook.WebhookService/GetWebhookStatus"
	// WebhookServiceListWebhooksProcedure is the fully-qualified name of the WebhookService's
	// ListWebhooks RPC.
	WebhookServiceListWebhooksProcedure = "/webhook.WebhookService/ListWebhooks"
	// WebhookServiceRegisterEventProcedure is the fully-qualified name of the WebhookService's
	// RegisterEvent RPC.
	WebhookServiceRegisterEventProcedure = "/webhook.WebhookService/RegisterEvent"
	// WebhookServiceListEventsProcedure is the fully-qualified name of the WebhookService's ListEvents
	// RPC.
	WebhookServiceListEventsProcedure = "/webhook.WebhookService/ListEvents"
	// WebhookServiceUpdateEventProcedure is the fully-qualified name of the WebhookService's
	// UpdateEvent RPC.
	WebhookServiceUpdateEventProcedure = "/webhook.WebhookService/UpdateEvent"
	// WebhookServiceDeleteEventProcedure is the fully-qualified name of the WebhookService's
	// DeleteEvent RPC.
	WebhookServiceDeleteEventProcedure = "/webhook.WebhookService/DeleteEvent"
	// WebhookServiceGetWebhookHealthProcedure is the fully-qualified name of the WebhookService's
	// GetWebhookHealth RPC.
	WebhookServiceGetWebhookHealthProcedure = "/webhook.WebhookService/GetWebhookHealth"
	// WebhookServiceListWebhooksByHealthProcedure is the fully-qualified name of the WebhookService's
	// ListWebhooksByHealth RPC.
	WebhookServiceListWebhooksByHealthProcedure = "/webhook.WebhookService/ListWebhooksByHealth"
	// WebhookServiceGetHealthSummaryProcedure is the fully-qualified name of the WebhookService's
	// GetHealthSummary RPC.
	WebhookServiceGetHealthSummaryProcedure = "/webhook.WebhookService/GetHealthSummary"
	// WebhookServiceResubmitWebhookProcedure is the fully-qualified name of the WebhookService's
	// ResubmitWebhook RPC.
	WebhookServiceResubmitWebhookProcedure = "/webhook.WebhookService/ResubmitWebhook"
	// WebhookServiceGetRegisteredWebhooksProcedure is the fully-qualified name of the WebhookService's
	// GetRegisteredWebhooks RPC.
	WebhookServiceGetRegisteredWebhooksProcedure = "/webhook.WebhookService/GetRegisteredWebhooks"
	// WebhookServiceListRegisteredWebhooksByEventProcedure is the fully-qualified name of the
	// WebhookService's ListRegisteredWebhooksByEvent RPC.
	WebhookServiceListRegisteredWebhooksByEventProcedure = "/webhook.WebhookService/ListRegisteredWebhooksByEvent"
	// WebhookServiceGetWebhookDeliveryStatusProcedure is the fully-qualified name of the
	// WebhookService's GetWebhookDeliveryStatus RPC.
	WebhookServiceGetWebhookDeliveryStatusProcedure = "/webhook.WebhookService/GetWebhookDeliveryStatus"
	// WebhookServiceResendWebhookProcedure is the fully-qualified name of the WebhookService's
	// ResendWebhook RPC.
	WebhookServiceResendWebhookProcedure = "/webhook.WebhookService/ResendWebhook"
	// WebhookServiceGetWebhookDeliveryHistoryProcedure is the fully-qualified name of the
	// WebhookService's GetWebhookDeliveryHistory RPC.
	WebhookServiceGetWebhookDeliveryHistoryProcedure = "/webhook.WebhookService/GetWebhookDeliveryHistory"
	// WebhookServiceGetNamespaceStatsProcedure is the fully-qualified name of the WebhookService's
	// GetNamespaceStats RPC.
	WebhookServiceGetNamespaceStatsProcedure = "/webhook.WebhookService/GetNamespaceStats"
	// WebhookServiceUpdateWebhookConfigProcedure is the fully-qualified name of the WebhookService's
	// UpdateWebhookConfig RPC.
	WebhookServiceUpdateWebhookConfigProcedure = "/webhook.WebhookService/UpdateWebhookConfig"
	// WebhookServicePauseWebhookProcedure is the fully-qualified name of the WebhookService's
	// PauseWebhook RPC.
	WebhookServicePauseWebhookProcedure = "/webhook.WebhookService/PauseWebhook"
	// WebhookServiceResumeWebhookProcedure is the fully-qualified name of the WebhookService's
	// ResumeWebhook RPC.
	WebhookServiceResumeWebhookProcedure = "/webhook.WebhookService/ResumeWebhook"
	// WebhookServiceListEventReportsProcedure is the fully-qualified name of the WebhookService's
	// ListEventReports RPC.
	WebhookServiceListEventReportsProcedure = "/webhook.WebhookService/ListEventReports"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// WebhookServiceName is the fully-qualified name of the WebhookService service.
	WebhookServiceName = "webhook.WebhookService"
)

Variables

This section is empty.

Functions

func NewWebhookServiceHandler

func NewWebhookServiceHandler(svc WebhookServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewWebhookServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type UnimplementedWebhookServiceHandler

type UnimplementedWebhookServiceHandler struct{}

UnimplementedWebhookServiceHandler returns CodeUnimplemented from all methods.

type WebhookServiceClient

type WebhookServiceClient interface {
	// RegisterWebhook registers a URL for specific events in a namespace
	RegisterWebhook(context.Context, *connect.Request[proto.RegisterWebhookRequest]) (*connect.Response[proto.RegisterWebhookResponse], error)
	// UnregisterWebhook removes a webhook registration
	UnregisterWebhook(context.Context, *connect.Request[proto.UnregisterWebhookRequest]) (*connect.Response[proto.UnregisterWebhookResponse], error)
	// PushEvent pushes an event that triggers registered webhooks
	PushEvent(context.Context, *connect.Request[proto.PushEventRequest]) (*connect.Response[proto.PushEventResponse], error)
	// GetWebhookStatus gets the status of webhook deliveries
	GetWebhookStatus(context.Context, *connect.Request[proto.GetWebhookStatusRequest]) (*connect.Response[proto.GetWebhookStatusResponse], error)
	// ListWebhooks lists all registered webhooks for a namespace
	ListWebhooks(context.Context, *connect.Request[proto.ListWebhooksRequest]) (*connect.Response[proto.ListWebhooksResponse], error)
	// RegisterEvent registers a new event type (no namespace required)
	RegisterEvent(context.Context, *connect.Request[proto.RegisterEventRequest]) (*connect.Response[proto.RegisterEventResponse], error)
	// ListEvents lists all registered event types
	ListEvents(context.Context, *connect.Request[proto.ListEventsRequest]) (*connect.Response[proto.ListEventsResponse], error)
	// UpdateEvent updates an event registration
	UpdateEvent(context.Context, *connect.Request[proto.UpdateEventRequest]) (*connect.Response[proto.UpdateEventResponse], error)
	// DeleteEvent deletes an event registration
	DeleteEvent(context.Context, *connect.Request[proto.DeleteEventRequest]) (*connect.Response[proto.DeleteEventResponse], error)
	// Health Management
	// GetWebhookHealth gets health metrics for a specific webhook
	GetWebhookHealth(context.Context, *connect.Request[proto.GetWebhookHealthRequest]) (*connect.Response[proto.GetWebhookHealthResponse], error)
	// ListWebhooksByHealth lists webhooks filtered by health status
	ListWebhooksByHealth(context.Context, *connect.Request[proto.ListWebhooksByHealthRequest]) (*connect.Response[proto.ListWebhooksByHealthResponse], error)
	// GetHealthSummary gets a summary of webhook health across all namespaces
	GetHealthSummary(context.Context, *connect.Request[proto.GetHealthSummaryRequest]) (*connect.Response[proto.GetHealthSummaryResponse], error)
	// ResubmitWebhook manually retries failed or pending webhook deliveries
	ResubmitWebhook(context.Context, *connect.Request[proto.ResubmitWebhookRequest]) (*connect.Response[proto.ResubmitWebhookResponse], error)
	// Additional webhook management methods
	// GetRegisteredWebhooks retrieves registered webhooks by ID or namespace
	GetRegisteredWebhooks(context.Context, *connect.Request[proto.GetRegisteredWebhooksRequest]) (*connect.Response[proto.GetRegisteredWebhooksResponse], error)
	// ListRegisteredWebhooksByEvent retrieves webhooks registered for specific events
	ListRegisteredWebhooksByEvent(context.Context, *connect.Request[proto.ListRegisteredWebhooksByEventRequest]) (*connect.Response[proto.ListRegisteredWebhooksByEventResponse], error)
	// GetWebhookDeliveryStatus retrieves delivery status for specific delivery
	GetWebhookDeliveryStatus(context.Context, *connect.Request[proto.GetWebhookDeliveryStatusRequest]) (*connect.Response[proto.GetWebhookDeliveryStatusResponse], error)
	// ResendWebhook resends a failed webhook delivery
	ResendWebhook(context.Context, *connect.Request[proto.ResendWebhookRequest]) (*connect.Response[proto.ResendWebhookResponse], error)
	// GetWebhookDeliveryHistory retrieves delivery history for a webhook
	GetWebhookDeliveryHistory(context.Context, *connect.Request[proto.GetWebhookDeliveryHistoryRequest]) (*connect.Response[proto.GetWebhookDeliveryHistoryResponse], error)
	// GetNamespaceStats retrieves statistics for a namespace
	GetNamespaceStats(context.Context, *connect.Request[proto.GetNamespaceStatsRequest]) (*connect.Response[proto.GetNamespaceStatsResponse], error)
	// UpdateWebhookConfig updates webhook configuration
	UpdateWebhookConfig(context.Context, *connect.Request[proto.UpdateWebhookConfigRequest]) (*connect.Response[proto.UpdateWebhookConfigResponse], error)
	// PauseWebhook temporarily disables a webhook
	PauseWebhook(context.Context, *connect.Request[proto.PauseWebhookRequest]) (*connect.Response[proto.PauseWebhookResponse], error)
	// ResumeWebhook re-enables a paused webhook
	ResumeWebhook(context.Context, *connect.Request[proto.ResumeWebhookRequest]) (*connect.Response[proto.ResumeWebhookResponse], error)
	// ListEventReports lists all events in descending order for a given namespace
	ListEventReports(context.Context, *connect.Request[proto.ListEventReportsRequest]) (*connect.Response[proto.ListEventReportsResponse], error)
}

WebhookServiceClient is a client for the webhook.WebhookService service.

func NewWebhookServiceClient

func NewWebhookServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WebhookServiceClient

NewWebhookServiceClient constructs a client for the webhook.WebhookService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type WebhookServiceHandler

type WebhookServiceHandler interface {
	// RegisterWebhook registers a URL for specific events in a namespace
	RegisterWebhook(context.Context, *connect.Request[proto.RegisterWebhookRequest]) (*connect.Response[proto.RegisterWebhookResponse], error)
	// UnregisterWebhook removes a webhook registration
	UnregisterWebhook(context.Context, *connect.Request[proto.UnregisterWebhookRequest]) (*connect.Response[proto.UnregisterWebhookResponse], error)
	// PushEvent pushes an event that triggers registered webhooks
	PushEvent(context.Context, *connect.Request[proto.PushEventRequest]) (*connect.Response[proto.PushEventResponse], error)
	// GetWebhookStatus gets the status of webhook deliveries
	GetWebhookStatus(context.Context, *connect.Request[proto.GetWebhookStatusRequest]) (*connect.Response[proto.GetWebhookStatusResponse], error)
	// ListWebhooks lists all registered webhooks for a namespace
	ListWebhooks(context.Context, *connect.Request[proto.ListWebhooksRequest]) (*connect.Response[proto.ListWebhooksResponse], error)
	// RegisterEvent registers a new event type (no namespace required)
	RegisterEvent(context.Context, *connect.Request[proto.RegisterEventRequest]) (*connect.Response[proto.RegisterEventResponse], error)
	// ListEvents lists all registered event types
	ListEvents(context.Context, *connect.Request[proto.ListEventsRequest]) (*connect.Response[proto.ListEventsResponse], error)
	// UpdateEvent updates an event registration
	UpdateEvent(context.Context, *connect.Request[proto.UpdateEventRequest]) (*connect.Response[proto.UpdateEventResponse], error)
	// DeleteEvent deletes an event registration
	DeleteEvent(context.Context, *connect.Request[proto.DeleteEventRequest]) (*connect.Response[proto.DeleteEventResponse], error)
	// Health Management
	// GetWebhookHealth gets health metrics for a specific webhook
	GetWebhookHealth(context.Context, *connect.Request[proto.GetWebhookHealthRequest]) (*connect.Response[proto.GetWebhookHealthResponse], error)
	// ListWebhooksByHealth lists webhooks filtered by health status
	ListWebhooksByHealth(context.Context, *connect.Request[proto.ListWebhooksByHealthRequest]) (*connect.Response[proto.ListWebhooksByHealthResponse], error)
	// GetHealthSummary gets a summary of webhook health across all namespaces
	GetHealthSummary(context.Context, *connect.Request[proto.GetHealthSummaryRequest]) (*connect.Response[proto.GetHealthSummaryResponse], error)
	// ResubmitWebhook manually retries failed or pending webhook deliveries
	ResubmitWebhook(context.Context, *connect.Request[proto.ResubmitWebhookRequest]) (*connect.Response[proto.ResubmitWebhookResponse], error)
	// Additional webhook management methods
	// GetRegisteredWebhooks retrieves registered webhooks by ID or namespace
	GetRegisteredWebhooks(context.Context, *connect.Request[proto.GetRegisteredWebhooksRequest]) (*connect.Response[proto.GetRegisteredWebhooksResponse], error)
	// ListRegisteredWebhooksByEvent retrieves webhooks registered for specific events
	ListRegisteredWebhooksByEvent(context.Context, *connect.Request[proto.ListRegisteredWebhooksByEventRequest]) (*connect.Response[proto.ListRegisteredWebhooksByEventResponse], error)
	// GetWebhookDeliveryStatus retrieves delivery status for specific delivery
	GetWebhookDeliveryStatus(context.Context, *connect.Request[proto.GetWebhookDeliveryStatusRequest]) (*connect.Response[proto.GetWebhookDeliveryStatusResponse], error)
	// ResendWebhook resends a failed webhook delivery
	ResendWebhook(context.Context, *connect.Request[proto.ResendWebhookRequest]) (*connect.Response[proto.ResendWebhookResponse], error)
	// GetWebhookDeliveryHistory retrieves delivery history for a webhook
	GetWebhookDeliveryHistory(context.Context, *connect.Request[proto.GetWebhookDeliveryHistoryRequest]) (*connect.Response[proto.GetWebhookDeliveryHistoryResponse], error)
	// GetNamespaceStats retrieves statistics for a namespace
	GetNamespaceStats(context.Context, *connect.Request[proto.GetNamespaceStatsRequest]) (*connect.Response[proto.GetNamespaceStatsResponse], error)
	// UpdateWebhookConfig updates webhook configuration
	UpdateWebhookConfig(context.Context, *connect.Request[proto.UpdateWebhookConfigRequest]) (*connect.Response[proto.UpdateWebhookConfigResponse], error)
	// PauseWebhook temporarily disables a webhook
	PauseWebhook(context.Context, *connect.Request[proto.PauseWebhookRequest]) (*connect.Response[proto.PauseWebhookResponse], error)
	// ResumeWebhook re-enables a paused webhook
	ResumeWebhook(context.Context, *connect.Request[proto.ResumeWebhookRequest]) (*connect.Response[proto.ResumeWebhookResponse], error)
	// ListEventReports lists all events in descending order for a given namespace
	ListEventReports(context.Context, *connect.Request[proto.ListEventReportsRequest]) (*connect.Response[proto.ListEventReportsResponse], error)
}

WebhookServiceHandler is an implementation of the webhook.WebhookService service.

Jump to

Keyboard shortcuts

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