Documentation ¶
Index ¶
- func BotDimensionsToStringMap(dims []*apipb.StringListPair) map[string][]string
- func BotDimensionsToStringSlice(dims []*apipb.StringListPair) []string
- func ConvertCIPDInput(pkgs []*cipd.Package) *apipb.CipdInput
- func DefaultPRPCClient(httpClient *http.Client, swarmingServer string) *prpc.Client
- func DeleteBots(ctx context.Context, c apipb.BotsClient, botIds []string) error
- func GetRequestMetadataForTasks(ctx context.Context, c apipb.TasksClient, tasks []*apipb.TaskResultResponse) ([]*apipb.TaskRequestMetadataResponse, error)
- func GetTaskRequestProperties(t *apipb.TaskRequestResponse) *apipb.TaskProperties
- func ListBotsForPool(ctx context.Context, c apipb.BotsClient, pool string) ([]*apipb.BotInfo, error)
- func ListBotsHelper(ctx context.Context, c apipb.BotsClient, req *apipb.BotsRequest) ([]*apipb.BotInfo, error)
- func ListTaskRequestMetadataHelper(ctx context.Context, c apipb.TasksClient, req *apipb.TasksWithPerfRequest) ([]*apipb.TaskRequestMetadataResponse, error)
- func ListTasksHelper(ctx context.Context, c apipb.TasksClient, req *apipb.TasksWithPerfRequest) ([]*apipb.TaskResultResponse, error)
- func MakeCASReference(digest, casInstance string) (*apipb.CASReference, error)
- func RetryTask(ctx context.Context, c SwarmingV2Client, req *apipb.TaskRequestResponse) (*apipb.TaskRequestMetadataResponse, error)
- func StringMapToBotDimensions(dims map[string][]string) []*apipb.StringListPair
- func StringMapToTaskDimensions(dims map[string]string) []*apipb.StringPair
- type SwarmingV2Client
- type WrappedClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BotDimensionsToStringMap ¶
func BotDimensionsToStringMap(dims []*apipb.StringListPair) map[string][]string
BotDimensionsToStringMap converts Swarming bot dimensions as represented in the Swarming API to a map[string][]string.
func BotDimensionsToStringSlice ¶
func BotDimensionsToStringSlice(dims []*apipb.StringListPair) []string
BotDimensionsToStringSlice converts Swarming bot dimensions as represented in the Swarming API to a []string.
func ConvertCIPDInput ¶
ConvertCIPDInput converts a slice of cipd.Package to a SwarmingRpcsCipdInput.
func DefaultPRPCClient ¶
DefaultPRPCClient returns a prpc.Client using default settings.
func DeleteBots ¶
DeleteBots performs multiple calls to DeleteBot in parallel.
func GetRequestMetadataForTasks ¶
func GetRequestMetadataForTasks(ctx context.Context, c apipb.TasksClient, tasks []*apipb.TaskResultResponse) ([]*apipb.TaskRequestMetadataResponse, error)
GetRequestMetadataForTasks returns the apipb.TaskRequestMetadataResponse for each of the given apipb.TaskResultResponses.
func GetTaskRequestProperties ¶
func GetTaskRequestProperties(t *apipb.TaskRequestResponse) *apipb.TaskProperties
GetTaskRequestProperties returns the SwarmingRpcsTaskProperties for the given SwarmingRpcsTaskRequestMetadata.
func ListBotsForPool ¶
func ListBotsForPool(ctx context.Context, c apipb.BotsClient, pool string) ([]*apipb.BotInfo, error)
ListBotsForPool retrieves all of the bots in the given pool.
func ListBotsHelper ¶
func ListBotsHelper(ctx context.Context, c apipb.BotsClient, req *apipb.BotsRequest) ([]*apipb.BotInfo, error)
ListBotsHelper makes multiple paginated requests to ListBots to retrieve all results.
func ListTaskRequestMetadataHelper ¶
func ListTaskRequestMetadataHelper(ctx context.Context, c apipb.TasksClient, req *apipb.TasksWithPerfRequest) ([]*apipb.TaskRequestMetadataResponse, error)
ListTaskRequestMetadataHelper is like ListTasksHelper but retrieves the apipb.TaskRequestMetadataResponse for each of the task. This is significantly more expensive, so it should only be used where necessary.
func ListTasksHelper ¶
func ListTasksHelper(ctx context.Context, c apipb.TasksClient, req *apipb.TasksWithPerfRequest) ([]*apipb.TaskResultResponse, error)
ListTasksHelper makes multiple paginated requests to ListTasks to retrieve all results.
func MakeCASReference ¶
func MakeCASReference(digest, casInstance string) (*apipb.CASReference, error)
MakeCASReference returns a CASReference which can be used as input to a Swarming task.
func RetryTask ¶
func RetryTask(ctx context.Context, c SwarmingV2Client, req *apipb.TaskRequestResponse) (*apipb.TaskRequestMetadataResponse, error)
RetryTask duplicates fields from the given request and triggers a new task as a retry of it.
func StringMapToBotDimensions ¶
func StringMapToBotDimensions(dims map[string][]string) []*apipb.StringListPair
StringMapToBotDimensions converts Swarming bot dimensions from a map[string][]string to their Swarming API representation.
func StringMapToTaskDimensions ¶
func StringMapToTaskDimensions(dims map[string]string) []*apipb.StringPair
StringMapToTaskDimensions converts Swarming task dimensions from a map[string]string to their Swarming API representation.
Types ¶
type SwarmingV2Client ¶
type SwarmingV2Client interface { apipb.BotsClient apipb.TasksClient }
SwarmingV2Client wraps a Swarming BotsClient and TasksClient.
type WrappedClient ¶
type WrappedClient struct { apipb.BotsClient apipb.TasksClient }
WrappedClient implements SwarmingV2Client by wrapping a BotsClient and a TasksClient
func NewClient ¶
func NewClient(prpcClient *prpc.Client) *WrappedClient
NewClient returns a SwarmingV2Client implementation.
func NewDefaultClient ¶
func NewDefaultClient(httpClient *http.Client, swarmingServer string) *WrappedClient
NewDefaultClient returns a SwarmingV2Client implementation using default PRPC client settings.