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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCustomFieldTypeHandler

type CreateCustomFieldTypeHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, transactionID cacao_common.TransactionID) error

CreateCustomFieldTypeHandler is a handler for CreateCustomFieldType event

type CreateTypeHandler

type CreateTypeHandler func(actor string, emulator string, templateType types.TemplateType, transactionID cacao_common.TransactionID) error

CreateTypeHandler is a handler for CreateType event

type CredentialPort

type CredentialPort interface {
	Port

	GetTemplateSourceCredential(actor string, emulator string, credentialID string) (cacao_common_service.TemplateSourceCredential, error)
}

CredentialPort is an interface for a credential service port.

type CustomFieldTypeCreateFailedHandler

type CustomFieldTypeCreateFailedHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeCreateFailedHandler is a handler for CustomFieldTypeCreateFailed event

type CustomFieldTypeCreatedHandler

type CustomFieldTypeCreatedHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeCreatedHandler is a handler for CustomFieldTypeCreated event

type CustomFieldTypeDeleteFailedHandler

type CustomFieldTypeDeleteFailedHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeDeleteFailedHandler is a handler for CustomFieldTypeDeleteFailed event

type CustomFieldTypeDeletedHandler

type CustomFieldTypeDeletedHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeDeletedHandler is a handler for CustomFieldTypeDeleted event

type CustomFieldTypeUpdateFailedHandler

type CustomFieldTypeUpdateFailedHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeUpdateFailedHandler is a handler for CustomFieldTypeUpdateFailed event

type CustomFieldTypeUpdatedHandler

type CustomFieldTypeUpdatedHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeUpdatedHandler is a handler for CustomFieldTypeUpdated event

type DeleteCustomFieldTypeHandler

type DeleteCustomFieldTypeHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, transactionID cacao_common.TransactionID) error

DeleteCustomFieldTypeHandler is a handler for DeleteCustomFieldType event

type DeleteFailedHandler

type DeleteFailedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

DeleteFailedHandler is a handler for DeleteFailed event

type DeleteHandler

type DeleteHandler func(actor string, emulator string, template types.Template, transactionID cacao_common.TransactionID) error

DeleteHandler is a handler for Delete event

type DeleteTypeHandler

type DeleteTypeHandler func(actor string, emulator string, templateType types.TemplateType, transactionID cacao_common.TransactionID) error

DeleteTypeHandler is a handler for DeleteType event

type DeletedHandler

type DeletedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

DeletedHandler is a handler for Deleted event

type GetCustomFieldTypeHandler

type GetCustomFieldTypeHandler func(actor string, emulator string, typeName string) (types.TemplateCustomFieldType, error)

GetCustomFieldTypeHandler is a handler for GetCustomFieldType query

type GetHandler

type GetHandler func(actor string, emulator string, templateID cacao_common.ID) (types.Template, error)

GetHandler is a handler for Get query

type GetTypeHandler

type GetTypeHandler func(actor string, emulator string, typeName cacao_common_service.TemplateTypeName) (types.TemplateType, error)

GetTypeHandler is a handler for GetType query

type ImportFailedHandler

type ImportFailedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

ImportFailedHandler is a handler for ImportFailed event

type ImportHandler

type ImportHandler func(actor string, emulator string, template types.Template, credentialID string, transactionID cacao_common.TransactionID) error

ImportHandler is a handler for Import event

type ImportedHandler

type ImportedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

ImportedHandler is a handler for Imported event

type IncomingEventHandlers

type IncomingEventHandlers interface {
	// TemplateType
	TemplateTypeCreateRequestedEvent(request cacao_common_service.TemplateTypeModel, sink OutgoingEventPort) error
	TemplateTypeUpdateRequestedEvent(request cacao_common_service.TemplateTypeModel, sink OutgoingEventPort) error
	TemplateTypeDeleteRequestedEvent(request cacao_common_service.TemplateTypeModel, sink OutgoingEventPort) error

	// TemplateCustomFieldType
	TemplateCustomFieldTypeCreateRequestedEvent(request cacao_common_service.TemplateCustomFieldTypeModel, sink OutgoingEventPort) error
	TemplateCustomFieldTypeUpdateRequestedEvent(request cacao_common_service.TemplateCustomFieldTypeModel, sink OutgoingEventPort) error
	TemplateCustomFieldTypeDeleteRequestedEvent(request cacao_common_service.TemplateCustomFieldTypeModel, sink OutgoingEventPort) error

	// Template
	TemplateImportRequestedEvent(request cacao_common_service.TemplateModel, sink OutgoingEventPort) error
	TemplateUpdateRequestedEvent(request cacao_common_service.TemplateModel, sink OutgoingEventPort) error
	TemplateDeleteRequestedEvent(request cacao_common_service.TemplateModel, sink OutgoingEventPort) error
	TemplateSyncRequestedEvent(request cacao_common_service.TemplateModel, sink OutgoingEventPort) error

	// TemplateVersion
	TemplateDisableVersionEvent(request cacao_common_service.TemplateVersionDisableRequest, sink OutgoingEventPort) error
}

