Documentation ¶
Index ¶
- func NewConverter() *converter
- func NewRepository(conv EntityConverter) *repository
- func NewService(repo formationConstraintRepository, ...) *service
- type ConstraintError
- type Entity
- type EntityCollection
- type EntityConverter
- type Resolver
- func (r *Resolver) CreateFormationConstraint(ctx context.Context, in graphql.FormationConstraintInput) (*graphql.FormationConstraint, error)
- func (r *Resolver) DeleteFormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error)
- func (r *Resolver) FormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error)
- func (r *Resolver) FormationConstraints(ctx context.Context) ([]*graphql.FormationConstraint, error)
- func (r *Resolver) FormationConstraintsByFormationType(ctx context.Context, formationTemplateID string) ([]*graphql.FormationConstraint, error)
- func (r *Resolver) UpdateFormationConstraint(ctx context.Context, id string, in graphql.FormationConstraintUpdateInput) (*graphql.FormationConstraint, error)
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 ¶
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 ¶
func (r *Resolver) UpdateFormationConstraint(ctx context.Context, id string, in graphql.FormationConstraintUpdateInput) (*graphql.FormationConstraint, error)
UpdateFormationConstraint updates the FormationConstraint matching ID `id` using `in`