spec

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter(fr FetchRequestConverter) *converter

NewConverter missing godoc

func NewRepository

func NewRepository(conv Converter) *repository

NewRepository missing godoc

func NewService

func NewService(repo SpecRepository, fetchRequestRepo FetchRequestRepository, uidService UIDService, fetchRequestService FetchRequestService) *service

NewService missing godoc

Types

type Converter

type Converter interface {
	ToEntity(in *model.Spec) *Entity
	FromEntity(in *Entity) (*model.Spec, error)
}

Converter missing godoc

type Entity

type Entity struct {
	ID            string         `db:"id"`
	APIDefID      sql.NullString `db:"api_def_id"`
	EventAPIDefID sql.NullString `db:"event_def_id"`
	CapabilityID  sql.NullString `db:"capability_def_id"`
	SpecData      sql.NullString `db:"spec_data"`

	APISpecFormat sql.NullString `db:"api_spec_format"`
	APISpecType   sql.NullString `db:"api_spec_type"`

	EventSpecFormat sql.NullString `db:"event_spec_format"`
	EventSpecType   sql.NullString `db:"event_spec_type"`

	CapabilitySpecFormat sql.NullString `db:"capability_spec_format"`
	CapabilitySpecType   sql.NullString `db:"capability_spec_type"`

	CustomType sql.NullString `db:"custom_type"`
}

Entity represents a specification 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 ID of the entity.

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 FetchRequestConverter

type FetchRequestConverter interface {
	ToGraphQL(in *model.FetchRequest) (*graphql.FetchRequest, error)
	InputFromGraphQL(in *graphql.FetchRequestInput) (*model.FetchRequestInput, error)
}

FetchRequestConverter missing godoc

type FetchRequestRepository

type FetchRequestRepository interface {
	Create(ctx context.Context, tenant string, item *model.FetchRequest) error
	CreateGlobal(ctx context.Context, item *model.FetchRequest) error
	GetByReferenceObjectID(ctx context.Context, tenant string, objectType model.FetchRequestReferenceObjectType, objectID string) (*model.FetchRequest, error)
	DeleteByReferenceObjectID(ctx context.Context, tenant string, objectType model.FetchRequestReferenceObjectType, objectID string) error
	DeleteByReferenceObjectIDGlobal(ctx context.Context, objectType model.FetchRequestReferenceObjectType, objectID string) error
	ListByReferenceObjectIDs(ctx context.Context, tenant string, objectType model.FetchRequestReferenceObjectType, objectIDs []string) ([]*model.FetchRequest, error)
	ListByReferenceObjectIDsGlobal(ctx context.Context, objectType model.FetchRequestReferenceObjectType, objectIDs []string) ([]*model.FetchRequest, error)
}

FetchRequestRepository missing godoc

type FetchRequestService

type FetchRequestService interface {
	HandleSpec(ctx context.Context, fr *model.FetchRequest) *string
}

FetchRequestService missing godoc

type SpecCollection

type SpecCollection []Entity

SpecCollection missing godoc

func (SpecCollection) Len

func (r SpecCollection) Len() int

Len missing godoc

type SpecRepository

type SpecRepository interface {
	Create(ctx context.Context, tenant string, item *model.Spec) error
	CreateGlobal(ctx context.Context, item *model.Spec) error
	GetByID(ctx context.Context, tenantID string, id string, objectType model.SpecReferenceObjectType) (*model.Spec, error)
	GetByIDGlobal(ctx context.Context, id string) (*model.Spec, error)
	ListIDByReferenceObjectID(ctx context.Context, tenant string, objectType model.SpecReferenceObjectType, objectID string) ([]string, error)
	ListIDByReferenceObjectIDGlobal(ctx context.Context, objectType model.SpecReferenceObjectType, objectID string) ([]string, error)
	ListByReferenceObjectID(ctx context.Context, tenant string, objectType model.SpecReferenceObjectType, objectID string) ([]*model.Spec, error)
	ListByReferenceObjectIDGlobal(ctx context.Context, objectType model.SpecReferenceObjectType, objectID string) ([]*model.Spec, error)
	ListByReferenceObjectIDs(ctx context.Context, tenant string, objectType model.SpecReferenceObjectType, objectIDs []string) ([]*model.Spec, error)
	Delete(ctx context.Context, tenant, id string, objectType model.SpecReferenceObjectType) error
	DeleteByReferenceObjectID(ctx context.Context, tenant string, objectType model.SpecReferenceObjectType, objectID string) error
	DeleteByReferenceObjectIDGlobal(ctx context.Context, objectType model.SpecReferenceObjectType, objectID string) error
	Update(ctx context.Context, tenant string, item *model.Spec) error
	UpdateGlobal(ctx context.Context, item *model.Spec) error
	Exists(ctx context.Context, tenantID, id string, objectType model.SpecReferenceObjectType) (bool, error)
}

SpecRepository 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