service

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebBrokerAPIDeploymentService

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

WebBrokerAPIDeploymentService handles deployment operations for WebBroker APIs

func NewWebBrokerAPIDeploymentService

func NewWebBrokerAPIDeploymentService(
	webbrokerAPIRepo repository.WebBrokerAPIRepository,
	deploymentRepo repository.DeploymentRepository,
	gatewayRepo repository.GatewayRepository,
	orgRepo repository.OrganizationRepository,
	artifactRepo repository.ArtifactRepository,
	apiRepo repository.APIRepository,
	gatewayEventsService *coreservice.GatewayEventsService,
	cfg *config.Server,
	slogger *slog.Logger,
) *WebBrokerAPIDeploymentService

NewWebBrokerAPIDeploymentService creates a new WebBrokerAPIDeploymentService

func (*WebBrokerAPIDeploymentService) DeleteWebBrokerAPIDeploymentByHandle

func (s *WebBrokerAPIDeploymentService) DeleteWebBrokerAPIDeploymentByHandle(apiHandle, deploymentID, orgUUID string) error

DeleteWebBrokerAPIDeploymentByHandle deletes a deployment using WebBroker API handle

func (*WebBrokerAPIDeploymentService) DeployWebBrokerAPIByHandle

func (s *WebBrokerAPIDeploymentService) DeployWebBrokerAPIByHandle(apiHandle string, req *api.DeployRequest, orgUUID, createdBy string) (*api.DeploymentResponse, error)

DeployWebBrokerAPIByHandle creates a new immutable deployment using WebBroker API handle

func (*WebBrokerAPIDeploymentService) GetWebBrokerAPIDeploymentByHandle

func (s *WebBrokerAPIDeploymentService) GetWebBrokerAPIDeploymentByHandle(apiHandle, deploymentID, orgUUID string) (*api.DeploymentResponse, error)

GetWebBrokerAPIDeploymentByHandle retrieves a single deployment using WebBroker API handle

func (*WebBrokerAPIDeploymentService) GetWebBrokerAPIDeploymentsByHandle

func (s *WebBrokerAPIDeploymentService) GetWebBrokerAPIDeploymentsByHandle(apiHandle, gatewayID, status, orgUUID string) (*api.DeploymentListResponse, error)

GetWebBrokerAPIDeploymentsByHandle retrieves deployments for a WebBroker API using handle

func (*WebBrokerAPIDeploymentService) RestoreWebBrokerAPIDeploymentByHandle

func (s *WebBrokerAPIDeploymentService) RestoreWebBrokerAPIDeploymentByHandle(apiHandle, deploymentID, gatewayID, orgUUID string) (*api.DeploymentResponse, error)

RestoreWebBrokerAPIDeploymentByHandle restores a previous deployment using WebBroker API handle

func (*WebBrokerAPIDeploymentService) UndeployWebBrokerAPIDeploymentByHandle

func (s *WebBrokerAPIDeploymentService) UndeployWebBrokerAPIDeploymentByHandle(apiHandle, deploymentID, gatewayID, orgUUID string) (*api.DeploymentResponse, error)

UndeployWebBrokerAPIDeploymentByHandle undeploys a deployment using WebBroker API handle

type WebBrokerAPIService

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

WebBrokerAPIService handles business logic for WebBroker API operations

func NewWebBrokerAPIService

func NewWebBrokerAPIService(
	repo repository.WebBrokerAPIRepository,
	projectRepo repository.ProjectRepository,
	gatewayRepo repository.GatewayRepository,
	gatewayEventsService *coreservice.GatewayEventsService,
	apiUtil *utils.APIUtil,
	slogger *slog.Logger,
	auditRepo repository.AuditRepository,
	cfg *config.Server,
	identity *coreservice.IdentityService,
) *WebBrokerAPIService

NewWebBrokerAPIService creates a new WebBrokerAPIService instance

func (*WebBrokerAPIService) Count

func (s *WebBrokerAPIService) Count(orgUUID string) (int, error)

Count returns the total number of WebBroker APIs for an organization

func (*WebBrokerAPIService) Create

func (s *WebBrokerAPIService) Create(orgUUID, createdBy string, req *api.WebBrokerAPI) (*api.WebBrokerAPI, error)

