domain

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Storage                      ports.PersistentStoragePort
	TemplateSource               ports.TemplateSourcePort
	TemplateCustomFieldTypeQuery ports.TemplateCustomFieldTypeQueryPort
	Credential                   ports.CredentialPort
	QueryIn                      ports.IncomingQueryPort
	EventIn                      ports.IncomingEventPort
	// contains filtered or unexported fields
}

Domain is the base struct for the domain service

func (*Domain) Init

func (d *Domain) Init(config *types.Config) error

Init initializes all the specified adapters

func (*Domain) NewEventHandlers

func (d *Domain) NewEventHandlers() ports.IncomingEventHandlers

NewEventHandlers ...

func (*Domain) NewQueryHandlers

func (d *Domain) NewQueryHandlers() ports.IncomingQueryHandlers

NewQueryHandlers ...

func (*Domain) Start

func (d *Domain) Start(ctx context.Context) error

Start will start the domain object, and in turn start all the async adapters

type EventPortImpl

type EventPortImpl struct {
	Storage            ports.PersistentStoragePort
	TemplateSource     ports.TemplateSourcePort
	Credential         ports.CredentialPort
	TimeSrc            ports.TimeSrc
	IDGenerator        func() common.ID
	VersionIDGenerator func() common.ID
}

EventPortImpl implements IncomingEventPort

func (*EventPortImpl) TemplateCustomFieldTypeCreateRequestedEvent

func (d *EventPortImpl) TemplateCustomFieldTypeCreateRequestedEvent(createRequest cacao_common_service.TemplateCustomFieldTypeModel, sink ports.OutgoingEventPort) error

TemplateCustomFieldTypeCreateRequestedEvent creates a template custom field type

func (*EventPortImpl) TemplateCustomFieldTypeDeleteRequestedEvent

func (d *EventPortImpl) TemplateCustomFieldTypeDeleteRequestedEvent(deleteRequest cacao_common_service.TemplateCustomFieldTypeModel, sink ports.OutgoingEventPort) error

TemplateCustomFieldTypeDeleteRequestedEvent deletes the template custom field type

func (*EventPortImpl) TemplateCustomFieldTypeUpdateRequestedEvent

func (d *EventPortImpl) TemplateCustomFieldTypeUpdateRequestedEvent(updateRequest cacao_common_service.TemplateCustomFieldTypeModel, sink ports.OutgoingEventPort) error

TemplateCustomFieldTypeUpdateRequestedEvent updates the template custom field type

func (*EventPortImpl) TemplateDeleteRequestedEvent

func (d *EventPortImpl) TemplateDeleteRequestedEvent(deleteRequest cacao_common_service.TemplateModel, sink ports.OutgoingEventPort) error

TemplateDeleteRequestedEvent deletes the template

func (*EventPortImpl) TemplateDisableVersionEvent

func (d *EventPortImpl) TemplateDisableVersionEvent(request cacao_common_service.TemplateVersionDisableRequest, sink ports.OutgoingEventPort) error

TemplateDisableVersionEvent marks a version as disabled.

func (*EventPortImpl) TemplateImportRequestedEvent

func (d *EventPortImpl) TemplateImportRequestedEvent(importRequest cacao_common_service.TemplateModel, sink ports.OutgoingEventPort) error

TemplateImportRequestedEvent imports a template

func (*EventPortImpl) TemplateSyncRequestedEvent

func (d *EventPortImpl) TemplateSyncRequestedEvent(syncRequest cacao_common_service.TemplateModel, sink ports.OutgoingEventPort) error

TemplateSyncRequestedEvent syncs the template

- Check template existence & permission

- Import from source (git)

- Compare with latest version of the template in DB,

- If same version, emit Sync success event

- If not same version, create new version in DB, update LatestVersionID of the template object in DB, then emit sync success event

func (*EventPortImpl) TemplateTypeCreateRequestedEvent

func (d *EventPortImpl) TemplateTypeCreateRequestedEvent(createRequest cacao_common_service.TemplateTypeModel, sink ports.OutgoingEventPort) error

TemplateTypeCreateRequestedEvent creates a template type

func (*EventPortImpl) TemplateTypeDeleteRequestedEvent

func (d *EventPortImpl) TemplateTypeDeleteRequestedEvent(deleteRequest cacao_common_service.TemplateTypeModel, sink ports.OutgoingEventPort) error

TemplateTypeDeleteRequestedEvent deletes the template type

func (*EventPortImpl) TemplateTypeUpdateRequestedEvent

func (d *EventPortImpl) TemplateTypeUpdateRequestedEvent(updateRequest cacao_common_service.TemplateTypeModel, sink ports.OutgoingEventPort) error

TemplateTypeUpdateRequestedEvent updates the template type

func (*EventPortImpl) TemplateUpdateRequestedEvent

func (d *EventPortImpl) TemplateUpdateRequestedEvent(updateRequest cacao_common_service.TemplateModel, sink ports.OutgoingEventPort) error

TemplateUpdateRequestedEvent updates the template

type QueryPortImpl

type QueryPortImpl struct {
	Storage                      ports.PersistentStoragePort
	TemplateCustomFieldTypeQuery ports.TemplateCustomFieldTypeQueryPort
}

QueryPortImpl implements IncomingQueryPort

func (*QueryPortImpl) Get

Get retrieves the template

func (*QueryPortImpl) GetCustomFieldType

GetCustomFieldType retrieves the template custom field type

func (*QueryPortImpl) GetTemplateVersion

GetTemplateVersion ...

func (*QueryPortImpl) GetType

GetType retrieves the template type

func (*QueryPortImpl) List

List retrieves all templates of the user

func (*QueryPortImpl) ListCustomFieldTypes

ListCustomFieldTypes retrieves all template custom field types of the user

func (*QueryPortImpl) ListSourceTypes

ListSourceTypes retrieves all template source types

func (*QueryPortImpl) ListTemplateVersions

ListTemplateVersions lists all versions for a template (specified by template ID). TODO consider pagination/streaming of results.

func (*QueryPortImpl) ListTypes

ListTypes retrieves all template types

func (*QueryPortImpl) ListTypesForProviderType

ListTypesForProviderType retrieves all template types for the given provider type

func (*QueryPortImpl) QueryCustomFieldType

QueryCustomFieldType retrieves the template custom field type and query to the target

Jump to

Keyboard shortcuts

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