IncomingEventHandlers ...

type IncomingEventPort

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

IncomingEventPort is an interface for an event port.

type IncomingQueryPort

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

IncomingQueryPort is an interface for a query port.

type ListCustomFieldTypesHandler

type ListCustomFieldTypesHandler func(actor string, emulator string) ([]types.TemplateCustomFieldType, error)

ListCustomFieldTypesHandler is a handler for ListCustomFieldTypes query

type ListHandler

type ListHandler func(actor string, emulator string, includeCacaoReservedPurposes bool) ([]types.Template, error)

ListHandler is a handler for List query

type ListSourceTypesHandler

type ListSourceTypesHandler func(actor string, emulator string) ([]cacao_common_service.TemplateSourceType, error)

ListSourceTypesHandler is a handler for ListSourceTypes query

type ListTypesForProviderTypeHandler

type ListTypesForProviderTypeHandler func(actor string, emulator string, providerType cacao_common_service.TemplateProviderType) ([]types.TemplateType, error)

ListTypesForProviderTypeHandler is a handler for ListTypesForProviderType query

type ListTypesHandler

type ListTypesHandler func(actor string, emulator string) ([]types.TemplateType, error)

ListTypesHandler is a handler for ListTypes query

type MockIncomingEventPort

type MockIncomingEventPort struct {
	Config *types.Config

	// TemplateType
	CreateTypeHandler CreateTypeHandler
	UpdateTypeHandler UpdateTypeHandler
	DeleteTypeHandler DeleteTypeHandler

	// TemplateCustomFieldType
	CreateCustomFieldTypeHandler CreateCustomFieldTypeHandler
	UpdateCustomFieldTypeHandler UpdateCustomFieldTypeHandler
	DeleteCustomFieldTypeHandler DeleteCustomFieldTypeHandler

	// Template
	ImportHandler ImportHandler
	UpdateHandler UpdateHandler
	DeleteHandler DeleteHandler
	SyncHandler   SyncHandler
}

MockIncomingEventPort is a mock implementation of IncomingEventPort

func (*MockIncomingEventPort) CreateCustomFieldType

func (port *MockIncomingEventPort) CreateCustomFieldType(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, transactionID cacao_common.TransactionID) error

CreateCustomFieldType creates a template custom field type

func (*MockIncomingEventPort) CreateType

func (port *MockIncomingEventPort) CreateType(actor string, emulator string, templateType types.TemplateType, transactionID cacao_common.TransactionID) error

CreateType creates a template type

func (*MockIncomingEventPort) Delete

func (port *MockIncomingEventPort) Delete(actor string, emulator string, template types.Template, transactionID cacao_common.TransactionID) error

Delete deletes a template

func (*MockIncomingEventPort) DeleteCustomFieldType

func (port *MockIncomingEventPort) DeleteCustomFieldType(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, transactionID cacao_common.TransactionID) error

DeleteCustomFieldType deletes a template custom field type

func (*MockIncomingEventPort) DeleteType

func (port *MockIncomingEventPort) DeleteType(actor string, emulator string, templateType types.TemplateType, transactionID cacao_common.TransactionID) error

DeleteType deletes a template type

func (*MockIncomingEventPort) Finalize

func (port *MockIncomingEventPort) Finalize()

Finalize finalizes the port

func (*MockIncomingEventPort) Import

func (port *MockIncomingEventPort) Import(actor string, emulator string, template types.Template, credentialID string, transactionID cacao_common.TransactionID) error

Import imports a template

func (*MockIncomingEventPort) Init

func (port *MockIncomingEventPort) Init(config *types.Config)

Init inits the port

func (*MockIncomingEventPort) InitChannel

func (port *MockIncomingEventPort) InitChannel(channel chan types.TemplateChannelRequest)

InitChannel inits a channel

func (*MockIncomingEventPort) SetCreateCustomFieldTypeHandler

func (port *MockIncomingEventPort) SetCreateCustomFieldTypeHandler(createCustomFieldTypeHandler CreateCustomFieldTypeHandler)

SetCreateCustomFieldTypeHandler sets a handler for CreateCustomFieldType event

func (*MockIncomingEventPort) SetCreateTypeHandler

func (port *MockIncomingEventPort) SetCreateTypeHandler(createTypeHandler CreateTypeHandler)

SetCreateTypeHandler sets a handler for CreateType event

