labeldef

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: 14 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) *repository

NewRepository missing godoc

func NewSchemaForFormations

func NewSchemaForFormations(formations []string) (interface{}, error)

NewSchemaForFormations returns new scenario schema with the provided formations

func NewService

func NewService(repo Repository, labelRepo LabelRepository, scenarioAssignmentLister ScenarioAssignmentLister, tenantRepo TenantRepository, uidService UIDService) *service

NewService creates new label definition service

func ParseFormationsFromSchema

func ParseFormationsFromSchema(schema *interface{}) ([]string, error)

ParseFormationsFromSchema returns available scenarios from the provided schema

Types

type Entity

type Entity struct {
	ID         string         `db:"id"`
	TenantID   string         `db:"tenant_id"`
	Key        string         `db:"key"`
	SchemaJSON sql.NullString `db:"schema"`
	Version    int            `db:"version"`
}

Entity missing godoc

type EntityCollection

type EntityCollection []Entity

EntityCollection missing godoc

func (EntityCollection) Len

func (a EntityCollection) Len() int

Len missing godoc

type EntityConverter

type EntityConverter interface {
	ToEntity(in model.LabelDefinition) (Entity, error)
	FromEntity(in Entity) (model.LabelDefinition, error)
}

EntityConverter missing godoc

type LabelRepository

type LabelRepository interface {
	GetByKey(ctx context.Context, tenant string, objectType model.LabelableObject, objectID, key string) (*model.Label, error)
	ListForObject(ctx context.Context, tenant string, objectType model.LabelableObject, objectID string) (map[string]*model.Label, error)
	ListByKey(ctx context.Context, tenant, key string) ([]*model.Label, error)
	Delete(ctx context.Context, tenant string, objectType model.LabelableObject, objectID string, key string) error
	DeleteAll(ctx context.Context, tenant string, objectType model.LabelableObject, objectID string) error
	DeleteByKey(ctx context.Context, tenant string, key string) error
}

LabelRepository missing godoc

type ModelConverter

type ModelConverter interface {
	// TODO: Use model.LabelDefinitionInput
	FromGraphQL(input graphql.LabelDefinitionInput, tenant string) (model.LabelDefinition, error)
	ToGraphQL(definition model.LabelDefinition) (graphql.LabelDefinition, error)
}

ModelConverter missing godoc

type Repository

type Repository interface {
	Create(ctx context.Context, def model.LabelDefinition) error
	Upsert(ctx context.Context, def model.LabelDefinition) error
	GetByKey(ctx context.Context, tenant string, key string) (*model.LabelDefinition, error)
	Update(ctx context.Context, def model.LabelDefinition) error
	Exists(ctx context.Context, tenant string, key string) (bool, error)
	List(ctx context.Context, tenant string) ([]model.LabelDefinition, error)
}

Repository missing godoc

type Resolver

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

Resolver missing godoc

func NewResolver

func NewResolver(transactioner persistence.Transactioner, srv Service, formationSvc formationService, conv ModelConverter) *Resolver

NewResolver missing godoc

func (*Resolver) CreateLabelDefinition

func (r *Resolver) CreateLabelDefinition(ctx context.Context, in graphql.LabelDefinitionInput) (*graphql.LabelDefinition, error)

CreateLabelDefinition missing godoc

func (*Resolver) LabelDefinition

func (r *Resolver) LabelDefinition(ctx context.Context, key string) (*graphql.LabelDefinition, error)

LabelDefinition missing godoc

func (*Resolver) LabelDefinitions

func (r *Resolver) LabelDefinitions(ctx context.Context) ([]*graphql.LabelDefinition, error)

LabelDefinitions missing godoc

func (*Resolver) UpdateLabelDefinition

func (r *Resolver) UpdateLabelDefinition(ctx context.Context, in graphql.LabelDefinitionInput) (*graphql.LabelDefinition, error)

UpdateLabelDefinition missing godoc

type ScenarioAssignmentLister

type ScenarioAssignmentLister interface {
	List(ctx context.Context, tenant string, pageSize int, cursor string) (*model.AutomaticScenarioAssignmentPage, error)
}

ScenarioAssignmentLister missing godoc

type Service

type Service interface {
	Get(ctx context.Context, tenant string, key string) (*model.LabelDefinition, error)
	List(ctx context.Context, tenant string) ([]model.LabelDefinition, error)
}

Service missing godoc

type TenantRepository

type TenantRepository interface {
	Get(ctx context.Context, id string) (*model.BusinessTenantMapping, error)
}

TenantRepository 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