product

package
v0.0.0-...-0bf9f96 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter() *converter

NewConverter missing godoc

func NewRepository

func NewRepository(conv EntityConverter) *pgRepository

NewRepository creates a new instance of product repository

func NewService

func NewService(productRepo ProductRepository, uidService UIDService) *service

NewService creates a new instance of Product Service.

Types

type Entity

type Entity struct {
	ID                           string         `db:"id"`
	OrdID                        string         `db:"ord_id"`
	ApplicationID                sql.NullString `db:"app_id"`
	ApplicationTemplateVersionID sql.NullString `db:"app_template_version_id"`
	Title                        string         `db:"title"`
	ShortDescription             string         `db:"short_description"`
	Description                  sql.NullString `db:"description"`
	Vendor                       string         `db:"vendor"`
	Parent                       sql.NullString `db:"parent"`
	CorrelationIDs               sql.NullString `db:"correlation_ids"`
	Tags                         sql.NullString `db:"tags"`
	Labels                       sql.NullString `db:"labels"`
	DocumentationLabels          sql.NullString `db:"documentation_labels"`
}

Entity represents a product entity.

func (*Entity) DecorateWithTenantID

func (e *Entity) DecorateWithTenantID(tenant string) interface{}

DecorateWithTenantID decorates the entity with the given tenant ID.

func (*Entity) GetID

func (e *Entity) GetID() string

GetID returns the product ID.

func (*Entity) GetParent

func (e *Entity) GetParent(_ resource.Type) (resource.Type, string)

GetParent returns the parent type and the parent ID of the entity.

type EntityConverter

type EntityConverter interface {
	ToEntity(in *model.Product) *Entity
	FromEntity(entity *Entity) (*model.Product, error)
}

EntityConverter missing godoc

type ProductRepository

type ProductRepository interface {
	Create(ctx context.Context, tenant string, item *model.Product) error
	CreateGlobal(ctx context.Context, model *model.Product) error
	Update(ctx context.Context, tenant string, item *model.Product) error
	UpdateGlobal(ctx context.Context, model *model.Product) error
	Delete(ctx context.Context, tenant, id string) error
	DeleteGlobal(ctx context.Context, id string) error
	Exists(ctx context.Context, tenant, id string) (bool, error)
	GetByID(ctx context.Context, tenant, id string) (*model.Product, error)
	GetByIDGlobal(ctx context.Context, id string) (*model.Product, error)
	ListByResourceID(ctx context.Context, tenantID, appID string, resourceType resource.Type) ([]*model.Product, error)
	ListGlobal(ctx context.Context) ([]*model.Product, error)
}

ProductRepository missing godoc

type UIDService

type UIDService interface {
	Generate() string
}

UIDService missing godoc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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