Create creates a new WebBroker API

func (*WebBrokerAPIService) Delete

func (s *WebBrokerAPIService) Delete(orgUUID, handle, deletedBy string) error

Delete deletes a WebBroker API by its handle

func (*WebBrokerAPIService) Get

func (s *WebBrokerAPIService) Get(orgUUID, handle string) (*api.WebBrokerAPI, error)

Get retrieves a WebBroker API by its handle

func (*WebBrokerAPIService) List

func (s *WebBrokerAPIService) List(orgUUID, projectUUID string, limit, offset int) (*api.WebBrokerAPIListResponse, error)

List retrieves WebBroker APIs for an organization filtered by project

func (*WebBrokerAPIService) Update

func (s *WebBrokerAPIService) Update(orgUUID, handle, updatedBy string, req *api.WebBrokerAPI) (*api.WebBrokerAPI, error)

Update updates an existing WebBroker API

type WebSubAPIDeploymentService

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

WebSubAPIDeploymentService handles deployment operations for WebSub APIs

func NewWebSubAPIDeploymentService

func NewWebSubAPIDeploymentService(
	websubAPIRepo repository.WebSubAPIRepository,
	deploymentRepo repository.DeploymentRepository,
	gatewayRepo repository.GatewayRepository,
	orgRepo repository.OrganizationRepository,
	artifactRepo repository.ArtifactRepository,
	apiRepo repository.APIRepository,
	gatewayEventsService *coreservice.GatewayEventsService,
	cfg *config.Server,
	slogger *slog.Logger,
) *WebSubAPIDeploymentService

NewWebSubAPIDeploymentService creates a new WebSubAPIDeploymentService

func (*WebSubAPIDeploymentService) DeleteWebSubAPIDeploymentByHandle

func (s *WebSubAPIDeploymentService) DeleteWebSubAPIDeploymentByHandle(apiHandle, deploymentID, orgUUID string) error

DeleteWebSubAPIDeploymentByHandle deletes a deployment using WebSub API handle

func (*WebSubAPIDeploymentService) DeployWebSubAPIByHandle

func (s *WebSubAPIDeploymentService) DeployWebSubAPIByHandle(apiHandle string, req *api.DeployRequest, orgUUID, createdBy string) (*api.DeploymentResponse, error)

DeployWebSubAPIByHandle creates a new immutable deployment using WebSub API handle

func (*WebSubAPIDeploymentService) GetWebSubAPIDeploymentByHandle

func (s *WebSubAPIDeploymentService) GetWebSubAPIDeploymentByHandle(apiHandle, deploymentID, orgUUID string) (*api.DeploymentResponse, error)

GetWebSubAPIDeploymentByHandle retrieves a single deployment using WebSub API handle

func (*WebSubAPIDeploymentService) GetWebSubAPIDeploymentsByHandle

func (s *WebSubAPIDeploymentService) GetWebSubAPIDeploymentsByHandle(apiHandle, gatewayID, status, orgUUID string) (*api.DeploymentListResponse, error)

GetWebSubAPIDeploymentsByHandle retrieves deployments for a WebSub API using handle

func (*WebSubAPIDeploymentService) RestoreWebSubAPIDeploymentByHandle

func (s *WebSubAPIDeploymentService) RestoreWebSubAPIDeploymentByHandle(apiHandle, deploymentID, gatewayID, orgUUID string) (*api.DeploymentResponse, error)

RestoreWebSubAPIDeploymentByHandle restores a previous deployment using WebSub API handle

func (*WebSubAPIDeploymentService) UndeployWebSubAPIDeploymentByHandle

func (s *WebSubAPIDeploymentService) UndeployWebSubAPIDeploymentByHandle(apiHandle, deploymentID, gatewayID, orgUUID string) (*api.DeploymentResponse, error)

UndeployWebSubAPIDeploymentByHandle undeploys a deployment using WebSub API handle

type WebSubAPIHmacSecretService

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

WebSubAPIHmacSecretService manages platform-side HMAC secrets for WebSub APIs.

func NewWebSubAPIHmacSecretService

