service

package
v0.0.0-...-a23f117 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccessDenied = errors.New("this user doesn't have Site Portal access")

ErrAccessDenied means the user cannot access Site Portal due to missing permissions

Functions

This section is empty.

Types

type ModelDeploymentRequest

type ModelDeploymentRequest struct {
	ServiceName        string                     `json:"service_name"`
	Type               entity.ModelDeploymentType `json:"deployment_type"`
	UserParametersJson string                     `json:"parameters_json"`
	ModelUUID          string                     `json:"-"`
	FATEFlowContext    entity.FATEFlowContext     `json:"-"`
	KubeflowConfig     valueobject.KubeflowConfig `json:"-"`
}

ModelDeploymentRequest is a request to deploy a model

type ModelService

type ModelService struct {
	ModelRepo           repo.ModelRepository
	ModelDeploymentRepo repo.ModelDeploymentRepository
}

ModelService provides domain service functions to work with trained models

func (*ModelService) DeployModel

func (s *ModelService) DeployModel(request *ModelDeploymentRequest) (*entity.ModelDeployment, error)

DeployModel deploy the requested model to the requested platform

func (*ModelService) GetSupportedDeploymentType

func (s *ModelService) GetSupportedDeploymentType(modelUUID string) ([]entity.ModelDeploymentType, error)

GetSupportedDeploymentType returns a list of entity.ModelDeploymentType that the specified model can be deployed to

type ProjectService

type ProjectService struct {
	ProjectRepo     repo.ProjectRepository
	ParticipantRepo repo.ProjectParticipantRepository
	InvitationRepo  repo.ProjectInvitationRepository
	ProjectDataRepo repo.ProjectDataRepository
}

ProjectService provides domain services for the project management context We created this because we are not sure if they can be put into the "aggregate" or the "entity" package - seems they are not owned by any entity. This can be revisited in the future.

func (*ProjectService) ProcessInvitationRevocation

func (s *ProjectService) ProcessInvitationRevocation(invitationUUID string) error

ProcessInvitationRevocation removes the project and updates invitation status

func (*ProjectService) ProcessParticipantDismissal

func (s *ProjectService) ProcessParticipantDismissal(projectUUID, siteUUID string, isCurrentSite bool) error

ProcessParticipantDismissal processes participant dismissal event by updating the repo records

func (*ProjectService) ProcessParticipantUnregistration

func (s *ProjectService) ProcessParticipantUnregistration(siteUUID string, isCurrentSite bool) error

ProcessParticipantUnregistration processes participant unregistration event by update the repo records

func (*ProjectService) ProcessProjectAcceptance

func (s *ProjectService) ProcessProjectAcceptance(invitationUUID string) error

ProcessProjectAcceptance process invitation acceptance response

func (*ProjectService) ProcessProjectClosing

func (s *ProjectService) ProcessProjectClosing(projectUUID string) error

ProcessProjectClosing processes project closing event by update the repo records

func (*ProjectService) ProcessProjectRejection

func (s *ProjectService) ProcessProjectRejection(invitationUUID string) error

ProcessProjectRejection process invitation rejection response

func (*ProjectService) ProcessProjectSyncRequest

func (s *ProjectService) ProcessProjectSyncRequest(context *aggregate.ProjectSyncContext) error

ProcessProjectSyncRequest sync project info from fml manager and may updates data and participant info if needed

type ProjectSyncService

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

ProjectSyncService contains project sync status and provides methods for ensuring projects are synced TODO: we should use db data to record each project's last sync time

func NewProjectSyncService

func NewProjectSyncService() *ProjectSyncService

NewProjectSyncService returns a syncing service instance

func (*ProjectSyncService) CleanupProject

func (s *ProjectSyncService) CleanupProject(joinedProjects map[string]interface{}) error

CleanupProject remove stale project map item

func (*ProjectSyncService) EnsureProjectDataSynced

func (s *ProjectSyncService) EnsureProjectDataSynced(projectUUID string) error

EnsureProjectDataSynced makes sure the data association info in a project is synced

func (*ProjectSyncService) EnsureProjectListSynced

func (s *ProjectSyncService) EnsureProjectListSynced() error

EnsureProjectListSynced makes sure the project list is synced

func (*ProjectSyncService) EnsureProjectParticipantSynced

func (s *ProjectSyncService) EnsureProjectParticipantSynced(projectUUID string) error

EnsureProjectParticipantSynced makes sure the participants' info in a project is synced

type UserService

type UserService struct {
	Repo repo.UserRepository
}

UserService provides common services to work with entity.User

func (*UserService) LoginService

func (s *UserService) LoginService(username, password string) (*entity.User, error)

LoginService validates the provided username and password and return the user entity when succeed

Jump to

Keyboard shortcuts

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