formationassignment

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// TechnicalError indicates that the reason for the error is technical - for example networking issue
	TechnicalError = 1
	// ClientError indicates that the error was returned from the client
	ClientError = 2
)

Variables

This section is empty.

Functions

func GetWebhookForApplication

func GetWebhookForApplication(ctx context.Context, webhookRepo webhookRepository, tenant, appID, appTemplateID string, webhookType model.WebhookType) (*model.Webhook, error)

GetWebhookForApplication gets webhook of type webhookType for the application with ID appID If the application has webhook of type webhookType it is returned If the application does not have a webhook of type webhookType, but its application template has one it is returned If both application and application template does not have a webhook of type webhookType, no webhook is returned

func NewConverter

func NewConverter() *converter

NewConverter creates a new formation assignment converter

func NewFormationAssignmentNotificationService

func NewFormationAssignmentNotificationService(formationAssignmentRepo FormationAssignmentRepository, webhookConverter webhookConverter, webhookRepository webhookRepository, tenantRepository tenantRepository, webhookDataInputBuilder databuilder.DataInputBuilder, formationRepository formationRepository, notificationBuilder notificationBuilder, runtimeContextRepo runtimeContextRepository, labelService labelService, runtimeTypeLabelKey, applicationTypeLabelKey string) *formationAssignmentNotificationService

NewFormationAssignmentNotificationService creates formation assignment notifications service

func NewFormationAssignmentStatusService

func NewFormationAssignmentStatusService(repo FormationAssignmentRepository, constraintEngine constraintEngine, faNotificationService faNotificationService) *formationAssignmentStatusService

NewFormationAssignmentStatusService creates formation assignment status service

func NewRepository

func NewRepository(conv EntityConverter) *repository

NewRepository creates a new FormationAssignment repository

func NewService

func NewService(repo FormationAssignmentRepository, uidSvc UIDService, applicationRepository applicationRepository, runtimeRepository runtimeRepository, runtimeContextRepo runtimeContextRepository, notificationService notificationService, faNotificationService faNotificationService, labelService labelService, formationRepository formationRepository, statusService statusService, runtimeTypeLabelKey, applicationTypeLabelKey string) *service

NewService creates a FormationTemplate service

func ResetAssignmentConfigAndError

func ResetAssignmentConfigAndError(assignment *model.FormationAssignment)

ResetAssignmentConfigAndError sets the configuration and the error fields of the formation assignment to nil

Types

type AssignmentError

type AssignmentError struct {
	Message   string              `json:"message"`
	ErrorCode AssignmentErrorCode `json:"errorCode"`
}

AssignmentError error struct used for storing the errors that occur during the FormationAssignment processing

type AssignmentErrorCode

type AssignmentErrorCode int

AssignmentErrorCode represents error code used to differentiate the source of the error

type AssignmentErrorWrapper

type AssignmentErrorWrapper struct {
	Error AssignmentError `json:"error"`
}

AssignmentErrorWrapper wrapper for AssignmentError

type AssignmentMappingPair

type AssignmentMappingPair struct {
	AssignmentReqMapping        *FormationAssignmentRequestMapping
	ReverseAssignmentReqMapping *FormationAssignmentRequestMapping
}

AssignmentMappingPair represents a pair of FormationAssignmentRequestMapping and its reverse

type AssignmentMappingPairWithOperation

type AssignmentMappingPairWithOperation struct {
	*AssignmentMappingPair
	Operation model.FormationOperation
}

AssignmentMappingPairWithOperation represents an AssignmentMappingPair and the formation operation

type Entity

type Entity struct {
	ID                            string         `db:"id"`
	FormationID                   string         `db:"formation_id"`
	TenantID                      string         `db:"tenant_id"`
	Source                        string         `db:"source"`
	SourceType                    string         `db:"source_type"`
	Target                        string         `db:"target"`
	TargetType                    string         `db:"target_type"`
	State                         string         `db:"state"`
	Value                         sql.NullString `db:"value"`
	Error                         sql.NullString `db:"error"`
	LastStateChangeTimestamp      *time.Time     `db:"last_state_change_timestamp"`
	LastNotificationSentTimestamp *time.Time     `db:"last_notification_sent_timestamp"`
}

