lib

package
v0.0.0-...-51f9457 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Overview

Package lib is used to implement the parent package main.

Index

Constants

View Source
const (

	// ServerEnvVar is Swarming server host to which a client connect.
	// Example: "chromium-swarm.appspot.com"
	ServerEnvVar = "SWARMING_SERVER"

	// TaskIDEnvVar is Swarming task ID in which this task is running.
	// The `swarming` command line tool uses this to populate `ParentTaskId`
	// when being used to trigger new tasks from within a swarming task.
	TaskIDEnvVar = "SWARMING_TASK_ID"

	// UserEnvVar is user name.
	// The `swarming` command line tool uses this to populate `User`
	// when being used to trigger new tasks.
	UserEnvVar = "USER"
)
View Source
const SwarmingVersion = "0.3"

SwarmingVersion must be updated whenever functional change (behavior, arguments, supported commands) is done.

Variables

View Source
var SwarmingUserAgent = "swarming-go/" + SwarmingVersion

SwarmingUserAgent stores the user agent name for this CLI.

Functions

func CmdBots

func CmdBots(authFlags AuthFlags) *subcommands.Command

CmdBots returns an object for the `bots` subcommand.

func CmdCollect

func CmdCollect(authFlags AuthFlags) *subcommands.Command

CmdCollect returns an object for the `collect` subcommand.

func CmdDeleteBots

func CmdDeleteBots(authFlags AuthFlags) *subcommands.Command

CmdDeleteBots returns an object for the `bots` subcommand.

func CmdReproduce

func CmdReproduce(authFlags AuthFlags) *subcommands.Command

CmdReproduce returns an object fo the `reproduce` subcommand.

func CmdRequestShow

func CmdRequestShow(authFlags AuthFlags) *subcommands.Command

CmdRequestShow returns an object for the `request-show` subcommand.

func CmdSpawnTasks

func CmdSpawnTasks(authFlags AuthFlags) *subcommands.Command

CmdSpawnTasks returns an object for the `spawn-tasks` subcommand.

func CmdTasks

func CmdTasks(authFlgas AuthFlags) *subcommands.Command

CmdTasks returns an object for the `tasks` subcommand.

func CmdTerminateBot

func CmdTerminateBot(authFlags AuthFlags) *subcommands.Command

CmdTerminateBot returns an object for the `terminate` subcommand.

func CmdTrigger

func CmdTrigger(authFlags AuthFlags) *subcommands.Command

CmdTrigger returns an object for the `trigger` subcommand.

Types

type AuthFlags

type AuthFlags interface {
	// Register registers auth flags to the given flag set. e.g. -service-account-json.
	Register(f *flag.FlagSet)

	// Parse parses auth flags.
	Parse() error

	// NewHTTPClient creates an authroised http.Client.
	NewHTTPClient(ctx context.Context) (*http.Client, error)

	// NewCASClient creates an authroised RBE Client.
	NewCASClient(ctx context.Context, instance string) (*rbeclient.Client, error)
}

AuthFlags is an interface to register auth flags and create http.Client and CAS Client.

type TriggerResults

type TriggerResults struct {
	// Tasks is a list of successfully triggered tasks represented as
	// TriggerResult values.
	Tasks []*swarming.SwarmingRpcsTaskRequestMetadata `json:"tasks"`
}

TriggerResults is a set of results from using the trigger subcommand, describing all of the tasks that were triggered successfully.

Jump to

Keyboard shortcuts

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