systemssync

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter() *converter

NewConverter returns a new Converter used for conversion between repository and service representation of system sync model

func NewRepository

func NewRepository(conv EntityConverter) *repository

NewRepository creates a new SystemsSync repository

func NewService

func NewService(syncSystemsRepo SystemsSyncRepository) *service

NewService returns new SystemsSyncService

Types

type Entity

type Entity struct {
	ID                string    `db:"id"`
	TenantID          string    `db:"tenant_id"`
	ProductID         string    `db:"product_id"`
	LastSyncTimestamp time.Time `db:"last_sync_timestamp"`
}

Entity represents the systems last sync timestamps as an entity

type EntityCollection

type EntityCollection []*Entity

EntityCollection is a collection of systems last sync timestamp entities

func (EntityCollection) Len

func (a EntityCollection) Len() int

Len is implementation of a repo.Collection interface

type EntityConverter

type EntityConverter interface {
	ToEntity(in *model.SystemSynchronizationTimestamp) *Entity
	FromEntity(entity *Entity) *model.SystemSynchronizationTimestamp
}

EntityConverter converts between the service model and entity

type SystemsSyncRepository

type SystemsSyncRepository interface {
	ListByTenant(ctx context.Context, tenant string) ([]*model.SystemSynchronizationTimestamp, error)
	Upsert(ctx context.Context, in *model.SystemSynchronizationTimestamp) error
}

SystemsSyncRepository represents the Systems Sync timestamps repository layer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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