Documentation ¶
Overview ¶
Package deploy is a generated GoMock package.
Package deploy is a generated GoMock package.
Package deploy is a generated GoMock package.
Package deploy is a generated GoMock package.
Index ¶
- type Helper
- type HelperOptions
- type Instance
- type Manager
- type MockInstance
- type MockInstanceMockRecorder
- type MockManager
- type MockManagerMockRecorder
- type MockaggregatorClient
- type MockaggregatorClientMockRecorder
- type Mockplanner
- type MockplannerMockRecorder
- type MockvalidatorFactory
- type MockvalidatorFactoryMockRecorder
- type Mode
- type PlannerOptions
- type ToAPIEndpointFn
- type ToPlacementInstanceIDFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Helper ¶
type Helper interface { // Deploy deploys a target revision to the instances in the placement. Deploy(revision string, placement placement.Placement, mode Mode) error }
Helper is a helper class handling deployments.
func NewHelper ¶
func NewHelper(opts HelperOptions) (Helper, error)
NewHelper creates a new deployment helper.
type HelperOptions ¶
type HelperOptions interface { // SetInstrumentOptions sets the instrument options. SetInstrumentOptions(value instrument.Options) HelperOptions // InstrumentOptions returns the instrument options. InstrumentOptions() instrument.Options // SetPlannerOptions sets the deployment planner options. SetPlannerOptions(value PlannerOptions) HelperOptions // PlannerOptions returns the deployment planner options. PlannerOptions() PlannerOptions // SetManager sets the deployment manager. SetManager(value Manager) HelperOptions // Manager returns the deployment manager. Manager() Manager // SetHTTPClient sets the http client. SetHTTPClient(value *http.Client) HelperOptions // HTTPClient returns the http client. HTTPClient() *http.Client // SetRetryOptions sets the retry options. SetRetryOptions(value retry.Options) HelperOptions // RetryOptions returns the retry options. RetryOptions() retry.Options // SetWorkerPool sets the worker pool. SetWorkerPool(value sync.WorkerPool) HelperOptions // WorkerPool returns the worker pool. WorkerPool() sync.WorkerPool // SetToPlacementInstanceIDFn sets the function that converts a deployment // instance id to the corresponding placement instance id. SetToPlacementInstanceIDFn(value ToPlacementInstanceIDFn) HelperOptions // ToPlacementInstanceIDFn returns the function that converts a deployment // instance id to the corresponding placement instance id. ToPlacementInstanceIDFn() ToPlacementInstanceIDFn // SetToAPIEndpointFn sets the function that converts a placement // instance endpoint to the corresponding aggregator instance api endpoint. SetToAPIEndpointFn(value ToAPIEndpointFn) HelperOptions // ToAPIEndpointFn returns the function that converts a placement // instance endpoint to the corresponding aggregator instance api endpoint. ToAPIEndpointFn() ToAPIEndpointFn // SetSettleDurationBetweenSteps sets the settlement duration between consecutive steps. SetSettleDurationBetweenSteps(value time.Duration) HelperOptions // SettleDurationBetweenSteps returns the settlement duration between consecutive steps. SettleDurationBetweenSteps() time.Duration // Validate validates the options. Validate() error }
HelperOptions provide a set of options for the deployment helper.
func NewHelperOptions ¶
func NewHelperOptions() HelperOptions
NewHelperOptions create a set of deployment helper options.
type Instance ¶
type Instance interface { // ID returns the instance id. ID() string // Revision returns the revision deployed to the instance. Revision() string // IsHealthy determines whether the instance is healthy. IsHealthy() bool // IsDeploying determines whether the instance is being deployed. IsDeploying() bool }
Instance represents an instance in the deployment.
type Manager ¶
type Manager interface { // QueryAll returns the full list of instances in the deployment. QueryAll() ([]Instance, error) // Query returns the deployment instances for given set of ids. Query(instanceIDs []string) ([]Instance, error) // Deploy deploys the given revision to the given set of instances. Deploy(instanceIDs []string, revision string) error }
Manager manages the state of deployments and interacts with instances to perform the actual deployment.
type MockInstance ¶
type MockInstance struct {
// contains filtered or unexported fields
}
MockInstance is a mock of Instance interface
func NewMockInstance ¶
func NewMockInstance(ctrl *gomock.Controller) *MockInstance
NewMockInstance creates a new mock instance
func (*MockInstance) EXPECT ¶
func (m *MockInstance) EXPECT() *MockInstanceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockInstance) IsDeploying ¶
func (m *MockInstance) IsDeploying() bool
IsDeploying mocks base method
func (*MockInstance) IsHealthy ¶
func (m *MockInstance) IsHealthy() bool
IsHealthy mocks base method
type MockInstanceMockRecorder ¶
type MockInstanceMockRecorder struct {
// contains filtered or unexported fields
}
MockInstanceMockRecorder is the mock recorder for MockInstance
func (*MockInstanceMockRecorder) ID ¶
func (mr *MockInstanceMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID
func (*MockInstanceMockRecorder) IsDeploying ¶
func (mr *MockInstanceMockRecorder) IsDeploying() *gomock.Call
IsDeploying indicates an expected call of IsDeploying
func (*MockInstanceMockRecorder) IsHealthy ¶
func (mr *MockInstanceMockRecorder) IsHealthy() *gomock.Call
IsHealthy indicates an expected call of IsHealthy
func (*MockInstanceMockRecorder) Revision ¶
func (mr *MockInstanceMockRecorder) Revision() *gomock.Call
Revision indicates an expected call of Revision
type MockManager ¶
type MockManager struct {
// contains filtered or unexported fields
}
MockManager is a mock of Manager interface
func NewMockManager ¶
func NewMockManager(ctrl *gomock.Controller) *MockManager
NewMockManager creates a new mock instance
func (*MockManager) Deploy ¶
func (m *MockManager) Deploy(instanceIDs []string, revision string) error
Deploy mocks base method
func (*MockManager) EXPECT ¶
func (m *MockManager) EXPECT() *MockManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockManager) Query ¶
func (m *MockManager) Query(instanceIDs []string) ([]Instance, error)
Query mocks base method
func (*MockManager) QueryAll ¶
func (m *MockManager) QueryAll() ([]Instance, error)
QueryAll mocks base method
type MockManagerMockRecorder ¶
type MockManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockManagerMockRecorder is the mock recorder for MockManager
func (*MockManagerMockRecorder) Deploy ¶
func (mr *MockManagerMockRecorder) Deploy(instanceIDs, revision interface{}) *gomock.Call
Deploy indicates an expected call of Deploy
func (*MockManagerMockRecorder) Query ¶
func (mr *MockManagerMockRecorder) Query(instanceIDs interface{}) *gomock.Call
Query indicates an expected call of Query
func (*MockManagerMockRecorder) QueryAll ¶
func (mr *MockManagerMockRecorder) QueryAll() *gomock.Call
QueryAll indicates an expected call of QueryAll
type MockaggregatorClient ¶
type MockaggregatorClient struct {
// contains filtered or unexported fields
}
MockaggregatorClient is a mock of aggregatorClient interface
func NewMockaggregatorClient ¶
func NewMockaggregatorClient(ctrl *gomock.Controller) *MockaggregatorClient
NewMockaggregatorClient creates a new mock instance
func (*MockaggregatorClient) EXPECT ¶
func (m *MockaggregatorClient) EXPECT() *MockaggregatorClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockaggregatorClient) IsHealthy ¶
func (m *MockaggregatorClient) IsHealthy(instance string) error
IsHealthy mocks base method
func (*MockaggregatorClient) Resign ¶
func (m *MockaggregatorClient) Resign(instance string) error
Resign mocks base method
func (*MockaggregatorClient) Status ¶
func (m *MockaggregatorClient) Status(instance string) (aggregator.RuntimeStatus, error)
Status mocks base method
type MockaggregatorClientMockRecorder ¶
type MockaggregatorClientMockRecorder struct {
// contains filtered or unexported fields
}
MockaggregatorClientMockRecorder is the mock recorder for MockaggregatorClient
func (*MockaggregatorClientMockRecorder) IsHealthy ¶
func (mr *MockaggregatorClientMockRecorder) IsHealthy(instance interface{}) *gomock.Call
IsHealthy indicates an expected call of IsHealthy
func (*MockaggregatorClientMockRecorder) Resign ¶
func (mr *MockaggregatorClientMockRecorder) Resign(instance interface{}) *gomock.Call
Resign indicates an expected call of Resign
func (*MockaggregatorClientMockRecorder) Status ¶
func (mr *MockaggregatorClientMockRecorder) Status(instance interface{}) *gomock.Call
Status indicates an expected call of Status
type Mockplanner ¶
type Mockplanner struct {
// contains filtered or unexported fields
}
Mockplanner is a mock of planner interface
func NewMockplanner ¶
func NewMockplanner(ctrl *gomock.Controller) *Mockplanner
NewMockplanner creates a new mock instance
func (*Mockplanner) EXPECT ¶
func (m *Mockplanner) EXPECT() *MockplannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*Mockplanner) GenerateOneStep ¶
func (m *Mockplanner) GenerateOneStep(toDeploy, all instanceMetadatas) (deploymentStep, error)
GenerateOneStep mocks base method
func (*Mockplanner) GeneratePlan ¶
func (m *Mockplanner) GeneratePlan(toDeploy, all instanceMetadatas) (deploymentPlan, error)
GeneratePlan mocks base method
type MockplannerMockRecorder ¶
type MockplannerMockRecorder struct {
// contains filtered or unexported fields
}
MockplannerMockRecorder is the mock recorder for Mockplanner
func (*MockplannerMockRecorder) GenerateOneStep ¶
func (mr *MockplannerMockRecorder) GenerateOneStep(toDeploy, all interface{}) *gomock.Call
GenerateOneStep indicates an expected call of GenerateOneStep
func (*MockplannerMockRecorder) GeneratePlan ¶
func (mr *MockplannerMockRecorder) GeneratePlan(toDeploy, all interface{}) *gomock.Call
GeneratePlan indicates an expected call of GeneratePlan
type MockvalidatorFactory ¶
type MockvalidatorFactory struct {
// contains filtered or unexported fields
}
MockvalidatorFactory is a mock of validatorFactory interface
func NewMockvalidatorFactory ¶
func NewMockvalidatorFactory(ctrl *gomock.Controller) *MockvalidatorFactory
NewMockvalidatorFactory creates a new mock instance
func (*MockvalidatorFactory) EXPECT ¶
func (m *MockvalidatorFactory) EXPECT() *MockvalidatorFactoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockvalidatorFactory) ValidatorFor ¶
func (m *MockvalidatorFactory) ValidatorFor(instance instanceMetadata, group *instanceGroup, targetType targetType) validator
ValidatorFor mocks base method
type MockvalidatorFactoryMockRecorder ¶
type MockvalidatorFactoryMockRecorder struct {
// contains filtered or unexported fields
}
MockvalidatorFactoryMockRecorder is the mock recorder for MockvalidatorFactory
func (*MockvalidatorFactoryMockRecorder) ValidatorFor ¶
func (mr *MockvalidatorFactoryMockRecorder) ValidatorFor(instance, group, targetType interface{}) *gomock.Call
ValidatorFor indicates an expected call of ValidatorFor
type PlannerOptions ¶
type PlannerOptions interface { // SetLeaderService sets the leader service. SetLeaderService(value services.LeaderService) PlannerOptions // LeaderService returns the leader service. LeaderService() services.LeaderService // SetWorkerPool sets the worker pool. SetWorkerPool(value xsync.WorkerPool) PlannerOptions // WorkerPool returns the worker pool. WorkerPool() xsync.WorkerPool // SetElectionKeyFmt sets the election key format. SetElectionKeyFmt(value string) PlannerOptions // ElectionKeyFmt returns the election key format. ElectionKeyFmt() string // SetMaxStepSize sets the maximum step size (i.e., number of instances per step). SetMaxStepSize(value int) PlannerOptions // MaxStepSize returns the maximum step size (i.e., number of instances per step). MaxStepSize() int }
PlannerOptions provide a set of options for the deployment planner.
func NewPlannerOptions ¶
func NewPlannerOptions() PlannerOptions
NewPlannerOptions create a new set of options for the deployment planner.
type ToAPIEndpointFn ¶
ToAPIEndpointFn converts a placement instance endpoint to the corresponding aggregator instance api endpoint.
type ToPlacementInstanceIDFn ¶
ToPlacementInstanceIDFn converts a deployment instance id to the corresponding placement instance id.