Entity represents the formation assignments entity

type EntityCollection

type EntityCollection []*Entity

EntityCollection is a collection of formation assignments 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.FormationAssignment) *Entity
	FromEntity(entity *Entity) *model.FormationAssignment
}

EntityConverter converts between the internal model and entity

type FormationAssignmentRepository

type FormationAssignmentRepository interface {
	Create(ctx context.Context, item *model.FormationAssignment) error
	GetByTargetAndSource(ctx context.Context, target, source, tenantID, formationID string) (*model.FormationAssignment, error)
	Get(ctx context.Context, id, tenantID string) (*model.FormationAssignment, error)
	GetGlobalByID(ctx context.Context, id string) (*model.FormationAssignment, error)
	GetGlobalByIDAndFormationID(ctx context.Context, id, formationID string) (*model.FormationAssignment, error)
	GetForFormation(ctx context.Context, tenantID, id, formationID string) (*model.FormationAssignment, error)
	GetAssignmentsForFormationWithStates(ctx context.Context, tenantID, formationID string, states []string) ([]*model.FormationAssignment, error)
	GetAssignmentsForFormation(ctx context.Context, tenantID, formationID string) ([]*model.FormationAssignment, error)
	GetReverseBySourceAndTarget(ctx context.Context, tenantID, formationID, sourceID, targetID string) (*model.FormationAssignment, error)
	List(ctx context.Context, pageSize int, cursor, tenantID string) (*model.FormationAssignmentPage, error)
	ListByFormationIDs(ctx context.Context, tenantID string, formationIDs []string, pageSize int, cursor string) ([]*model.FormationAssignmentPage, error)
	ListByFormationIDsNoPaging(ctx context.Context, tenantID string, formationIDs []string) ([][]*model.FormationAssignment, error)
	ListAllForObject(ctx context.Context, tenant, formationID, objectID string) ([]*model.FormationAssignment, error)
	ListAllForObjectIDs(ctx context.Context, tenant, formationID string, objectIDs []string) ([]*model.FormationAssignment, error)
	ListAllForObjectGlobal(ctx context.Context, objectID string) ([]*model.FormationAssignment, error)
	ListForIDs(ctx context.Context, tenant string, ids []string) ([]*model.FormationAssignment, error)
	Update(ctx context.Context, model *model.FormationAssignment) error
	Delete(ctx context.Context, id, tenantID string) error
	DeleteAssignmentsForObjectID(ctx context.Context, tnt, formationID, objectID string) error
	Exists(ctx context.Context, id, tenantID string) (bool, error)
}

FormationAssignmentRepository represents the Formation Assignment repository layer

type FormationAssignmentRequestMapping

type FormationAssignmentRequestMapping struct {
	Request             *webhookclient.FormationAssignmentNotificationRequest
	FormationAssignment *model.FormationAssignment
}

FormationAssignmentRequestMapping represents the mapping between the notification request and formation assignment

func (*FormationAssignmentRequestMapping) Clone

Clone returns a copy of the FormationAssignmentRequestMapping

type Resolver

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

Resolver is a formation assignment resolver

func NewResolver

func NewResolver(transact persistence.Transactioner, appRepo applicationRepo, appConverter applicationConverter, runtimeRepo runtimeRepo, runtimeConverter runtimeConverter, runtimeContextRepo runtimeContextRepo, runtimeContextConverter runtimeContextConverter) *Resolver

NewResolver is a constructor for formation assignment resolver

func (*Resolver) FormationParticipantDataLoader

func (r *Resolver) FormationParticipantDataLoader(params []dataloader.ParamFormationParticipant) ([]graphql.FormationParticipant, []error)

FormationParticipantDataLoader is a dataloader for Source and Target entities of the formation assignment

func (*Resolver) SourceEntity

SourceEntity is a resolver for the Source of the formation assignment

func (*Resolver) TargetEntity

TargetEntity is a resolver for the Target of the formation assignment

type UIDService

type UIDService interface {
	Generate() string
}

UIDService generates UUIDs for new entities

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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