func (*MockIncomingEventPort) SetDeleteCustomFieldTypeHandler

func (port *MockIncomingEventPort) SetDeleteCustomFieldTypeHandler(deleteCustomFieldTypeHandler DeleteCustomFieldTypeHandler)

SetDeleteCustomFieldTypeHandler sets a handler for DeleteCustomFieldType event

func (*MockIncomingEventPort) SetDeleteHandler

func (port *MockIncomingEventPort) SetDeleteHandler(deleteHandler DeleteHandler)

SetDeleteHandler sets a handler for Delete event

func (*MockIncomingEventPort) SetDeleteTypeHandler

func (port *MockIncomingEventPort) SetDeleteTypeHandler(deleteTypeHandler DeleteTypeHandler)

SetDeleteTypeHandler sets a handler for DeleteType event

func (*MockIncomingEventPort) SetImportHandler

func (port *MockIncomingEventPort) SetImportHandler(importHandler ImportHandler)

SetImportHandler sets a handler for Import event

func (*MockIncomingEventPort) SetSyncHandler

func (port *MockIncomingEventPort) SetSyncHandler(syncHandler SyncHandler)

SetSyncHandler sets a handler for Sync event

func (*MockIncomingEventPort) SetUpdateCustomFieldTypeHandler

func (port *MockIncomingEventPort) SetUpdateCustomFieldTypeHandler(updateCustomFieldTypeHandler UpdateCustomFieldTypeHandler)

SetUpdateCustomFieldTypeHandler sets a handler for UpdateCustomFieldType event

func (*MockIncomingEventPort) SetUpdateHandler

func (port *MockIncomingEventPort) SetUpdateHandler(updateHandler UpdateHandler)

SetUpdateHandler sets a handler for Update event

func (*MockIncomingEventPort) SetUpdateTypeHandler

func (port *MockIncomingEventPort) SetUpdateTypeHandler(updateTypeHandler UpdateTypeHandler)

SetUpdateTypeHandler sets a handler for UpdateType event

func (*MockIncomingEventPort) Start

func (port *MockIncomingEventPort) Start()

Start starts the port

func (*MockIncomingEventPort) Sync

func (port *MockIncomingEventPort) Sync(actor string, emulator string, template types.Template, credentialID string, transactionID cacao_common.TransactionID) error

Sync syncs a template

func (*MockIncomingEventPort) Update

func (port *MockIncomingEventPort) Update(actor string, emulator string, template types.Template, updateFieldNames []string, transactionID cacao_common.TransactionID) error

Update updates a template

func (*MockIncomingEventPort) UpdateCustomFieldType

func (port *MockIncomingEventPort) UpdateCustomFieldType(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, updateFieldNames []string, transactionID cacao_common.TransactionID) error

UpdateCustomFieldType updates a template custom field type

func (*MockIncomingEventPort) UpdateType

func (port *MockIncomingEventPort) UpdateType(actor string, emulator string, templateType types.TemplateType, updateFieldNames []string, transactionID cacao_common.TransactionID) error

UpdateType updates a template type

type MockIncomingQueryPort

type MockIncomingQueryPort struct {
	Config *types.Config

	// TemplateType
	ListTypesHandler                ListTypesHandler
	ListTypesForProviderTypeHandler ListTypesForProviderTypeHandler
	GetTypeHandler                  GetTypeHandler

	// TemplateSourceType
	ListSourceTypesHandler ListSourceTypesHandler

	// TemplateCustomFieldType
	ListCustomFieldTypesHandler ListCustomFieldTypesHandler
	GetCustomFieldTypeHandler   GetCustomFieldTypeHandler
	QueryCustomFieldTypeHandler QueryCustomFieldTypeHandler

	// Template
	ListHandler ListHandler
	GetHandler  GetHandler
}

MockIncomingQueryPort is a mock implementation of IncomingQueryPort

func (*MockIncomingQueryPort) Finalize

func (port *MockIncomingQueryPort) Finalize()

Finalize finalizes the port

func (*MockIncomingQueryPort) Get

func (port *MockIncomingQueryPort) Get(actor string, emulator string, templateID cacao_common.ID) (types.Template, error)

Get returns a template

func (*MockIncomingQueryPort) GetCustomFieldType

func (port *MockIncomingQueryPort) GetCustomFieldType(actor string, emulator string, typeName string) (types.TemplateCustomFieldType, error)

GetCustomFieldType returns a template custom field type

func (*MockIncomingQueryPort) GetType

GetType returns a template type

func (*MockIncomingQueryPort) Init

func (port *MockIncomingQueryPort) Init(config *types.Config)

Init inits the port

func (*MockIncomingQueryPort) InitChannel

func (port *MockIncomingQueryPort) InitChannel(channel chan types.TemplateChannelRequest)

