service

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 17 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(options ...GRPCOption) *GRPC

NewREST returns a new REST instence

func (*GRPC) AddCDNToCDNCluster

func (s *GRPC) AddCDNToCDNCluster(ctx context.Context, req *manager.AddCDNToCDNClusterRequest) (*emptypb.Empty, error)

func (*GRPC) AddSchedulerClusterToSchedulerCluster

func (s *GRPC) AddSchedulerClusterToSchedulerCluster(ctx context.Context, req *manager.AddSchedulerClusterToSchedulerClusterRequest) (*emptypb.Empty, error)

func (*GRPC) CreateCDN

func (s *GRPC) CreateCDN(ctx context.Context, req *manager.CreateCDNRequest) (*manager.CDN, error)

func (*GRPC) CreateScheduler

func (s *GRPC) CreateScheduler(ctx context.Context, req *manager.CreateSchedulerRequest) (*manager.Scheduler, error)

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 GRPCOption

type GRPCOption func(s *GRPC)

Option is a functional option for rest

func GRPCWithCache

func GRPCWithCache(cache *cache.Cache) GRPCOption

WithCache set the cache client

func GRPCWithDatabase

func GRPCWithDatabase(database *database.Database) GRPCOption

WithDatabase set the database client

type Option

type Option func(s *rest)

Option is a functional option for rest

func WithCache

func WithCache(cache *cache.Cache) Option

WithCache set the cache client

func WithDatabase

func WithDatabase(database *database.Database) Option

WithDatabase set the database client

type REST

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

	Login(json types.LoginRequest) (*model.User, error)
	Register(json types.RegisterRequest) (*model.User, error)
}

func NewREST

func NewREST(options ...Option) 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