service

package
v0.0.0-...-432d548 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Overview

Package service is a generated GoMock package.

Package service is a generated GoMock package.

Package service is a generated GoMock package.

Package service is a generated GoMock package.

Index

Constants

View Source
const (
	SchTypeRole  = "role"
	SchTypeGroup = "group"
	SchTypeNode  = "node"
)

SchTypes

Variables

This section is empty.

Functions

func InitFlags

func InitFlags(flagset *pflag.FlagSet)

InitFlags setup command line flags.

func SliceContainsSlice

func SliceContainsSlice(parent, child []string) bool

SliceContainsSlice slice contains slice or not

func ToJSONString

func ToJSONString(obj interface{}) string

ToJSONString to json string

Types

type Factory

type Factory struct {
	GroupService     GroupService
	DynamicInterface dynamic.Interface
	// contains filtered or unexported fields
}

Factory create services.

func NewFactory

func NewFactory(cluster, kubeConfigFile, contentType string, stopCh <-chan struct{}) (*Factory, error)

NewFactory create service factory

type GroupService

type GroupService interface {
	GetAppGroup(appName, schType string) ([]*carbon.GroupStatus, error)
	GetGroup(appName, schType string, groupIds []string) ([]*carbon.GroupStatus, error)
	DeleteGroup(appName, schType, groupID string) error
	NewGroup(appName string, schOpts *SchOptions, groupPlan *typespec.GroupPlan) error
	SetGroups(appName string, schOpts *SchOptions, groupPlans map[string]*typespec.GroupPlan) error
	SetGroup(appName, groupID string, schOpts *SchOptions, groupPlan *typespec.GroupPlan) error
	ScaleGroup(appName, groupID, zoneName string, scalePlan *carbonv1.ScaleSchedulePlan) error
	DisableScale(appName, groupID, zoneName string) error
	ReclaimWorkerNodesOnEviction(appName string, req *ReclaimWorkerNodeRequest) error
}

GroupService operates on groups

type Location

type Location struct {
	Cluster      string      `json:"cluster,omitempty"`
	HippoAppName string      `json:"hippoAppName,omitempty"`
	Namespace    string      `json:"namespace,omitempty"`
	Rollingset   string      `json:"rollingset,omitempty"`
	Replica      string      `json:"replica,omitempty"`
	WorkerNode   string      `json:"workerNode,omitempty"`
	Serverless   *Serverless `json:"serverless,omitempty"`
}

type MockGroupService

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

MockGroupService is a mock of GroupService interface.

func NewMockGroupService

func NewMockGroupService(ctrl *gomock.Controller) *MockGroupService

NewMockGroupService creates a new mock instance.

func (*MockGroupService) DeleteGroup

func (m *MockGroupService) DeleteGroup(appName, schType, groupID string) error

DeleteGroup mocks base method.

func (*MockGroupService) DisableScale

func (m *MockGroupService) DisableScale(appName, groupID, zoneName string) error

DisableScale mocks base method.

func (*MockGroupService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGroupService) GetAppGroup

func (m *MockGroupService) GetAppGroup(appName, schType string) ([]*carbon.GroupStatus, error)

GetAppGroup mocks base method.

func (*MockGroupService) GetGroup

func (m *MockGroupService) GetGroup(appName, schType string, groupIds []string) ([]*carbon.GroupStatus, error)

GetGroup mocks base method.

func (*MockGroupService) NewGroup

func (m *MockGroupService) NewGroup(appName string, schOpts *SchOptions, groupPlan *typespec.GroupPlan) error

NewGroup mocks base method.

func (*MockGroupService) ReclaimWorkerNodesOnEviction

func (m *MockGroupService) ReclaimWorkerNodesOnEviction(appName string, req *ReclaimWorkerNodeRequest) error

ReclaimWorkerNodesOnEviction mocks base method.

func (*MockGroupService) ScaleGroup

func (m *MockGroupService) ScaleGroup(appName, groupID, zoneName string, scalePlan *v1.ScaleSchedulePlan) error

ScaleGroup mocks base method.

func (*MockGroupService) SetGroup

func (m *MockGroupService) SetGroup(appName, groupID string, schOpts *SchOptions, groupPlan *typespec.GroupPlan) error

SetGroup mocks base method.

func (*MockGroupService) SetGroups

func (m *MockGroupService) SetGroups(appName string, schOpts *SchOptions, groupPlans map[string]*typespec.GroupPlan) error