InitChannel inits a channel

func (*MockIncomingQueryPort) List

func (port *MockIncomingQueryPort) List(actor string, emulator string, includeCacaoReservedPurposes bool) ([]types.Template, error)

List lists templates

func (*MockIncomingQueryPort) ListCustomFieldTypes

func (port *MockIncomingQueryPort) ListCustomFieldTypes(actor string, emulator string) ([]types.TemplateCustomFieldType, error)

ListCustomFieldTypes lists template custom field types

func (*MockIncomingQueryPort) ListSourceTypes

func (port *MockIncomingQueryPort) ListSourceTypes(actor string, emulator string) ([]cacao_common_service.TemplateSourceType, error)

ListSourceTypes lists template types

func (*MockIncomingQueryPort) ListTypes

func (port *MockIncomingQueryPort) ListTypes(actor string, emulator string) ([]types.TemplateType, error)

ListTypes lists template types

func (*MockIncomingQueryPort) ListTypesForProviderType

func (port *MockIncomingQueryPort) ListTypesForProviderType(actor string, emulator string, providerType cacao_common_service.TemplateProviderType) ([]types.TemplateType, error)

ListTypesForProviderType lists template types for the given provider type

func (*MockIncomingQueryPort) QueryCustomFieldType

func (port *MockIncomingQueryPort) QueryCustomFieldType(actor string, emulator string, typeName string, queryParams map[string]string) (types.TemplateCustomFieldTypeQueryResult, error)

QueryCustomFieldType returns a template custom field type query result

func (*MockIncomingQueryPort) SetGetCustomFieldTypeHandler

func (port *MockIncomingQueryPort) SetGetCustomFieldTypeHandler(getCustomFieldTypeHandler GetCustomFieldTypeHandler)

SetGetCustomFieldTypeHandler sets a handler for GetCustomFieldType query

func (*MockIncomingQueryPort) SetGetHandler

func (port *MockIncomingQueryPort) SetGetHandler(getHandler GetHandler)

SetGetHandler sets a handler for Get query

func (*MockIncomingQueryPort) SetGetTypeHandler

func (port *MockIncomingQueryPort) SetGetTypeHandler(getTypeHandler GetTypeHandler)

SetGetTypeHandler sets a handler for GetType query

func (*MockIncomingQueryPort) SetListCustomFieldTypesHandler

func (port *MockIncomingQueryPort) SetListCustomFieldTypesHandler(listCustomFieldTypesHandler ListCustomFieldTypesHandler)

SetListCustomFieldTypesHandler sets a handler for ListCustomFieldTypes query

func (*MockIncomingQueryPort) SetListHandler

func (port *MockIncomingQueryPort) SetListHandler(listHandler ListHandler)

SetListHandler sets a handler for List query

func (*MockIncomingQueryPort) SetListSourceTypesHandler

func (port *MockIncomingQueryPort) SetListSourceTypesHandler(listSourceTypesHandler ListSourceTypesHandler)

SetListSourceTypesHandler sets a handler for ListSourceTypes query

func (*MockIncomingQueryPort) SetListTypesForProviderTypeHandler

func (port *MockIncomingQueryPort) SetListTypesForProviderTypeHandler(listTypesForProviderTypeHandler ListTypesForProviderTypeHandler)

SetListTypesForProviderTypeHandler sets a handler for ListTypesForProviderType query

func (*MockIncomingQueryPort) SetListTypesHandler

func (port *MockIncomingQueryPort) SetListTypesHandler(listTypesHandler ListTypesHandler)

SetListTypesHandler sets a handler for ListTypes query

func (*MockIncomingQueryPort) SetQueryCustomFieldTypeHandler

func (port *MockIncomingQueryPort) SetQueryCustomFieldTypeHandler(queryCustomFieldTypeHandler QueryCustomFieldTypeHandler)

SetQueryCustomFieldTypeHandler sets a handler for QueryCustomFieldType query

func (*MockIncomingQueryPort) Start

func (port *MockIncomingQueryPort) Start()

Start starts the port

type MockOutgoingEventPort

