service

package
v2.0.7-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// V1PreheatingStatePending is the preheating is waiting for starting
	V1PreheatingStatePending = "WAITING"

	// V1PreheatingStateRunning is the preheating is running
	V1PreheatingStateRunning = "RUNNING"

	// V1PreheatingStateSuccess is the preheating is success
	V1PreheatingStateSuccess = "SUCCESS"

	// V1PreheatingStateFail is the preheating is failed
	V1PreheatingStateFail = "FAIL"
)

Variables

View Source
var ErrObjectStorageDisabled = errors.New("object storage is disabled")

Functions

This section is empty.

Types

type Service added in v2.0.2

type Service interface {
	UpdateUser(context.Context, uint, types.UpdateUserRequest) (*model.User, error)
	GetUser(context.Context, uint) (*model.User, error)
	GetUsers(context.Context, types.GetUsersQuery) ([]model.User, int64, error)
	SignIn(context.Context, types.SignInRequest) (*model.User, error)
	SignUp(context.Context, types.SignUpRequest) (*model.User, error)
	OauthSignin(context.Context, string) (string, error)
	OauthSigninCallback(context.Context, string, string) (*model.User, error)
	ResetPassword(context.Context, uint, types.ResetPasswordRequest) error
	GetRolesForUser(context.Context, uint) ([]string, error)
	AddRoleForUser(context.Context, types.AddRoleForUserParams) (bool, error)
	DeleteRoleForUser(context.Context, types.DeleteRoleForUserParams) (bool, error)

	CreateRole(context.Context, types.CreateRoleRequest) error
	DestroyRole(context.Context, string) (bool, error)
	GetRole(context.Context, string) [][]string
	GetRoles(context.Context) []string
	AddPermissionForRole(context.Context, string, types.AddPermissionForRoleRequest) (bool, error)
	DeletePermissionForRole(context.Context, string, types.DeletePermissionForRoleRequest) (bool, error)

	GetPermissions(context.Context, *gin.Engine) []rbac.Permission

	CreateOauth(context.Context, types.CreateOauthRequest) (*model.Oauth, error)
	DestroyOauth(context.Context, uint) error
	UpdateOauth(context.Context, uint, types.UpdateOauthRequest) (*model.Oauth, error)
	GetOauth(context.Context, uint) (*model.Oauth, error)
	GetOauths(context.Context, types.GetOauthsQuery) ([]model.Oauth, int64, error)

	CreateSeedPeerCluster(context.Context, types.CreateSeedPeerClusterRequest) (*model.SeedPeerCluster, error)
	DestroySeedPeerCluster(context.Context, uint) error
	UpdateSeedPeerCluster(context.Context, uint, types.UpdateSeedPeerClusterRequest) (*model.SeedPeerCluster, error)
	GetSeedPeerCluster(context.Context, uint) (*model.SeedPeerCluster, error)
	GetSeedPeerClusters(context.Context, types.GetSeedPeerClustersQuery) ([]model.SeedPeerCluster, int64, error)
	AddSeedPeerToSeedPeerCluster(context.Context, uint, uint) error
	AddSchedulerClusterToSeedPeerCluster(context.Context, uint, uint) error

	CreateSeedPeer(context.Context, types.CreateSeedPeerRequest) (*model.SeedPeer, error)
	DestroySeedPeer(context.Context, uint) error
	UpdateSeedPeer(context.Context, uint, types.UpdateSeedPeerRequest) (*model.SeedPeer, error)
	GetSeedPeer(context.Context, uint) (*model.SeedPeer, error)
	GetSeedPeers(context.Context, types.GetSeedPeersQuery) ([]model.SeedPeer, int64, error)

	GetPeers(context.Context) ([]string, error)

	CreateSchedulerCluster(context.Context, types.CreateSchedulerClusterRequest) (*model.SchedulerCluster, error)
	DestroySchedulerCluster(context.Context, uint) error
	UpdateSchedulerCluster(context.Context, uint, types.UpdateSchedulerClusterRequest) (*model.SchedulerCluster, error)
	GetSchedulerCluster(context.Context, uint) (*model.SchedulerCluster, error)
	GetSchedulerClusters(context.Context, types.GetSchedulerClustersQuery) ([]model.SchedulerCluster, int64, error)
	AddSchedulerToSchedulerCluster(context.Context, uint, uint) error

	CreateScheduler(context.Context, types.CreateSchedulerRequest) (*model.Scheduler, error)
	DestroyScheduler(context.Context, uint) error
	UpdateScheduler(context.Context, uint, types.UpdateSchedulerRequest) (*model.Scheduler, error)
	GetScheduler(context.Context, uint) (*model.Scheduler, error)
	GetSchedulers(context.Context, types.GetSchedulersQuery) ([]model.Scheduler, int64, error)

	CreateSecurityRule(context.Context, types.CreateSecurityRuleRequest) (*model.SecurityRule, error)
	DestroySecurityRule(context.Context, uint) error
	UpdateSecurityRule(context.Context, uint, types.UpdateSecurityRuleRequest) (*model.SecurityRule, error)
	GetSecurityRule(context.Context, uint) (*model.SecurityRule, error)
	GetSecurityRules(context.Context, types.GetSecurityRulesQuery) ([]model.SecurityRule, int64, error)

	CreateSecurityGroup(context.Context, types.CreateSecurityGroupRequest) (*model.SecurityGroup, error)
	DestroySecurityGroup(context.Context, uint) error
	UpdateSecurityGroup(context.Context, uint, types.UpdateSecurityGroupRequest) (*model.SecurityGroup, error)
	GetSecurityGroup(context.Context, uint) (*model.SecurityGroup, error)
	GetSecurityGroups(context.Context, types.GetSecurityGroupsQuery) ([]model.SecurityGroup, int64, error)
	AddSchedulerClusterToSecurityGroup(context.Context, uint, uint) error
	AddSeedPeerClusterToSecurityGroup(context.Context, uint, uint) error
	AddSecurityRuleToSecurityGroup(context.Context, uint, uint) error
	DestroySecurityRuleToSecurityGroup(context.Context, uint, uint) error

	CreateBucket(context.Context, types.CreateBucketRequest) error
	DestroyBucket(context.Context, string) error
	GetBucket(context.Context, string) (*objectstorage.BucketMetadata, error)
	GetBuckets(context.Context) ([]*objectstorage.BucketMetadata, error)

	CreateConfig(context.Context, types.CreateConfigRequest) (*model.Config, error)
	DestroyConfig(context.Context, uint) error
	UpdateConfig(context.Context, uint, types.UpdateConfigRequest) (*model.Config, error)
	GetConfig(context.Context, uint) (*model.Config, error)
	GetConfigs(context.Context, types.GetConfigsQuery) ([]model.Config, int64, error)

	CreatePreheatJob(context.Context, types.CreatePreheatJobRequest) (*model.Job, error)
	DestroyJob(context.Context, uint) error
	UpdateJob(context.Context, uint, types.UpdateJobRequest) (*model.Job, error)
	GetJob(context.Context, uint) (*model.Job, error)
	GetJobs(context.Context, types.GetJobsQuery) ([]model.Job, int64, error)

	CreateV1Preheat(context.Context, types.CreateV1PreheatRequest) (*types.CreateV1PreheatResponse, error)
	GetV1Preheat(context.Context, string) (*types.GetV1PreheatResponse, error)

	CreateApplication(context.Context, types.CreateApplicationRequest) (*model.Application, error)
	DestroyApplication(context.Context, uint) error
	UpdateApplication(context.Context, uint, types.UpdateApplicationRequest) (*model.Application, error)
	GetApplication(context.Context, uint) (*model.Application, error)
	GetApplications(context.Context, types.GetApplicationsQuery) ([]model.Application, int64, error)
	AddSchedulerClusterToApplication(context.Context, uint, uint) error
	DeleteSchedulerClusterToApplication(context.Context, uint, uint) error
	AddSeedPeerClusterToApplication(context.Context, uint, uint) error
	DeleteSeedPeerClusterToApplication(context.Context, uint, uint) error

	CreateModel(context.Context, types.CreateModelParams, types.CreateModelRequest) (*types.Model, error)
	DestroyModel(context.Context, types.ModelParams) error
	UpdateModel(context.Context, types.ModelParams, types.UpdateModelRequest) (*types.Model, error)
	GetModel(context.Context, types.ModelParams) (*types.Model, error)
	GetModels(context.Context, types.GetModelsParams) ([]*types.Model, error)

	CreateModelVersion(context.Context, types.CreateModelVersionParams, types.CreateModelVersionRequest) (*types.ModelVersion, error)
	DestroyModelVersion(context.Context, types.ModelVersionParams) error
	UpdateModelVersion(context.Context, types.ModelVersionParams, types.UpdateModelVersionRequest) (*types.ModelVersion, error)
	GetModelVersion(context.Context, types.ModelVersionParams) (*types.ModelVersion, error)
	GetModelVersions(context.Context, types.GetModelVersionsParams) ([]*types.ModelVersion, error)
}

func New added in v2.0.2

func New(database *database.Database, cache *cache.Cache, job *job.Job, enforcer *casbin.Enforcer, objectStorage objectstorage.ObjectStorage) Service

NewREST returns a new REST instence

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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