SetGroups mocks base method.

type MockGroupServiceMockRecorder

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

MockGroupServiceMockRecorder is the mock recorder for MockGroupService.

func (*MockGroupServiceMockRecorder) DeleteGroup

func (mr *MockGroupServiceMockRecorder) DeleteGroup(appName, schType, groupID interface{}) *gomock.Call

DeleteGroup indicates an expected call of DeleteGroup.

func (*MockGroupServiceMockRecorder) DisableScale

func (mr *MockGroupServiceMockRecorder) DisableScale(appName, groupID, zoneName interface{}) *gomock.Call

DisableScale indicates an expected call of DisableScale.

func (*MockGroupServiceMockRecorder) GetAppGroup

func (mr *MockGroupServiceMockRecorder) GetAppGroup(appName, schType interface{}) *gomock.Call

GetAppGroup indicates an expected call of GetAppGroup.

func (*MockGroupServiceMockRecorder) GetGroup

func (mr *MockGroupServiceMockRecorder) GetGroup(appName, schType, groupIds interface{}) *gomock.Call

GetGroup indicates an expected call of GetGroup.

func (*MockGroupServiceMockRecorder) NewGroup

func (mr *MockGroupServiceMockRecorder) NewGroup(appName, schOpts, groupPlan interface{}) *gomock.Call

NewGroup indicates an expected call of NewGroup.

func (*MockGroupServiceMockRecorder) ReclaimWorkerNodesOnEviction

func (mr *MockGroupServiceMockRecorder) ReclaimWorkerNodesOnEviction(appName, req interface{}) *gomock.Call

ReclaimWorkerNodesOnEviction indicates an expected call of ReclaimWorkerNodesOnEviction.

func (*MockGroupServiceMockRecorder) ScaleGroup

func (mr *MockGroupServiceMockRecorder) ScaleGroup(appName, groupID, zoneName, scalePlan interface{}) *gomock.Call

ScaleGroup indicates an expected call of ScaleGroup.

func (*MockGroupServiceMockRecorder) SetGroup

func (mr *MockGroupServiceMockRecorder) SetGroup(appName, groupID, schOpts, groupPlan interface{}) *gomock.Call

SetGroup indicates an expected call of SetGroup.

func (*MockGroupServiceMockRecorder) SetGroups

func (mr *MockGroupServiceMockRecorder) SetGroups(appName, schOpts, groupPlans interface{}) *gomock.Call

SetGroups indicates an expected call of SetGroups.

type MockRollingsetService

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

MockRollingsetService is a mock of RollingsetService interface.

func NewMockRollingsetService

func NewMockRollingsetService(ctrl *gomock.Controller) *MockRollingsetService

NewMockRollingsetService creates a new mock instance.

func (*MockRollingsetService) Create

func (m *MockRollingsetService) Create(location *Location, rs *v1.RollingSet) error

Create mocks base method.

func (*MockRollingsetService) Delete

func (m *MockRollingsetService) Delete(location *Location) error

Delete mocks base method.

func (*MockRollingsetService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRollingsetService) Get

func (m *MockRollingsetService) Get(location *Location) (*v1.RollingSet, error)

Get mocks base method.

func (*MockRollingsetService) GetReplicaStatus

func (m *MockRollingsetService) GetReplicaStatus(location *Location) (*v1.ReplicaStatus, error)

GetReplicaStatus mocks base method.

func (*MockRollingsetService) GetSubrsInfo

GetSubrsInfo mocks base method.

func (*MockRollingsetService) ListReplicaStatus

func (m *MockRollingsetService) ListReplicaStatus(location *Location) ([]*v1.ReplicaStatus, map[string]string, error)

ListReplicaStatus mocks base method.

func (*MockRollingsetService) Patch

func (m *MockRollingsetService) Patch(location *Location, patch *v1.RollingsetPatch) error

Patch mocks base method.

func (*MockRollingsetService) ReclaimWorkerNode

func (m *MockRollingsetService) ReclaimWorkerNode(location *Location) error

ReclaimWorkerNode mocks base method.

func (*MockRollingsetService) SyncSubrs

func (m *MockRollingsetService) SyncSubrs(location *Location, subrsMap map[string]*v1.Subrs, subrsEnable bool) error

SyncSubrs mocks base method.

func (*MockRollingsetService) Update