type MockOutgoingEventPort struct {
	Config *types.Config

	// TemplateType
	TypeCreatedHandler      TypeCreatedHandler
	TypeCreateFailedHandler TypeCreateFailedHandler
	TypeUpdatedHandler      TypeUpdatedHandler
	TypeUpdateFailedHandler TypeUpdateFailedHandler
	TypeDeletedHandler      TypeDeletedHandler
	TypeDeleteFailedHandler TypeDeleteFailedHandler

	// TemplateCustomFieldType
	CustomFieldTypeCreatedHandler      CustomFieldTypeCreatedHandler
	CustomFieldTypeCreateFailedHandler CustomFieldTypeCreateFailedHandler
	CustomFieldTypeUpdatedHandler      CustomFieldTypeUpdatedHandler
	CustomFieldTypeUpdateFailedHandler CustomFieldTypeUpdateFailedHandler
	CustomFieldTypeDeletedHandler      CustomFieldTypeDeletedHandler
	CustomFieldTypeDeleteFailedHandler CustomFieldTypeDeleteFailedHandler

	// Template
	ImportedHandler     ImportedHandler
	ImportFailedHandler ImportFailedHandler
	UpdatedHandler      UpdatedHandler
	UpdateFailedHandler UpdateFailedHandler
	DeletedHandler      DeletedHandler
	DeleteFailedHandler DeleteFailedHandler
	SyncedHandler       SyncedHandler
	SyncFailedHandler   SyncFailedHandler
}

MockOutgoingEventPort is a mock implementation of OutgoingEventPort

func (*MockOutgoingEventPort) CustomFieldTypeCreateFailed

