ports

package
v0.0.0-...-e28bd7b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandlers

type HTTPHandlers interface {
	GitlabWebhookHandler(templateID common.ID, header types.GitlabWebhookHeader, request types.GitlabWebhookRequest) error
	GithubWebhookHandler(templateID common.ID, header types.GithubWebhookHeader, request types.GithubWebhookRequest, requestBody []byte) error
}

HTTPHandlers represents the request handlers for the all endpoints this service supports.

type HTTPServer

type HTTPServer interface {
	Start(ctx context.Context) error
	SetHandlers(handlers HTTPHandlers)
	Shutdown(ctx context.Context) error
}

HTTPServer is an interface for an HTTP server implementation

type IncomingEventHandlers

IncomingEventHandlers represents the handlers for all event operations this service supports, this is implemented by object in `domain` package

type IncomingEventPort

type IncomingEventPort interface {
	Start(ctx context.Context, wg *sync.WaitGroup) error
	SetHandlers(handlers IncomingEventHandlers)
}

IncomingEventPort is an interface for an event port.

type IncomingQueryHandlers

type IncomingQueryHandlers interface {
	List(ctx context.Context, request service.TemplateWebhookListRequest) service.TemplateWebhookListReply
}

IncomingQueryHandlers represents the handlers for all query operation this service supports, this is implemented by object in `domain` package

type IncomingQueryPort

type IncomingQueryPort interface {
	Start(ctx context.Context, wg *sync.WaitGroup) error
	SetHandlers(handlers IncomingQueryHandlers)
}

IncomingQueryPort is an interface for a query port.

type OutgoingEventPort

type OutgoingEventPort interface {
	TemplateWebhookCreatedEvent(created service.TemplateWebhookCreationResponse)
	TemplateWebhookCreateFailedEvent(created service.TemplateWebhookCreationResponse)
	TemplateWebhookDeletedEvent(deleted service.TemplateWebhookDeletionResponse)
	TemplateWebhookDeleteFailedEvent(deleted service.TemplateWebhookDeletionResponse)

	TemplateSyncRequestedEvent(request service.TemplateModel)
}

OutgoingEventPort represents all events this service will publish, implementation of IncomingEventPort will construct this and pass to methods of IncomingEventHandlers.

type PersistentStoragePort

type PersistentStoragePort interface {
	Init(config *types.Config) error
	List(ctx context.Context, user string) ([]types.TemplateWebhook, error)
	Get(ctx context.Context, templateID common.ID) (types.TemplateWebhook, error)
	Create(ctx context.Context, webhook types.TemplateWebhook) error
	UpdateLastExecutedAt(ctx context.Context, templateID common.ID) error
	Delete(ctx context.Context, user string, templateID common.ID) error
}

PersistentStoragePort is an interface for Persistent Storage.

type TemplateService

type TemplateService interface {
	// CheckPermission checks if actor has permission to create/delete webhook for the template
	CheckPermission(ctx context.Context, actor service.Actor, templateID common.ID) (allowed bool, err error)
}

TemplateService is client of template-service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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