func NewWebSubAPIHmacSecretService(
	repo repository.WebSubAPIHmacSecretRepository,
	websubRepo repository.WebSubAPIRepository,
	gatewayEventsService *coreservice.GatewayEventsService,
	gatewayRepo repository.GatewayRepository,
	encryptionKeyStr string,
	slogger *slog.Logger,
) (*WebSubAPIHmacSecretService, error)

NewWebSubAPIHmacSecretService creates a new WebSubAPIHmacSecretService. encryptionKeyStr must be a 32-byte key encoded as 64 hex chars or base64 (set via DATABASE_ENCRYPTION_KEY).

func (*WebSubAPIHmacSecretService) DecryptSecret

func (s *WebSubAPIHmacSecretService) DecryptSecret(secret *model.WebSubAPIHmacSecret) (string, error)

DecryptSecret returns the plaintext for a given HMAC secret (used by the internal gateway endpoint).

func (*WebSubAPIHmacSecretService) Delete

func (s *WebSubAPIHmacSecretService) Delete(orgUUID, apiHandle, secretName string) error

Delete permanently removes a named HMAC secret.

func (*WebSubAPIHmacSecretService) Generate

func (s *WebSubAPIHmacSecretService) Generate(orgUUID, apiHandle, name, externalSecret, userID string) (*model.WebSubAPIHmacSecret, string, error)

Generate creates a new HMAC secret for the given WebSub API. externalSecret is an optional caller-supplied value; if empty, one is auto-generated. Returns the metadata and the plaintext value (returned once, never stored).

func (*WebSubAPIHmacSecretService) List

func (s *WebSubAPIHmacSecretService) List(orgUUID, apiHandle string) ([]*model.WebSubAPIHmacSecret, error)

List returns all HMAC secrets for a WebSub API (no plaintext values).

func (*WebSubAPIHmacSecretService) ListByArtifactUUID

func (s *WebSubAPIHmacSecretService) ListByArtifactUUID(artifactUUID string) ([]*model.WebSubAPIHmacSecret, error)

ListByArtifactUUID returns all HMAC secrets for an artifact UUID (used by internal gateway endpoint).

func (*WebSubAPIHmacSecretService) Regenerate

func (s *WebSubAPIHmacSecretService) Regenerate(orgUUID, apiHandle, secretName, externalSecret, userID string) (*model.WebSubAPIHmacSecret, string, error)

Regenerate replaces the secret value for an existing named secret. externalSecret is an optional caller-supplied value; if empty, a new value is auto-generated. Returns the metadata and new plaintext (returned once, never stored).

type WebSubAPIService

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

WebSubAPIService handles business logic for WebSub API operations

func NewWebSubAPIService

func NewWebSubAPIService(
	repo repository.WebSubAPIRepository,
	projectRepo repository.ProjectRepository,
	gatewayRepo repository.GatewayRepository,
	gatewayEventsService *coreservice.GatewayEventsService,
	apiUtil *utils.APIUtil,
	slogger *slog.Logger,
	auditRepo repository.AuditRepository,
	cfg *config.Server,
	identity *coreservice.IdentityService,
) *WebSubAPIService

NewWebSubAPIService creates a new WebSubAPIService instance

func (*WebSubAPIService) Count

func (s *WebSubAPIService) Count(orgUUID string) (int, error)

Count returns the total number of WebSub APIs for an organization

func (*WebSubAPIService) Create

func (s *WebSubAPIService) Create(orgUUID, createdBy string, req *api.WebSubAPI) (*api.WebSubAPI, error)

Create creates a new WebSub API

func (*WebSubAPIService) Delete

func (s *WebSubAPIService) Delete(orgUUID, handle, deletedBy string) error

Delete deletes a WebSub API by its handle

func (*WebSubAPIService) Get

func (s *WebSubAPIService) Get(orgUUID, handle string) (*api.WebSubAPI, error)

Get retrieves a WebSub API by its handle

func (*WebSubAPIService) List

func (s *WebSubAPIService) List(orgUUID, projectUUID string, limit, offset int) (*api.WebSubAPIListResponse, error)

List retrieves WebSub APIs for an organization filtered by project

func (*WebSubAPIService) Update

func (s *WebSubAPIService) Update(orgUUID, handle, updatedBy string, req *api.WebSubAPI) (*api.WebSubAPI, error)

Update updates an existing WebSub API

Jump to

Keyboard shortcuts

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