Documentation
¶
Overview ¶
Copyright 2023 The Chromium Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- type BotEvent
- type BotEventsIterator
- type CancelTasksRequest
- type ISwarmingService
- type JobsIterator
- type MockISwarmingService
- func (m *MockISwarmingService) CancelTasks(ctx context.Context, req CancelTasksRequest) error
- func (m *MockISwarmingService) CountTasks(ctx context.Context, in *apipb.TasksCountRequest) (*apipb.TasksCount, error)
- func (m *MockISwarmingService) EXPECT() *MockISwarmingServiceMockRecorder
- func (m *MockISwarmingService) GetBot(ctx context.Context, hostname string) (*apipb.BotInfo, error)
- func (m *MockISwarmingService) ListBotEvents(ctx context.Context, hostname, cursor string, pageSize int) (*BotEventsIterator, error)
- func (m *MockISwarmingService) ListBotTasks(ctx context.Context, hostname, cursor string, pageSize int) (*TasksIterator, error)
- func (m *MockISwarmingService) ListBots(ctx context.Context, in *apipb.BotsRequest) (*apipb.BotInfoListResponse, error)
- func (m *MockISwarmingService) ListTasks(ctx context.Context, in *apipb.TasksWithPerfRequest) (*apipb.TaskListResponse, error)
- type MockISwarmingServiceMockRecorder
- func (mr *MockISwarmingServiceMockRecorder) CancelTasks(ctx context.Context, req CancelTasksRequest) *gomock.Call
- func (mr *MockISwarmingServiceMockRecorder) CountTasks(ctx, in interface{}) *gomock.Call
- func (mr *MockISwarmingServiceMockRecorder) GetBot(ctx, hostname interface{}) *gomock.Call
- func (mr *MockISwarmingServiceMockRecorder) ListBotEvents(ctx, hostname, cursor, pageSize interface{}) *gomock.Call
- func (mr *MockISwarmingServiceMockRecorder) ListBotTasks(ctx, hostname, cursor, pageSize interface{}) *gomock.Call
- func (mr *MockISwarmingServiceMockRecorder) ListBots(ctx, in interface{}) *gomock.Call
- func (mr *MockISwarmingServiceMockRecorder) ListTasks(ctx, in interface{}) *gomock.Call
- type MockTasksClient
- func (m *MockTasksClient) CountTasks(ctx context.Context, in *apipb.TasksCountRequest, opts ...grpc.CallOption) (*apipb.TasksCount, error)
- func (m *MockTasksClient) EXPECT() *MockTasksClientMockRecorder
- func (m *MockTasksClient) ListTasks(ctx context.Context, in *apipb.TasksWithPerfRequest, opts ...grpc.CallOption) (*apipb.TaskListResponse, error)
- type MockTasksClientMockRecorder
- type SwarmingService
- func (s *SwarmingService) CancelTasks(ctx context.Context, req CancelTasksRequest) error
- func (s *SwarmingService) CountTasks(ctx context.Context, in *swarmingapi.TasksCountRequest) (*swarmingapi.TasksCount, error)
- func (s *SwarmingService) GetBot(ctx context.Context, hostname string) (*swarmingapi.BotInfo, error)
- func (s *SwarmingService) ListBotEvents(ctx context.Context, hostname, cursor string, pageSize int) (*BotEventsIterator, error)
- func (s *SwarmingService) ListBotTasks(ctx context.Context, hostname, cursor string, pageSize int) (*TasksIterator, error)
- func (s *SwarmingService) ListBots(ctx context.Context, in *swarmingapi.BotsRequest) (*swarmingapi.BotInfoListResponse, error)
- func (s *SwarmingService) ListTasks(ctx context.Context, in *swarmingapi.TasksWithPerfRequest) (*swarmingapi.TaskListResponse, error)
- type Task
- type TasksClient
- type TasksIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotEvent ¶
type BotEvent struct { Message string Type string Ts *timestamp.Timestamp TaskID string TaskLink string Version string }
BotEvent contains the information that we want to show on the UI
type BotEventsIterator ¶
BotEventsIterator is a struct contains list of events
type CancelTasksRequest ¶
type ISwarmingService ¶
type ISwarmingService interface { // GetBot get the bot information from swarming API. GetBot(ctx context.Context, hostname string) (*swarmingapi.BotInfo, error) // ListBotTasks list the bot tasks from swarming API. ListBotTasks(ctx context.Context, hostname, cursor string, pageSize int) (*TasksIterator, error) // ListBotEvents list the bot events from swarming API ListBotEvents(ctx context.Context, hostname, cursor string, pageSize int) (*BotEventsIterator, error) // ListTasks lists the tasks from swarming API based on the tags passed. ListTasks(ctx context.Context, in *swarmingapi.TasksWithPerfRequest) (*swarmingapi.TaskListResponse, error) // ListBots lists the bot from swarming API. ListBots(ctx context.Context, in *swarmingapi.BotsRequest) (*swarmingapi.BotInfoListResponse, error) // CountTasks returns the count of swarming tasks for given tags and filters. CountTasks(ctx context.Context, in *swarmingapi.TasksCountRequest) (*swarmingapi.TasksCount, error) // CancelTasks cancels a subset of pending tasks based on the tags. CancelTasks(ctx context.Context, req CancelTasksRequest) error }
ISwarmingService is the interface provides different services.
func NewSwarmingService ¶
func NewSwarmingService(ctx context.Context) (ISwarmingService, error)
NewSwarmingService create a new swarming service
type JobsIterator ¶
JobsIterator is a struct contains list of events
type MockISwarmingService ¶
type MockISwarmingService struct {
// contains filtered or unexported fields
}
MockISwarmingService is a mock of ISwarmingService interface.
func NewMockISwarmingService ¶
func NewMockISwarmingService(ctrl *gomock.Controller) *MockISwarmingService
NewMockISwarmingService creates a new mock instance.
func (*MockISwarmingService) CancelTasks ¶
func (m *MockISwarmingService) CancelTasks(ctx context.Context, req CancelTasksRequest) error
CancelTasks mocks base method
func (*MockISwarmingService) CountTasks ¶
func (m *MockISwarmingService) CountTasks(ctx context.Context, in *apipb.TasksCountRequest) (*apipb.TasksCount, error)
CountTasks mocks base method.
func (*MockISwarmingService) EXPECT ¶
func (m *MockISwarmingService) EXPECT() *MockISwarmingServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockISwarmingService) ListBotEvents ¶
func (m *MockISwarmingService) ListBotEvents(ctx context.Context, hostname, cursor string, pageSize int) (*BotEventsIterator, error)
ListBotEvents mocks base method.
func (*MockISwarmingService) ListBotTasks ¶
func (m *MockISwarmingService) ListBotTasks(ctx context.Context, hostname, cursor string, pageSize int) (*TasksIterator, error)
ListBotTasks mocks base method.
func (*MockISwarmingService) ListBots ¶
func (m *MockISwarmingService) ListBots(ctx context.Context, in *apipb.BotsRequest) (*apipb.BotInfoListResponse, error)
ListBots mocks base method.
func (*MockISwarmingService) ListTasks ¶
func (m *MockISwarmingService) ListTasks(ctx context.Context, in *apipb.TasksWithPerfRequest) (*apipb.TaskListResponse, error)
ListTasks mocks base method.
type MockISwarmingServiceMockRecorder ¶
type MockISwarmingServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockISwarmingServiceMockRecorder is the mock recorder for MockISwarmingService.
func (*MockISwarmingServiceMockRecorder) CancelTasks ¶
func (mr *MockISwarmingServiceMockRecorder) CancelTasks(ctx context.Context, req CancelTasksRequest) *gomock.Call
CancelTasks indicates an expected call of CancelTasks
func (*MockISwarmingServiceMockRecorder) CountTasks ¶
func (mr *MockISwarmingServiceMockRecorder) CountTasks(ctx, in interface{}) *gomock.Call
CountTasks indicates an expected call of CountTasks.
func (*MockISwarmingServiceMockRecorder) GetBot ¶
func (mr *MockISwarmingServiceMockRecorder) GetBot(ctx, hostname interface{}) *gomock.Call
GetBot indicates an expected call of GetBot.
func (*MockISwarmingServiceMockRecorder) ListBotEvents ¶
func (mr *MockISwarmingServiceMockRecorder) ListBotEvents(ctx, hostname, cursor, pageSize interface{}) *gomock.Call
ListBotEvents indicates an expected call of ListBotEvents.
func (*MockISwarmingServiceMockRecorder) ListBotTasks ¶
func (mr *MockISwarmingServiceMockRecorder) ListBotTasks(ctx, hostname, cursor, pageSize interface{}) *gomock.Call
ListBotTasks indicates an expected call of ListBotTasks.
func (*MockISwarmingServiceMockRecorder) ListBots ¶
func (mr *MockISwarmingServiceMockRecorder) ListBots(ctx, in interface{}) *gomock.Call
ListBots indicates an expected call of ListBots.
func (*MockISwarmingServiceMockRecorder) ListTasks ¶
func (mr *MockISwarmingServiceMockRecorder) ListTasks(ctx, in interface{}) *gomock.Call
ListTasks indicates an expected call of ListTasks.
type MockTasksClient ¶
type MockTasksClient struct {
// contains filtered or unexported fields
}
MockTasksClient is a mock of TasksClient interface.
func NewMockTasksClient ¶
func NewMockTasksClient(ctrl *gomock.Controller) *MockTasksClient
NewMockTasksClient creates a new mock instance.
func (*MockTasksClient) CountTasks ¶
func (m *MockTasksClient) CountTasks(ctx context.Context, in *apipb.TasksCountRequest, opts ...grpc.CallOption) (*apipb.TasksCount, error)
CountTasks mocks base method.
func (*MockTasksClient) EXPECT ¶
func (m *MockTasksClient) EXPECT() *MockTasksClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTasksClient) ListTasks ¶
func (m *MockTasksClient) ListTasks(ctx context.Context, in *apipb.TasksWithPerfRequest, opts ...grpc.CallOption) (*apipb.TaskListResponse, error)
ListTasks mocks base method.
type MockTasksClientMockRecorder ¶
type MockTasksClientMockRecorder struct {
// contains filtered or unexported fields
}
MockTasksClientMockRecorder is the mock recorder for MockTasksClient.
func (*MockTasksClientMockRecorder) CountTasks ¶
func (mr *MockTasksClientMockRecorder) CountTasks(ctx, in interface{}, opts ...interface{}) *gomock.Call
CountTasks indicates an expected call of CountTasks.
func (*MockTasksClientMockRecorder) ListTasks ¶
func (mr *MockTasksClientMockRecorder) ListTasks(ctx, in interface{}, opts ...interface{}) *gomock.Call
ListTasks indicates an expected call of ListTasks.
type SwarmingService ¶
type SwarmingService struct {
// contains filtered or unexported fields
}
SwarmingService is the implementation of ISwarmingService
func (*SwarmingService) CancelTasks ¶
func (s *SwarmingService) CancelTasks(ctx context.Context, req CancelTasksRequest) error
CancelTasks cancels a subset of pending tasks based on the tags.
func (*SwarmingService) CountTasks ¶
func (s *SwarmingService) CountTasks(ctx context.Context, in *swarmingapi.TasksCountRequest) (*swarmingapi.TasksCount, error)
CountTasks returns the count of swarming tasks for given tags and filters.
func (*SwarmingService) GetBot ¶
func (s *SwarmingService) GetBot( ctx context.Context, hostname string, ) (*swarmingapi.BotInfo, error)
GetBot get the bot information from swarming API.
func (*SwarmingService) ListBotEvents ¶
func (s *SwarmingService) ListBotEvents( ctx context.Context, hostname, cursor string, pageSize int, ) (*BotEventsIterator, error)
ListBotEvents lsit the bot events from swarming API
func (*SwarmingService) ListBotTasks ¶
func (s *SwarmingService) ListBotTasks( ctx context.Context, hostname, cursor string, pageSize int, ) (*TasksIterator, error)
ListBotTasks list the bot tasks from swarming API.
func (*SwarmingService) ListBots ¶
func (s *SwarmingService) ListBots(ctx context.Context, in *swarmingapi.BotsRequest) (*swarmingapi.BotInfoListResponse, error)
func (*SwarmingService) ListTasks ¶
func (s *SwarmingService) ListTasks(ctx context.Context, in *swarmingapi.TasksWithPerfRequest) (*swarmingapi.TaskListResponse, error)
ListTasks returns the list of swarming tasks for given tags and filters.
type Task ¶
type Task struct { Id string Name string StartAt *timestamp.Timestamp // Duration uses second Duration float32 Url string IsSuccess bool }
Task contains the information that we want to show on the UI
type TasksClient ¶
type TasksClient interface { ListTasks(ctx context.Context, in *swarmingapi.TasksWithPerfRequest, opts ...grpc.CallOption) (*swarmingapi.TaskListResponse, error) // CountTasks returns the count of swarming tasks for given tags and filters. CountTasks(ctx context.Context, in *swarmingapi.TasksCountRequest, opts ...grpc.CallOption) (*swarmingapi.TasksCount, error) // CancelTasks cancels a subset of pending tasks based on the tags. CancelTasks(ctx context.Context, in *swarmingapi.TasksCancelRequest, opts ...grpc.CallOption) (*swarmingapi.TasksCancelResponse, error) }
type TasksIterator ¶
TasksIterator is a struct contains list of Task