Documentation ¶
Index ¶
- Constants
- func CVDLogsDir(ctx cvd.CVDExecContext, name string) (string, error)
- func HostBugReport(ctx cvd.CVDExecContext, paths IMPaths, out string) error
- func SliceItoa(s []uint32) []string
- func Untar(dst string, src string) error
- func Unzip(dstDir string, src string) error
- type AndroidBuild
- type CVDSelector
- type Config
- type Controller
- type CreateCVDAction
- type CreateCVDActionOpts
- 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) 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 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 ErrMsgLaunchCVDFailed = "failed to launch cvd"
View Source
const HeaderBuildAPICreds = "X-Cutf-Host-Orchestrator-BuildAPI-Creds"
Variables ¶
This section is empty.
Functions ¶
func CVDLogsDir ¶
func CVDLogsDir(ctx cvd.CVDExecContext, name string) (string, error)
func HostBugReport ¶
func HostBugReport(ctx cvd.CVDExecContext, paths IMPaths, out string) error
Types ¶
type AndroidBuild ¶
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 string CVDStartTimeout time.Duration UserArtifactsDirResolver UserArtifactsDirResolver BuildAPICredentials string }
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 string }
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 { Paths IMPaths ExecContext ExecContext CVDUser string }
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) 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 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 // Factory of name values NameFactory func() string }
Options for creating instances of UserArtifactsManager implementations.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.