Documentation
¶
Index ¶
- type BoxArchiveHeadResult
- type Service
- func (s *Service) ArchiveHead(ctx context.Context, boxID string, path string) (*BoxArchiveHeadResult, error)
- func (s *Service) BoxActionClick(ctx context.Context, id string, params *model.BoxActionClickParams) (*model.BoxActionClickResult, error)
- func (s *Service) BoxActionDrag(ctx context.Context, id string, params *model.BoxActionDragParams) (*model.BoxActionDragResult, error)
- func (s *Service) BoxActionMove(ctx context.Context, id string, params *model.BoxActionMoveParams) (*model.BoxActionMoveResult, error)
- func (s *Service) BoxActionPress(ctx context.Context, id string, params *model.BoxActionPressParams) (*model.BoxActionPressResult, error)
- func (s *Service) BoxActionScreenshot(ctx context.Context, id string, params *model.BoxActionScreenshotParams) (*model.BoxActionScreenshotResult, error)
- func (s *Service) BoxActionScroll(ctx context.Context, id string, params *model.BoxActionScrollParams) (*model.BoxActionScrollResult, error)
- func (s *Service) BoxActionTouch(ctx context.Context, id string, params *model.BoxActionTouchParams) (*model.BoxActionTouchResult, error)
- func (s *Service) BoxActionType(ctx context.Context, id string, params *model.BoxActionTypeParams) (*model.BoxActionTypeResult, error)
- func (s *Service) CreateAndroidBox(ctx context.Context, req *model.AndroidBoxCreateParam) (*model.Box, error)
- func (s *Service) CreateLinuxBox(ctx context.Context, req *model.LinuxAndroidBoxCreateParam) (*model.Box, error)
- func (s *Service) Delete(ctx context.Context, id string, req *model.BoxDeleteParams) (*model.BoxDeleteResult, error)
- func (s *Service) DeleteAll(ctx context.Context, req *model.BoxesDeleteParams) (*model.BoxesDeleteResult, error)
- func (s *Service) Exec(ctx context.Context, id string, req *model.BoxExecParams) (*model.BoxExecResult, error)
- func (s *Service) ExecWS(ctx context.Context, id string, params *model.BoxExecWSParams, ...) (*model.BoxExecResult, error)
- func (s *Service) ExtractArchive(ctx context.Context, id string, req *model.BoxArchiveExtractParams) error
- func (s *Service) Get(ctx context.Context, id string) (*model.Box, error)
- func (s *Service) GetArchive(ctx context.Context, id string, req *model.BoxArchiveGetParams) (*model.BoxArchiveResult, io.ReadCloser, error)
- func (s *Service) GetExternalPort(ctx context.Context, id string, internalPort int) (int, error)
- func (s *Service) HeadArchive(ctx context.Context, id string, req *model.BoxArchiveHeadParams) (*model.BoxArchiveHeadResult, error)
- func (s *Service) List(ctx context.Context, params *model.BoxListParams) (*model.BoxListResult, error)
- func (s *Service) ListFiles(ctx context.Context, id string, params *model.BoxFileListParams) (*model.BoxFileListResult, error)
- func (s *Service) ReadFile(ctx context.Context, id string, params *model.BoxFileReadParams) (*model.BoxFileReadResult, error)
- func (s *Service) Reclaim(ctx context.Context) (*model.BoxReclaimResult, error)
- func (s *Service) RunCode(ctx context.Context, id string, req *model.BoxRunCodeParams) (*model.BoxRunCodeResult, error)
- func (s *Service) Start(ctx context.Context, id string) (*model.BoxStartResult, error)
- func (s *Service) Stop(ctx context.Context, id string) (*model.BoxStopResult, error)
- func (s *Service) WriteFile(ctx context.Context, id string, params *model.BoxFileWriteParams) (*model.BoxFileWriteResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoxArchiveHeadResult ¶
type BoxArchiveHeadResult struct {
Mode uint32 `json:"mode"` // File mode
Size int64 `json:"size"` // File size
}
BoxArchiveHeadResult represents the result of a box archive head operation
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the box service interface using Kubernetes
func NewService ¶
func NewService(tracker tracker.AccessTracker) (*Service, error)
NewService creates a new Kubernetes service instance
func (*Service) ArchiveHead ¶
func (s *Service) ArchiveHead(ctx context.Context, boxID string, path string) (*BoxArchiveHeadResult, error)
ArchiveHead returns the metadata for a file in a box
func (*Service) BoxActionClick ¶
func (s *Service) BoxActionClick(ctx context.Context, id string, params *model.BoxActionClickParams) (*model.BoxActionClickResult, error)
func (*Service) BoxActionDrag ¶
func (s *Service) BoxActionDrag(ctx context.Context, id string, params *model.BoxActionDragParams) (*model.BoxActionDragResult, error)
func (*Service) BoxActionMove ¶
func (s *Service) BoxActionMove(ctx context.Context, id string, params *model.BoxActionMoveParams) (*model.BoxActionMoveResult, error)
func (*Service) BoxActionPress ¶
func (s *Service) BoxActionPress(ctx context.Context, id string, params *model.BoxActionPressParams) (*model.BoxActionPressResult, error)
func (*Service) BoxActionScreenshot ¶
func (s *Service) BoxActionScreenshot(ctx context.Context, id string, params *model.BoxActionScreenshotParams) (*model.BoxActionScreenshotResult, error)
func (*Service) BoxActionScroll ¶
func (s *Service) BoxActionScroll(ctx context.Context, id string, params *model.BoxActionScrollParams) (*model.BoxActionScrollResult, error)
func (*Service) BoxActionTouch ¶
func (s *Service) BoxActionTouch(ctx context.Context, id string, params *model.BoxActionTouchParams) (*model.BoxActionTouchResult, error)
func (*Service) BoxActionType ¶
func (s *Service) BoxActionType(ctx context.Context, id string, params *model.BoxActionTypeParams) (*model.BoxActionTypeResult, error)
func (*Service) CreateAndroidBox ¶
func (s *Service) CreateAndroidBox(ctx context.Context, req *model.AndroidBoxCreateParam) (*model.Box, error)
CreateAndroidBox creates a new android box
func (*Service) CreateLinuxBox ¶
func (s *Service) CreateLinuxBox(ctx context.Context, req *model.LinuxAndroidBoxCreateParam) (*model.Box, error)
CreateLinuxBox creates a new linux box
func (*Service) Delete ¶
func (s *Service) Delete(ctx context.Context, id string, req *model.BoxDeleteParams) (*model.BoxDeleteResult, error)
Delete deletes a box by ID
func (*Service) DeleteAll ¶
func (s *Service) DeleteAll(ctx context.Context, req *model.BoxesDeleteParams) (*model.BoxesDeleteResult, error)
DeleteAll deletes all boxes
func (*Service) Exec ¶
func (s *Service) Exec(ctx context.Context, id string, req *model.BoxExecParams) (*model.BoxExecResult, error)
Exec executes a command in a box
func (*Service) ExecWS ¶
func (s *Service) ExecWS(ctx context.Context, id string, params *model.BoxExecWSParams, wsConn *websocket.Conn) (*model.BoxExecResult, error)
ExecWS executes a command in a box via WebSocket (Not Implemented for K8s)
func (*Service) ExtractArchive ¶
func (s *Service) ExtractArchive(ctx context.Context, id string, req *model.BoxArchiveExtractParams) error
ExtractArchive extracts tar archive to box
func (*Service) GetArchive ¶
func (s *Service) GetArchive(ctx context.Context, id string, req *model.BoxArchiveGetParams) (*model.BoxArchiveResult, io.ReadCloser, error)
GetArchive gets files from box as tar archive
func (*Service) GetExternalPort ¶
GetExternalPort retrieves the host port mapping for a specific internal port of a box. It assumes a Kubernetes Service of type NodePort exists with the same name as the box ID.
func (*Service) HeadArchive ¶
func (s *Service) HeadArchive(ctx context.Context, id string, req *model.BoxArchiveHeadParams) (*model.BoxArchiveHeadResult, error)
HeadArchive returns the metadata for a file in a box
func (*Service) List ¶
func (s *Service) List(ctx context.Context, params *model.BoxListParams) (*model.BoxListResult, error)
List returns all boxes
func (*Service) ListFiles ¶
func (s *Service) ListFiles(ctx context.Context, id string, params *model.BoxFileListParams) (*model.BoxFileListResult, error)
func (*Service) ReadFile ¶
func (s *Service) ReadFile(ctx context.Context, id string, params *model.BoxFileReadParams) (*model.BoxFileReadResult, error)
func (*Service) RunCode ¶
func (s *Service) RunCode(ctx context.Context, id string, req *model.BoxRunCodeParams) (*model.BoxRunCodeResult, error)
RunCode runs a command in a box