service

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

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(uint) (*model.User, error)
	SignIn(types.SignInRequest) (*model.User, error)
	SignUp(types.SignUpRequest) (*model.User, error)
	OauthSignin(string) (string, error)
	OauthSigninCallback(string, string) (*model.User, error)
	ResetPassword(uint, types.ResetPasswordRequest) error
	GetRolesForUser(uint) ([]string, error)
	AddRoleForUser(types.AddRoleForUserParams) (bool, error)
	DeleteRoleForUser(types.DeleteRoleForUserParams) (bool, error)

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

	GetPermissions(*gin.Engine) []rbac.Permission

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

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

	CreateCDN(types.CreateCDNRequest) (*model.CDN, error)
	DestroyCDN(uint) error
	UpdateCDN(uint, types.UpdateCDNRequest) (*model.CDN, error)
	GetCDN(uint) (*model.CDN, error)
	GetCDNs(types.GetCDNsQuery) (*[]model.CDN, error)
	CDNTotalCount(types.GetCDNsQuery) (int64, error)

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

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

	CreateSecurityGroup(types.CreateSecurityGroupRequest) (*model.SecurityGroup, error)
	DestroySecurityGroup(uint) error
	UpdateSecurityGroup(uint, types.UpdateSecurityGroupRequest) (*model.SecurityGroup, error)
	GetSecurityGroup(uint) (*model.SecurityGroup, error)
	GetSecurityGroups(types.GetSecurityGroupsQuery) (*[]model.SecurityGroup, error)
	SecurityGroupTotalCount(types.GetSecurityGroupsQuery) (int64, error)
	AddSchedulerClusterToSecurityGroup(uint, uint) error
	AddCDNClusterToSecurityGroup(uint, uint) error

	CreatePreheat(types.CreatePreheatRequest) (*types.Preheat, error)
	GetPreheat(string) (*types.Preheat, 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