Documentation
¶
Overview ¶
Package clients defines the PRPC clients.
Index ¶
- Constants
- Variables
- func InitializeUpdateLSERequest(hostname, hive string) *ufsAPI.UpdateMachineLSERequest
- func NewConfigClient(ctx context.Context) config.Interface
- func SetUFSNamespace(ctx context.Context, namespace string) context.Context
- type GCEPClient
- type MockGCEPClient
- func (m *MockGCEPClient) EXPECT() *MockGCEPClientMockRecorder
- func (m *MockGCEPClient) Get(ctx context.Context, in *config.GetRequest, opts ...grpc.CallOption) (*config.Config, error)
- func (m *MockGCEPClient) Update(ctx context.Context, in *config.UpdateRequest, opts ...grpc.CallOption) (*config.Config, error)
- type MockGCEPClientMockRecorder
- type MockSwarmingClient
- type MockSwarmingClientMockRecorder
- type MockUFSClient
- func (m *MockUFSClient) BatchListMachineLSEs(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error)
- func (m *MockUFSClient) BatchListMachines(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error)
- func (m *MockUFSClient) BatchListSchedulingUnits(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error)
- func (m *MockUFSClient) EXPECT() *MockUFSClientMockRecorder
- func (m *MockUFSClient) UpdateMachineLSE(ctx context.Context, in *ufspb0.UpdateMachineLSERequest, ...) (*ufspb.MachineLSE, error)
- type MockUFSClientMockRecorder
- func (mr *MockUFSClientMockRecorder) BatchListMachineLSEs(ctx, filters, pageSize, keysOnly, full interface{}) *gomock.Call
- func (mr *MockUFSClientMockRecorder) BatchListMachines(ctx, filters, pageSize, keysOnly, full interface{}) *gomock.Call
- func (mr *MockUFSClientMockRecorder) BatchListSchedulingUnits(ctx, filters, pageSize, keysOnly, full interface{}) *gomock.Call
- func (mr *MockUFSClientMockRecorder) UpdateMachineLSE(ctx, in interface{}, opts ...interface{}) *gomock.Call
- type SwarmingClient
- type UFSClient
Constants ¶
const ( // Default flag values. UfsDev string = "staging.ufs.api.cr.dev" UfsProd string = "ufs.api.cr.dev" GcepDev string = "gce-provider-dev.appspot.com" GcepProd string = "gce-provider.appspot.com" ConfigID string = "cloudbots-dev" SwarmingDev string = "chromium-swarm-dev.appspot.com" )
Variables ¶
var MockConfigClientKey contextKey = "used in tests only for setting the mock ConfigClient"
MockConfigClientKey is used for testing.
var MockGCEPClientKey contextKey = "used in tests only for setting the mock GCEPClient"
MockGCEPClientKey is used for testing.
var MockSwarmingClientKey contextKey = "used in tests only for setting the mock SwarmingClient"
MockSwarmingClientKey is used for testing.
var MockUFSClientKey contextKey = "used in tests only for setting the mock UFSClient"
MockUFSClientKey is used for testing.
Functions ¶
func InitializeUpdateLSERequest ¶
func InitializeUpdateLSERequest(hostname, hive string) *ufsAPI.UpdateMachineLSERequest
InitializeUpdateLSERequest return a new initialized UpdateMachineLSERequest.
Types ¶
type GCEPClient ¶
type GCEPClient interface { Get(ctx context.Context, in *gcepAPI.GetRequest, opts ...grpc.CallOption) (*gcepAPI.Config, error) Update(ctx context.Context, in *gcepAPI.UpdateRequest, opts ...grpc.CallOption) (*gcepAPI.Config, error) }
GCEPClient is GCE Provider API wrapper for BotsRegulator specific usage. It is used for mocking and testing.
func NewGCEPClient ¶
func NewGCEPClient(ctx context.Context, host string) (GCEPClient, error)
type MockGCEPClient ¶
type MockGCEPClient struct {
// contains filtered or unexported fields
}
MockGCEPClient is a mock of GCEPClient interface.
func NewMockGCEPClient ¶
func NewMockGCEPClient(ctrl *gomock.Controller) *MockGCEPClient
NewMockGCEPClient creates a new mock instance.
func (*MockGCEPClient) EXPECT ¶
func (m *MockGCEPClient) EXPECT() *MockGCEPClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockGCEPClient) Get ¶
func (m *MockGCEPClient) Get(ctx context.Context, in *config.GetRequest, opts ...grpc.CallOption) (*config.Config, error)
Get mocks base method.
func (*MockGCEPClient) Update ¶
func (m *MockGCEPClient) Update(ctx context.Context, in *config.UpdateRequest, opts ...grpc.CallOption) (*config.Config, error)
Update mocks base method.
type MockGCEPClientMockRecorder ¶
type MockGCEPClientMockRecorder struct {
// contains filtered or unexported fields
}
MockGCEPClientMockRecorder is the mock recorder for MockGCEPClient.
func (*MockGCEPClientMockRecorder) Get ¶
func (mr *MockGCEPClientMockRecorder) Get(ctx, in interface{}, opts ...interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockGCEPClientMockRecorder) Update ¶
func (mr *MockGCEPClientMockRecorder) Update(ctx, in interface{}, opts ...interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockSwarmingClient ¶
type MockSwarmingClient struct {
// contains filtered or unexported fields
}
MockSwarmingClient is a mock of SwarmingClient interface.
func NewMockSwarmingClient ¶
func NewMockSwarmingClient(ctrl *gomock.Controller) *MockSwarmingClient
NewMockSwarmingClient creates a new mock instance.
func (*MockSwarmingClient) EXPECT ¶
func (m *MockSwarmingClient) EXPECT() *MockSwarmingClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSwarmingClient) ListBots ¶
func (m *MockSwarmingClient) ListBots(ctx context.Context, in *apipb.BotsRequest, opts ...grpc.CallOption) (*apipb.BotInfoListResponse, error)
ListBots mocks base method.
type MockSwarmingClientMockRecorder ¶
type MockSwarmingClientMockRecorder struct {
// contains filtered or unexported fields
}
MockSwarmingClientMockRecorder is the mock recorder for MockSwarmingClient.
func (*MockSwarmingClientMockRecorder) ListBots ¶
func (mr *MockSwarmingClientMockRecorder) ListBots(ctx, in interface{}, opts ...interface{}) *gomock.Call
ListBots indicates an expected call of ListBots.
type MockUFSClient ¶
type MockUFSClient struct {
// contains filtered or unexported fields
}
MockUFSClient is a mock of UFSClient interface.
func NewMockUFSClient ¶
func NewMockUFSClient(ctrl *gomock.Controller) *MockUFSClient
NewMockUFSClient creates a new mock instance.
func (*MockUFSClient) BatchListMachineLSEs ¶
func (m *MockUFSClient) BatchListMachineLSEs(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error)
BatchListMachineLSEs mocks base method.
func (*MockUFSClient) BatchListMachines ¶
func (m *MockUFSClient) BatchListMachines(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error)
BatchListMachines mocks base method.
func (*MockUFSClient) BatchListSchedulingUnits ¶
func (m *MockUFSClient) BatchListSchedulingUnits(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error)
BatchListSchedulingUnits mocks base method.
func (*MockUFSClient) EXPECT ¶
func (m *MockUFSClient) EXPECT() *MockUFSClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUFSClient) UpdateMachineLSE ¶
func (m *MockUFSClient) UpdateMachineLSE(ctx context.Context, in *ufspb0.UpdateMachineLSERequest, opts ...grpc.CallOption) (*ufspb.MachineLSE, error)
UpdateMachineLSE mocks base method.
type MockUFSClientMockRecorder ¶
type MockUFSClientMockRecorder struct {
// contains filtered or unexported fields
}
MockUFSClientMockRecorder is the mock recorder for MockUFSClient.
func (*MockUFSClientMockRecorder) BatchListMachineLSEs ¶
func (mr *MockUFSClientMockRecorder) BatchListMachineLSEs(ctx, filters, pageSize, keysOnly, full interface{}) *gomock.Call
BatchListMachineLSEs indicates an expected call of BatchListMachineLSEs.
func (*MockUFSClientMockRecorder) BatchListMachines ¶
func (mr *MockUFSClientMockRecorder) BatchListMachines(ctx, filters, pageSize, keysOnly, full interface{}) *gomock.Call
BatchListMachines indicates an expected call of BatchListMachines.
func (*MockUFSClientMockRecorder) BatchListSchedulingUnits ¶
func (mr *MockUFSClientMockRecorder) BatchListSchedulingUnits(ctx, filters, pageSize, keysOnly, full interface{}) *gomock.Call
BatchListSchedulingUnits indicates an expected call of BatchListSchedulingUnits.
func (*MockUFSClientMockRecorder) UpdateMachineLSE ¶
func (mr *MockUFSClientMockRecorder) UpdateMachineLSE(ctx, in interface{}, opts ...interface{}) *gomock.Call
UpdateMachineLSE indicates an expected call of UpdateMachineLSE.
type SwarmingClient ¶
type SwarmingClient interface {
ListBots(ctx context.Context, in *apipb.BotsRequest, opts ...grpc.CallOption) (*apipb.BotInfoListResponse, error)
}
func NewSwarmingClient ¶
func NewSwarmingClient(ctx context.Context, host string) (SwarmingClient, error)
type UFSClient ¶
type UFSClient interface { BatchListMachineLSEs(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error) BatchListMachines(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error) BatchListSchedulingUnits(ctx context.Context, filters []string, pageSize int, keysOnly, full bool) ([]protoadapt.MessageV1, error) UpdateMachineLSE(ctx context.Context, in *ufsAPI.UpdateMachineLSERequest, opts ...grpc.CallOption) (*ufspb.MachineLSE, error) }
UFSClient is UFS API wrapper for BotsRegulator specific usage. It is used for mocking and testing.