usecase

package
v0.0.0-...-8b1ae4f Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveEventMessage

type ArchiveEventMessage struct {
	ID       string `json:"id"`
	ClientID string `json:"client_id"`
}

type ArchiveInteractor

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

func NewArchiveInteractor

func NewArchiveInteractor(
	archiveRepository repository.IArchiveRepository,
	eventRepository repository.IEventRepository,
	txManager ITxManager,
) *ArchiveInteractor

func (*ArchiveInteractor) CreateArchive

func (i *ArchiveInteractor) CreateArchive(
	ctx context.Context,
	request CreateArchiveInput,
	device entity.Device,
) error

CreateArchive do operation for upload archive

func (*ArchiveInteractor) GetArchive

func (i *ArchiveInteractor) GetArchive(
	ctx context.Context,
	request GetArchiveInput,
	client entity.Client,
) (GetArchiveResult, error)

GetArchive do operation for get archive

type ArchiveUseCase

type ArchiveUseCase interface {
	CreateArchive(ctx context.Context, request CreateArchiveInput, device entity.Device) error
	GetArchive(ctx context.Context, request GetArchiveInput, client entity.Client) (GetArchiveResult, error)
}

type AuthenticateRequest

type AuthenticateRequest struct {
	ID     primitive.ID
	Secret authentication.Secret
}

type AuthenticationInteractor

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

func NewAuthenticationInteractor

func NewAuthenticationInteractor(
	clientRepository repository.IClientRepository,
	deviceRepository repository.IDeviceRepository,
) *AuthenticationInteractor

func (AuthenticationInteractor) AuthenticateClient

func (i AuthenticationInteractor) AuthenticateClient(ctx context.Context, request AuthenticateRequest) error

func (AuthenticationInteractor) AuthenticateDevice

func (i AuthenticationInteractor) AuthenticateDevice(ctx context.Context, request AuthenticateRequest) error

type AuthenticationUseCase

type AuthenticationUseCase interface {
	AuthenticateClient(ctx context.Context, request AuthenticateRequest) error
	AuthenticateDevice(ctx context.Context, request AuthenticateRequest) error
}

type CreateArchiveInput

type CreateArchiveInput struct {
	ArchiveEventID primitive.ID
	ContentType    archive.ContentType
	Data           archive.Data
}

type EventInteractor

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

func NewEventInteractor

func NewEventInteractor(
	eventRepository repository.IEventRepository,
	eventHandler IEventHandler,
	txManager ITxManager,
) *EventInteractor

func (EventInteractor) PublishArchiveEvent

func (i EventInteractor) PublishArchiveEvent(ctx context.Context, client entity.Client) (primitive.ID, error)

func (EventInteractor) ReceiveArchiveEvent

func (i EventInteractor) ReceiveArchiveEvent(ctx context.Context, device entity.Device) (<-chan ArchiveEventMessage, error)

type EventUseCase

type EventUseCase interface {
	PublishArchiveEvent(ctx context.Context, client entity.Client) (primitive.ID, error)
	ReceiveArchiveEvent(ctx context.Context, device entity.Device) (<-chan ArchiveEventMessage, error)
}

type GetArchiveInput

type GetArchiveInput struct {
	ArchiveEventID primitive.ID
}

type GetArchiveResult

type GetArchiveResult struct {
	ID             primitive.ID
	ArchiveEventID primitive.ID
	ContentType    archive.ContentType
	DeviceID       primitive.ID
	Data           archive.Data
}

type IEventHandler

type IEventHandler interface {
	PublishArchiveEvent(ctx context.Context, event entity.ArchiveEvent) error
	ReceiveArchiveEvent(ctx context.Context, deviceID primitive.ID) (<-chan ArchiveEventMessage, error)
}

type ITxManager

type ITxManager interface {
	DoInTx(ctx context.Context, operation Operation) (context.Context, error)
}

type Operation

type Operation func(ctx context.Context) error

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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