service

package
v2.0.2-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 30 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

This section is empty.

Functions

This section is empty.

Types

type GRPC

type GRPC struct {
	manager.UnimplementedManagerServer
	// contains filtered or unexported fields
}

func NewGRPC

func NewGRPC(database *database.Database, cache *cache.Cache, searcher searcher.Searcher) *GRPC

NewREST returns a new REST instence

func (*GRPC) GetCDN

func (s *GRPC) GetCDN(ctx context.Context, req *manager.GetCDNRequest) (*manager.CDN, error)

func (*GRPC) GetScheduler

func (s *GRPC) GetScheduler(ctx context.Context, req *manager.GetSchedulerRequest) (*manager.Scheduler, error)

func (*GRPC) KeepAlive

func (s *GRPC) KeepAlive(m manager.Manager_KeepAliveServer) error

func (*GRPC) ListSchedulers

func (*GRPC) UpdateCDN

func (s *GRPC) UpdateCDN(ctx context.Context, req *manager.UpdateCDNRequest) (*manager.CDN, error)

func (*GRPC) UpdateScheduler

func (s *GRPC) UpdateScheduler(ctx context.Context, req *manager.UpdateSchedulerRequest) (*manager.Scheduler, error)

type REST

type REST interface {
	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)

	CreateCDNCluster(context.Context, types.CreateCDNClusterRequest) (*model.CDNCluster, error)
	DestroyCDNCluster(context.Context, uint) error
	UpdateCDNCluster(context.Context, uint, types.UpdateCDNClusterRequest) (*model.CDNCluster, error)
	GetCDNCluster(context.Context, uint) (*model.CDNCluster, error)
	GetCDNClusters(context.Context, types.GetCDNClustersQuery) (*[]model.CDNCluster, int64, error)
	AddCDNToCDNCluster(context.Context, uint, uint) error
	AddSchedulerClusterToCDNCluster(context.Context, uint, uint) error

	CreateCDN(context.Context, types.CreateCDNRequest) (*model.CDN, error)
	DestroyCDN(context.Context, uint) error
	UpdateCDN(context.Context, uint, types.UpdateCDNRequest) (*model.CDN, error)
	GetCDN(context.Context, uint) (*model.CDN, error)
	GetCDNs(context.Context, types.GetCDNsQuery) (*[]model.CDN, int64, 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
	AddCDNClusterToSecurityGroup(context.Context, uint, uint) error
	AddSecurityRuleToSecurityGroup(context.Context, uint, uint) error
	DestroySecurityRuleToSecurityGroup(context.Context, uint, uint) 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
	AddCDNClusterToApplication(context.Context, uint, uint) error
	DeleteCDNClusterToApplication(context.Context, uint, uint) error
}

func NewREST

func NewREST(database *database.Database, cache *cache.Cache, job *job.Job, enforcer *casbin.Enforcer) REST

NewREST returns a new REST instence

Jump to

Keyboard shortcuts

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