func (m *MockRollingsetService) Update(location *Location, rs *v1.RollingSet) error

Update mocks base method.

type MockRollingsetServiceMockRecorder

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

MockRollingsetServiceMockRecorder is the mock recorder for MockRollingsetService.

func (*MockRollingsetServiceMockRecorder) Create

func (mr *MockRollingsetServiceMockRecorder) Create(location, rs interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockRollingsetServiceMockRecorder) Delete

func (mr *MockRollingsetServiceMockRecorder) Delete(location interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockRollingsetServiceMockRecorder) Get

func (mr *MockRollingsetServiceMockRecorder) Get(location interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockRollingsetServiceMockRecorder) GetReplicaStatus

func (mr *MockRollingsetServiceMockRecorder) GetReplicaStatus(location interface{}) *gomock.Call

GetReplicaStatus indicates an expected call of GetReplicaStatus.

func (*MockRollingsetServiceMockRecorder) GetSubrsInfo

func (mr *MockRollingsetServiceMockRecorder) GetSubrsInfo(rs interface{}) *gomock.Call

GetSubrsInfo indicates an expected call of GetSubrsInfo.

func (*MockRollingsetServiceMockRecorder) ListReplicaStatus

func (mr *MockRollingsetServiceMockRecorder) ListReplicaStatus(location interface{}) *gomock.Call

ListReplicaStatus indicates an expected call of ListReplicaStatus.

func (*MockRollingsetServiceMockRecorder) Patch

func (mr *MockRollingsetServiceMockRecorder) Patch(location, patch interface{}) *gomock.Call

Patch indicates an expected call of Patch.

func (*MockRollingsetServiceMockRecorder) ReclaimWorkerNode

func (mr *MockRollingsetServiceMockRecorder) ReclaimWorkerNode(location interface{}) *gomock.Call

ReclaimWorkerNode indicates an expected call of ReclaimWorkerNode.

func (*MockRollingsetServiceMockRecorder) SyncSubrs

func (mr *MockRollingsetServiceMockRecorder) SyncSubrs(location, subrsMap, subrsEnable interface{}) *gomock.Call

SyncSubrs indicates an expected call of SyncSubrs.

func (*MockRollingsetServiceMockRecorder) Update

func (mr *MockRollingsetServiceMockRecorder) Update(location, rs interface{}) *gomock.Call

Update indicates an expected call of Update.

type Mockk8sSyncer

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

Mockk8sSyncer is a mock of k8sSyncer interface.

func NewMockk8sSyncer

func NewMockk8sSyncer(ctrl *gomock.Controller) *Mockk8sSyncer

NewMockk8sSyncer creates a new mock instance.

func (*Mockk8sSyncer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type Mockk8sSyncerMockRecorder

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

Mockk8sSyncerMockRecorder is the mock recorder for Mockk8sSyncer.

type MockresourceManager

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

MockresourceManager is a mock of resourceManager interface.

func NewMockresourceManager

func NewMockresourceManager(ctrl *gomock.Controller) *MockresourceManager

NewMockresourceManager creates a new mock instance.

func (*MockresourceManager) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockresourceManagerMockRecorder

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

MockresourceManagerMockRecorder is the mock recorder for MockresourceManager.

type ReclaimWorkerNodePreference

type ReclaimWorkerNodePreference struct {
	Scope *string `json:"scope"`
	Type  *string `json:"type"`
	TTL   *int32  `json:"ttl"`
}

ReclaimWorkerNodePreference preference to reclaim worker node

type ReclaimWorkerNodeRequest

type ReclaimWorkerNodeRequest struct {
	WorkerNodes []*carbonv1.ReclaimWorkerNode `json:"workerNodes"`
	Preference  *ReclaimWorkerNodePreference  `json:"preference"`
}

ReclaimWorkerNodeRequest reclaim a list of worker nodes

type SchOptions

type SchOptions struct {
	SchType     string `json:"schType"`
	AppChecksum string `json:"appChecksum"`
	ZKAddress   string `json:"zkAddress"`
}

SchOptions options for scheduler.

func ParseSchOptions

func ParseSchOptions(str string) (*SchOptions, error)

ParseSchOptions parse schedule options.

type Serverless

type Serverless struct {
	AppName string `json:"appName,omitempty"`
	FiberId string `json:"fiberId,omitempty"`
}

Jump to

Keyboard shortcuts

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