formationconstraint

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter() *converter

NewConverter creates a new formation constraint converter

func NewRepository

func NewRepository(conv EntityConverter) *repository

NewRepository creates a new FormationConstraint repository

func NewService

func NewService(repo formationConstraintRepository, formationTemplateConstraintReferenceRepo formationTemplateConstraintReferenceRepository, uidSvc uidService, converter formationConstraintConverter) *service

NewService creates a FormationConstraint service

Types

type ConstraintError

type ConstraintError struct {
	ConstraintName string
	Reason         string
}

ConstraintError is structured error containing the name of the Constraint and the reason for the error

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the Error interface

type Entity

type Entity struct {
	ID              string     `db:"id"`
	Name            string     `db:"name"`
	Description     string     `db:"description"`
	ConstraintType  string     `db:"constraint_type"`
	TargetOperation string     `db:"target_operation"`
	Operator        string     `db:"operator"`
	ResourceType    string     `db:"resource_type"`
	ResourceSubtype string     `db:"resource_subtype"`
	InputTemplate   string     `db:"input_template"`
	ConstraintScope string     `db:"constraint_scope"`
	Priority        int        `db:"priority"`
	CreatedAt       *time.Time `db:"created_at"`
}

Entity represents the formation constraint entity

type EntityCollection

type EntityCollection []Entity

EntityCollection is a collection of formation constraint entities.

func (EntityCollection) Len

func (s EntityCollection) Len() int

Len is implementation of a repo.Collection interface

type EntityConverter

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

EntityConverter converts between the internal model and entity

type Resolver

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

Resolver is the FormationConstraint resolver

func NewResolver

func NewResolver(transact persistence.Transactioner, converter formationConstraintConverter, svc formationConstraintService) *Resolver

NewResolver creates FormationConstraint resolver

func (*Resolver) CreateFormationConstraint

func (r *Resolver) CreateFormationConstraint(ctx context.Context, in graphql.FormationConstraintInput) (*graphql.FormationConstraint, error)

CreateFormationConstraint creates a FormationConstraint using `in`

func (*Resolver) DeleteFormationConstraint

func (r *Resolver) DeleteFormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error)

DeleteFormationConstraint deletes the FormationConstraint matching ID `id`

func (*Resolver) FormationConstraint

func (r *Resolver) FormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error)

FormationConstraint queries the FormationConstraint matching ID `id`

func (*Resolver) FormationConstraints

func (r *Resolver) FormationConstraints(ctx context.Context) ([]*graphql.FormationConstraint, error)

FormationConstraints lists all FormationConstraints

func (*Resolver) FormationConstraintsByFormationType

func (r *Resolver) FormationConstraintsByFormationType(ctx context.Context, formationTemplateID string) ([]*graphql.FormationConstraint, error)

FormationConstraintsByFormationType lists all FormationConstraints for the specified FormationTemplate

func (*Resolver) UpdateFormationConstraint

UpdateFormationConstraint updates the FormationConstraint matching ID `id` using `in`

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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