Documentation ¶
Index ¶
- Constants
- func CVDLogsDir(ctx cvd.CVDExecContext, groupName, name string) (string, error)
- func CreateCVD(ctx cvd.CVDExecContext, p startCVDParams) error
- func SliceItoa(s []uint32) []string
- func Untar(dst string, src string, owner *user.User) error
- func Unzip(dstDir string, src string, owner *user.User) error
- type AndroidBuild
- type BuildAPICredentials
- type CVDSelector
- type Config
- type Controller
- type CreateCVDAction
- type CreateCVDActionOpts
- type CreateCVDBugReportAction
- type CreateCVDBugReportActionOpts
- type CreateSnapshotAction
- type CreateSnapshotActionOpts
- type EmptyFieldError
- type ExecCVDCommandAction
- type ExecCVDCommandActionOpts
- type ExecContext
- type FetchArtifactsAction
- type FetchArtifactsActionOpts
- type HostValidator
- type IMPaths
- type ListCVDsAction
- type ListCVDsActionOpts
- type MapOM
- func (m *MapOM) Complete(name string, result *OperationResult) error
- func (m *MapOM) Get(name string) (apiv1.Operation, error)
- func (m *MapOM) GetResult(name string) (*OperationResult, error)
- func (m *MapOM) ListRunning() []apiv1.Operation
- func (m *MapOM) New() apiv1.Operation
- func (m *MapOM) Wait(name string, dt time.Duration) (*OperationResult, error)
- type NotFoundOperationError
- type OperationManager
- type OperationNotDoneError
- type OperationResult
- type OperationWaitTimeoutError
- type StartCVDAction
- type StartCVDActionOpts
- type UserArtifactChunk
- type UserArtifactsDirResolver
- type UserArtifactsManager
- type UserArtifactsManagerImpl
- func (m *UserArtifactsManagerImpl) ExtractArtifact(dir, name string) error
- func (m *UserArtifactsManagerImpl) GetDirPath(name string) string
- func (m *UserArtifactsManagerImpl) GetFilePath(dir, filename string) string
- func (m *UserArtifactsManagerImpl) ListDirs() (*apiv1.ListUploadDirectoriesResponse, error)
- func (m *UserArtifactsManagerImpl) NewDir() (*apiv1.UploadDirectory, error)
- func (m *UserArtifactsManagerImpl) UpdateArtifact(dir string, chunk UserArtifactChunk) error
- type UserArtifactsManagerOpts
- type Validator
Constants ¶
View Source
const BugReportZipFileName = "cvd_bugreport.zip"
View Source
const ErrMsgLaunchCVDFailed = "failed to launch cvd"
View Source
const HeaderBuildAPICreds = "X-Cutf-Host-Orchestrator-BuildAPI-Creds"
View Source
const HeaderUserProject = "X-Cutf-Host-Orchestrator-BuildAPI-Creds-User-Project-ID"
View Source
const (
URLQueryKeyIncludeAdbBugReport = "include_adb_bugreport"
)
Variables ¶
This section is empty.
Functions ¶
func CVDLogsDir ¶
func CVDLogsDir(ctx cvd.CVDExecContext, groupName, name string) (string, error)
func CreateCVD ¶
func CreateCVD(ctx cvd.CVDExecContext, p startCVDParams) error
Types ¶
type AndroidBuild ¶
type BuildAPICredentials ¶
type BuildAPICredentials struct { AccessToken string // The credential for exchanging access tokens should be generated from a GCP project that // has the Build API enabled. If it isn't, UserProjectID is required for successful API usage. // The value of UserProjectID is expected to be the project ID of a GCP project that has the // Build API enabled. This project ID can differ from the one used to generate OAuth credentials. UserProjectID string }
type CVDSelector ¶
func (*CVDSelector) ToCVDCLI ¶
func (s *CVDSelector) ToCVDCLI() []string
type Controller ¶
type Controller struct { Config Config OperationManager OperationManager WaitOperationDuration time.Duration UserArtifactsManager UserArtifactsManager DebugVariablesManager *debug.VariablesManager }
func (*Controller) AddRoutes ¶
func (c *Controller) AddRoutes(router *mux.Router)
type CreateCVDAction ¶
type CreateCVDAction struct {
// contains filtered or unexported fields
}
func NewCreateCVDAction ¶
func NewCreateCVDAction(opts CreateCVDActionOpts) *CreateCVDAction
type CreateCVDActionOpts ¶
type CreateCVDActionOpts struct { Request *apiv1.CreateCVDRequest HostValidator Validator Paths IMPaths OperationManager OperationManager ExecContext ExecContext BuildAPI artifacts.BuildAPI ArtifactsFetcher artifacts.Fetcher CVDBundleFetcher artifacts.CVDBundleFetcher UUIDGen func() string CVDUser *user.User UserArtifactsDirResolver UserArtifactsDirResolver BuildAPICredentials BuildAPICredentials }
type CreateCVDBugReportAction ¶
type CreateCVDBugReportAction struct {
// contains filtered or unexported fields
}
func NewCreateCVDBugReportAction ¶
func NewCreateCVDBugReportAction(opts CreateCVDBugReportActionOpts) *CreateCVDBugReportAction
type CreateCVDBugReportActionOpts ¶
type CreateCVDBugReportActionOpts struct { Group string IncludeADBBugreport bool Paths IMPaths OperationManager OperationManager ExecContext cvd.CVDExecContext UUIDGen func() string }
type CreateSnapshotAction ¶
type CreateSnapshotAction struct {
// contains filtered or unexported fields
}
func NewCreateSnapshotAction ¶
func NewCreateSnapshotAction(opts CreateSnapshotActionOpts) *CreateSnapshotAction
type CreateSnapshotActionOpts ¶
type CreateSnapshotActionOpts struct { Selector CVDSelector Paths IMPaths OperationManager OperationManager ExecContext ExecContext CVDUser *user.User }
type EmptyFieldError ¶
type EmptyFieldError string
func (EmptyFieldError) Error ¶
func (s EmptyFieldError) Error() string
type ExecCVDCommandAction ¶
type ExecCVDCommandAction struct {
// contains filtered or unexported fields
}
func NewExecCVDCommandAction ¶
func NewExecCVDCommandAction(opts ExecCVDCommandActionOpts) *ExecCVDCommandAction
type ExecCVDCommandActionOpts ¶
type ExecCVDCommandActionOpts struct { Command string Selector CVDSelector Paths IMPaths OperationManager OperationManager ExecContext ExecContext CVDUser *user.User }
type ExecContext ¶
type FetchArtifactsAction ¶
type FetchArtifactsAction struct {
// contains filtered or unexported fields
}
func NewFetchArtifactsAction ¶
func NewFetchArtifactsAction(opts FetchArtifactsActionOpts) *FetchArtifactsAction
type FetchArtifactsActionOpts ¶
type FetchArtifactsActionOpts struct { Request *apiv1.FetchArtifactsRequest Paths IMPaths OperationManager OperationManager BuildAPI artifacts.BuildAPI CVDBundleFetcher artifacts.CVDBundleFetcher ArtifactsFetcher artifacts.Fetcher UUIDGen func() string }
type HostValidator ¶
type HostValidator struct {
ExecContext ExecContext
}
Validates whether the current host is valid to run CVDs.
func (*HostValidator) Validate ¶
func (v *HostValidator) Validate() error
type ListCVDsAction ¶
type ListCVDsAction struct {
// contains filtered or unexported fields
}
func NewListCVDsAction ¶
func NewListCVDsAction(opts ListCVDsActionOpts) *ListCVDsAction
func (*ListCVDsAction) Run ¶
func (a *ListCVDsAction) Run() (*apiv1.ListCVDsResponse, error)
type ListCVDsActionOpts ¶
type ListCVDsActionOpts struct { Group string Paths IMPaths ExecContext ExecContext CVDUser *user.User }
type MapOM ¶
type MapOM struct {
// contains filtered or unexported fields
}
func (*MapOM) ListRunning ¶
type NotFoundOperationError ¶
type NotFoundOperationError string
func (NotFoundOperationError) Error ¶
func (s NotFoundOperationError) Error() string
type OperationManager ¶
type OperationManager interface { New() apiv1.Operation Get(name string) (apiv1.Operation, error) ListRunning() []apiv1.Operation GetResult(name string) (*OperationResult, error) Complete(name string, result *OperationResult) error // Waits for the specified operation to be DONE within the passed deadline. If the deadline // is reached `OperationWaitTimeoutError` will be returned. // NOTE: if dt is zero there's no timeout. Wait(name string, dt time.Duration) (*OperationResult, error) }
type OperationNotDoneError ¶
type OperationNotDoneError string
func (OperationNotDoneError) Error ¶
func (s OperationNotDoneError) Error() string
type OperationResult ¶
type OperationResult struct { Error error Value interface{} }
type OperationWaitTimeoutError ¶
type OperationWaitTimeoutError struct{}
func (OperationWaitTimeoutError) Error ¶
func (s OperationWaitTimeoutError) Error() string
type StartCVDAction ¶
type StartCVDAction struct {
// contains filtered or unexported fields
}
func NewStartCVDAction ¶
func NewStartCVDAction(opts StartCVDActionOpts) *StartCVDAction
type StartCVDActionOpts ¶
type StartCVDActionOpts struct { Request *apiv1.StartCVDRequest Selector CVDSelector Paths IMPaths OperationManager OperationManager ExecContext ExecContext CVDUser *user.User }
type UserArtifactChunk ¶
type UserArtifactsDirResolver ¶
type UserArtifactsDirResolver interface { // Given a directory name returns its full path. GetDirPath(name string) string }
Resolves the user artifacts full directory.
type UserArtifactsManager ¶
type UserArtifactsManager interface { UserArtifactsDirResolver // Creates a new directory for uploading user artifacts in the future. NewDir() (*apiv1.UploadDirectory, error) // List existing directories ListDirs() (*apiv1.ListUploadDirectoriesResponse, error) // Update artifact with the passed chunk. UpdateArtifact(dir string, chunk UserArtifactChunk) error // Extract artifact ExtractArtifact(dir, name string) error }
Abstraction for managing user artifacts for launching CVDs.
type UserArtifactsManagerImpl ¶
type UserArtifactsManagerImpl struct {
UserArtifactsManagerOpts
}
An implementation of the UserArtifactsManager interface.
func NewUserArtifactsManagerImpl ¶
func NewUserArtifactsManagerImpl(opts UserArtifactsManagerOpts) *UserArtifactsManagerImpl
Creates a new instance of UserArtifactsManagerImpl.
func (*UserArtifactsManagerImpl) ExtractArtifact ¶
func (m *UserArtifactsManagerImpl) ExtractArtifact(dir, name string) error
func (*UserArtifactsManagerImpl) GetDirPath ¶
func (m *UserArtifactsManagerImpl) GetDirPath(name string) string
func (*UserArtifactsManagerImpl) GetFilePath ¶
func (m *UserArtifactsManagerImpl) GetFilePath(dir, filename string) string
func (*UserArtifactsManagerImpl) ListDirs ¶
func (m *UserArtifactsManagerImpl) ListDirs() (*apiv1.ListUploadDirectoriesResponse, error)
func (*UserArtifactsManagerImpl) NewDir ¶
func (m *UserArtifactsManagerImpl) NewDir() (*apiv1.UploadDirectory, error)
func (*UserArtifactsManagerImpl) UpdateArtifact ¶
func (m *UserArtifactsManagerImpl) UpdateArtifact(dir string, chunk UserArtifactChunk) error
type UserArtifactsManagerOpts ¶
type UserArtifactsManagerOpts struct { // The root directory where to store the artifacts. RootDir string // Artifact owner. If nil, the owner will be the process's owner. Owner *user.User }
Options for creating instances of UserArtifactsManager implementations.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.