func (port *MockOutgoingEventPort) CustomFieldTypeCreateFailed(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeCreateFailed creates an event for template custom field type creation failure

func (*MockOutgoingEventPort) CustomFieldTypeCreated

func (port *MockOutgoingEventPort) CustomFieldTypeCreated(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeCreated creates an event for template custom field type creation

func (*MockOutgoingEventPort) CustomFieldTypeDeleteFailed

func (port *MockOutgoingEventPort) CustomFieldTypeDeleteFailed(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeDeleteFailed creates an event for template custom field type deletion failure

func (*MockOutgoingEventPort) CustomFieldTypeDeleted

func (port *MockOutgoingEventPort) CustomFieldTypeDeleted(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeDeleted creates an event for template custom field type deletion

func (*MockOutgoingEventPort) CustomFieldTypeUpdateFailed

func (port *MockOutgoingEventPort) CustomFieldTypeUpdateFailed(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeUpdateFailed creates an event for template custom field type update failure

func (*MockOutgoingEventPort) CustomFieldTypeUpdated

func (port *MockOutgoingEventPort) CustomFieldTypeUpdated(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

CustomFieldTypeUpdated creates an event for template custom field type update

func (*MockOutgoingEventPort) DeleteFailed

func (port *MockOutgoingEventPort) DeleteFailed(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

DeleteFailed creates an event for template deletion failure

func (*MockOutgoingEventPort) Deleted

func (port *MockOutgoingEventPort) Deleted(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

Deleted creates an event for template deletion

func (*MockOutgoingEventPort) Finalize

func (port *MockOutgoingEventPort) Finalize()

Finalize finalizes the port

func (*MockOutgoingEventPort) ImportFailed

func (port *MockOutgoingEventPort) ImportFailed(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

ImportFailed creates an event for template import failure

func (*MockOutgoingEventPort) Imported

func (port *MockOutgoingEventPort) Imported(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

Imported creates an event for template import

func (*MockOutgoingEventPort) Init

func (port *MockOutgoingEventPort) Init(config *types.Config)

Init inits the port

func (*MockOutgoingEventPort) SetCustomFieldTypeCreateFailedHandler

func (port *MockOutgoingEventPort) SetCustomFieldTypeCreateFailedHandler(customFieldTypeCreateFailedHandler CustomFieldTypeCreateFailedHandler)

SetCustomFieldTypeCreateFailedHandler sets a handler for CustomFieldTypeCreateFailed event

func (*MockOutgoingEventPort) SetCustomFieldTypeCreatedHandler

func (port *MockOutgoingEventPort) SetCustomFieldTypeCreatedHandler(customFieldTypeCreatedHandler CustomFieldTypeCreatedHandler)

SetCustomFieldTypeCreatedHandler sets a handler for CustomFieldTypeCreated event

func (*MockOutgoingEventPort) SetCustomFieldTypeDeleteFailedHandler

func (port *MockOutgoingEventPort) SetCustomFieldTypeDeleteFailedHandler(customFieldTypeDeleteFailedHandler CustomFieldTypeDeleteFailedHandler)

SetCustomFieldTypeDeleteFailedHandler sets a handler for CustomFieldTypeDeleteFailed event

func (*MockOutgoingEventPort) SetCustomFieldTypeDeletedHandler

func (port *MockOutgoingEventPort) SetCustomFieldTypeDeletedHandler(customFieldTypeDeletedHandler CustomFieldTypeDeletedHandler)

SetCustomFieldTypeDeletedHandler sets a handler for CustomFieldTypeDeleted event

func (*MockOutgoingEventPort) SetCustomFieldTypeUpdateFailedHandler

func (port *MockOutgoingEventPort) SetCustomFieldTypeUpdateFailedHandler(customFieldTypeUpdateFailedHandler CustomFieldTypeUpdateFailedHandler)

SetCustomFieldTypeUpdateFailedHandler sets a handler for CustomFieldTypeUpdateFailed event

func (*MockOutgoingEventPort) SetCustomFieldTypeUpdatedHandler

func (port *MockOutgoingEventPort) SetCustomFieldTypeUpdatedHandler(customFieldTypeUpdatedHandler CustomFieldTypeUpdatedHandler)

SetCustomFieldTypeUpdatedHandler sets a handler for CustomFieldTypeUpdated event

func (*MockOutgoingEventPort) SetDeleteFailedHandler

func (port *MockOutgoingEventPort) SetDeleteFailedHandler(deleteFailedHandler DeleteFailedHandler)

SetDeleteFailedHandler sets a handler for DeleteFailed event

func (*MockOutgoingEventPort) SetDeletedHandler

func (port *MockOutgoingEventPort) SetDeletedHandler(deletedHandler DeletedHandler)

SetDeletedHandler sets a handler for Deleted event

func (*MockOutgoingEventPort) SetImportFailedHandler

func (port *MockOutgoingEventPort) SetImportFailedHandler(importFailedHandler ImportFailedHandler)

SetImportFailedHandler sets a handler for ImportFailed event

func (*MockOutgoingEventPort) SetImportedHandler

func (port *MockOutgoingEventPort) SetImportedHandler(importedHandler ImportedHandler)

SetImportedHandler sets a handler for Imported event

func (*MockOutgoingEventPort) SetSyncFailedHandler

func (port *MockOutgoingEventPort) SetSyncFailedHandler(syncFailedHandler SyncFailedHandler)

SetSyncFailedHandler sets a handler for SyncFailed event

func (*MockOutgoingEventPort) SetSyncedHandler

func (port *MockOutgoingEventPort) SetSyncedHandler(syncedHandler SyncedHandler)

SetSyncedHandler sets a handler for Synced event

func (*MockOutgoingEventPort) SetTypeCreateFailedHandler

func (port *MockOutgoingEventPort) SetTypeCreateFailedHandler(typeCreateFailedHandler TypeCreateFailedHandler)

SetTypeCreateFailedHandler sets a handler for TypeCreateFailed event

func (*MockOutgoingEventPort) SetTypeCreatedHandler

func (port *MockOutgoingEventPort) SetTypeCreatedHandler(typeCreatedHandler TypeCreatedHandler)

SetTypeCreatedHandler sets a handler for TypeCreated event

func (*MockOutgoingEventPort) SetTypeDeleteFailedHandler

func (port *MockOutgoingEventPort) SetTypeDeleteFailedHandler(typeDeleteFailedHandler TypeDeleteFailedHandler)

SetTypeDeleteFailedHandler sets a handler for TypeDeleteFailed event

func (*MockOutgoingEventPort) SetTypeDeletedHandler

func (port *MockOutgoingEventPort) SetTypeDeletedHandler(typeDeletedHandler TypeDeletedHandler)

SetTypeDeletedHandler sets a handler for TypeDeleted event

func (*MockOutgoingEventPort) SetTypeUpdateFailedHandler

func (port *MockOutgoingEventPort) SetTypeUpdateFailedHandler(typeUpdateFailedHandler TypeUpdateFailedHandler)

SetTypeUpdateFailedHandler sets a handler for TypeUpdateFailed event

func (*MockOutgoingEventPort) SetTypeUpdatedHandler

func (port *MockOutgoingEventPort) SetTypeUpdatedHandler(typeUpdatedHandler TypeUpdatedHandler)

SetTypeUpdatedHandler sets a handler for TypeUpdated event

func (*MockOutgoingEventPort) SetUpdateFailedHandler

func (port *MockOutgoingEventPort) SetUpdateFailedHandler(updateFailedHandler UpdateFailedHandler)

SetUpdateFailedHandler sets a handler for UpdateFailed event

func (*MockOutgoingEventPort) SetUpdatedHandler

func (port *MockOutgoingEventPort) SetUpdatedHandler(updatedHandler UpdatedHandler)

SetUpdatedHandler sets a handler for Updated event

func (*MockOutgoingEventPort) SyncFailed

func (port *MockOutgoingEventPort) SyncFailed(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

SyncFailed creates an event for template sync failure

func (*MockOutgoingEventPort) Synced

func (port *MockOutgoingEventPort) Synced(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

Synced creates an event for template sync succeeded

func (*MockOutgoingEventPort) TypeCreateFailed

func (port *MockOutgoingEventPort) TypeCreateFailed(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeCreateFailed creates an event for template type creation failure

func (*MockOutgoingEventPort) TypeCreated

func (port *MockOutgoingEventPort) TypeCreated(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeCreated creates an event for template type creation

func (*MockOutgoingEventPort) TypeDeleteFailed

func (port *MockOutgoingEventPort) TypeDeleteFailed(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeDeleteFailed creates an event for template type deletion failure

func (*MockOutgoingEventPort) TypeDeleted

func (port *MockOutgoingEventPort) TypeDeleted(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeDeleted creates an event for template type deletion

func (*MockOutgoingEventPort) TypeUpdateFailed

func (port *MockOutgoingEventPort) TypeUpdateFailed(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeUpdateFailed creates an event for template type update failure

func (*MockOutgoingEventPort) TypeUpdated

func (port *MockOutgoingEventPort) TypeUpdated(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeUpdated creates an event for template type update

func (*MockOutgoingEventPort) UpdateFailed

func (port *MockOutgoingEventPort) UpdateFailed(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

UpdateFailed creates an event for template update failure

func (*MockOutgoingEventPort) Updated

func (port *MockOutgoingEventPort) Updated(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

Updated creates an event for template update

type OutgoingEventPort

type OutgoingEventPort interface {

	// TemplateType
	TypeCreated(actor cacao_common_service.Actor, templateType types.TemplateType)
	TypeCreateFailed(actor cacao_common_service.Actor, templateType types.TemplateType, creationError cacao_common_service.CacaoError)
	TypeUpdated(actor cacao_common_service.Actor, templateType types.TemplateType)
	TypeUpdateFailed(actor cacao_common_service.Actor, templateType types.TemplateType, updateError cacao_common_service.CacaoError)
	TypeDeleted(actor cacao_common_service.Actor, templateType types.TemplateType)
	TypeDeleteFailed(actor cacao_common_service.Actor, templateType types.TemplateType, deletionError cacao_common_service.CacaoError)

	// TemplateCustomFieldType
	CustomFieldTypeCreated(actor cacao_common_service.Actor, templateCustomFieldType types.TemplateCustomFieldType)
	CustomFieldTypeCreateFailed(actor cacao_common_service.Actor, templateCustomFieldType types.TemplateCustomFieldType, creationError cacao_common_service.CacaoError)
	CustomFieldTypeUpdated(actor cacao_common_service.Actor, templateCustomFieldType types.TemplateCustomFieldType)
	CustomFieldTypeUpdateFailed(actor cacao_common_service.Actor, templateCustomFieldType types.TemplateCustomFieldType, updateError cacao_common_service.CacaoError)
	CustomFieldTypeDeleted(actor cacao_common_service.Actor, templateCustomFieldType types.TemplateCustomFieldType)
	CustomFieldTypeDeleteFailed(actor cacao_common_service.Actor, templateCustomFieldType types.TemplateCustomFieldType, deletionError cacao_common_service.CacaoError)

	// Template
	Imported(actor cacao_common_service.Actor, template types.Template)
	ImportFailed(actor cacao_common_service.Actor, template types.Template, importError cacao_common_service.CacaoError)
	Updated(actor cacao_common_service.Actor, template types.Template)
	UpdateFailed(actor cacao_common_service.Actor, template types.Template, updateError cacao_common_service.CacaoError)
	Deleted(actor cacao_common_service.Actor, template types.Template)
	DeleteFailed(actor cacao_common_service.Actor, template types.Template, deletionError cacao_common_service.CacaoError)
	Synced(actor cacao_common_service.Actor, template types.Template)
	SyncFailed(actor cacao_common_service.Actor, template types.Template, syncError cacao_common_service.CacaoError)

	// TemplateVersion
	VersionDisabled(actor cacao_common_service.Actor, version types.TemplateVersion)
	VersionDisableFailed(actor cacao_common_service.Actor, version types.TemplateVersion, versionErr cacao_common_service.CacaoError)
}

OutgoingEventPort ...

type PersistentStoragePort

type PersistentStoragePort interface {
	Port

	// TemplateType
	ListTypes() ([]types.TemplateType, error)
	ListTypesForProviderType(providerType cacao_common_service.TemplateProviderType) ([]types.TemplateType, error)
	GetType(templateTypeName cacao_common_service.TemplateTypeName) (types.TemplateType, error)
	CreateType(templateType types.TemplateType) error
	UpdateType(templateType types.TemplateType, updateFieldNames []string) error
	DeleteType(templateTypeName cacao_common_service.TemplateTypeName) error

	// TemplateCustomFieldType
	ListCustomFieldTypes() ([]types.TemplateCustomFieldType, error)
	GetCustomFieldType(customFieldTypeName string) (types.TemplateCustomFieldType, error)
	CreateCustomFieldType(templateCustomFieldType types.TemplateCustomFieldType) error
	UpdateCustomFieldType(templateCustomFieldType types.TemplateCustomFieldType, updateFieldNames []string) error
	DeleteCustomFieldType(customFieldTypeName string) error

	// Template
	List(user string, includeCacaoReservedPurposes bool) ([]types.Template, error)
	Get(user string, templateID cacao_common.ID) (types.Template, error)
	Create(template types.Template) error
	Update(template types.Template, updateFieldNames []string) error
	TemplateSyncStart(templateID cacao_common.ID) (syncLockAcquired bool, err error)
	TemplateSyncFinished(templateID cacao_common.ID) error
	SoftDelete(user string, templateID cacao_common.ID) error

	// TemplateVersion
	ListVersions(user string, templateID cacao_common.ID) ([]types.TemplateVersion, error)
	GetVersion(user string, versionID cacao_common.ID) (types.TemplateVersion, error)
	CreateVersion(version types.TemplateVersion) error
	DisableVersion(versionID cacao_common.ID) (time.Time, error)
}

PersistentStoragePort is an interface for a Persistent Storage port. Implementation of PersistentStoragePort is also responsible for authorization check.

User can only read the template they owned and templates that are public, and user can only modify (update/delete/sync) templates that they owned.

type Port

type Port interface {
	Init(config *types.Config) error
}

Port is a special type of port that will has an asynchronous behavior to it, such as being event-driven outside of the primary domain thread (e.g. incoming message queues). This ports should communicate with the domain object using a threaded approach (i.e. go routine, go channels and possibly waitgroups)

type QueryCustomFieldTypeHandler

type QueryCustomFieldTypeHandler func(actor string, emulator string, typeName string, queryParams map[string]string) (types.TemplateCustomFieldTypeQueryResult, error)

QueryCustomFieldTypeHandler is a handler for QueryCustomFieldType query

type SyncFailedHandler

type SyncFailedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

SyncFailedHandler is a handler for SyncFailed event

type SyncHandler

type SyncHandler func(actor string, emulator string, template types.Template, credentialID string, transactionID cacao_common.TransactionID) error

SyncHandler is a handler for Sync event

type SyncedHandler

type SyncedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

SyncedHandler is a handler for Synced event

type TemplateCustomFieldTypeQueryPort

type TemplateCustomFieldTypeQueryPort interface {
	Port

	QueryTemplateCustomFieldType(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, queryParams map[string]string) (types.TemplateCustomFieldTypeQueryResult, error)
}

TemplateCustomFieldTypeQueryPort is an interface for a template custom field type query port.

type TemplateSourcePort

TemplateSourcePort is an interface for a template source port.

type TimeSrc

type TimeSrc interface {
	Now() time.Time
}

TimeSrc is a source of current time.

type TypeCreateFailedHandler

type TypeCreateFailedHandler func(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeCreateFailedHandler is a handler for TypeCreateFailed event

type TypeCreatedHandler

type TypeCreatedHandler func(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeCreatedHandler is a handler for TypeCreated event

type TypeDeleteFailedHandler

type TypeDeleteFailedHandler func(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeDeleteFailedHandler is a handler for TypeDeleteFailed event

type TypeDeletedHandler

type TypeDeletedHandler func(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeDeletedHandler is a handler for TypeDeleted event

type TypeUpdateFailedHandler

type TypeUpdateFailedHandler func(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeUpdateFailedHandler is a handler for TypeUpdateFailed event

type TypeUpdatedHandler

type TypeUpdatedHandler func(actor string, emulator string, templateType types.TemplateType, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

TypeUpdatedHandler is a handler for TypeUpdated event

type UpdateCustomFieldTypeHandler

type UpdateCustomFieldTypeHandler func(actor string, emulator string, templateCustomFieldType types.TemplateCustomFieldType, updateFieldNames []string, transactionID cacao_common.TransactionID) error

UpdateCustomFieldTypeHandler is a handler for UpdateCustomFieldType event

type UpdateFailedHandler

type UpdateFailedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

UpdateFailedHandler is a handler for UpdateFailed event

type UpdateHandler

type UpdateHandler func(actor string, emulator string, template types.Template, updateFieldNames []string, transactionID cacao_common.TransactionID) error

UpdateHandler is a handler for Update event

type UpdateTypeHandler

type UpdateTypeHandler func(actor string, emulator string, templateType types.TemplateType, updateFieldNames []string, transactionID cacao_common.TransactionID) error

UpdateTypeHandler is a handler for UpdateType event

type UpdatedHandler

type UpdatedHandler func(actor string, emulator string, template types.Template, status cacao_common.HTTPStatus, transactionID cacao_common.TransactionID) error

UpdatedHandler is a handler for Updated event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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