gomote

package
Version: v0.0.0-...-28f7994 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: BSD-3-Clause Imports: 25 Imported by: 0

README

Go Reference

golang.org/x/build/internal/gomote

Package gomote contains all of the necessary components to implement and use the gomote functionality.

Documentation

Overview

Package gomote contains all of the necessary components to implement and use the gomote functionality. Gomotes are instances which are dedicated to an individual user or service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// embed the unimplemented server.
	protos.UnimplementedGomoteServiceServer
	// contains filtered or unexported fields
}

Server is a gomote server implementation.

func New

func New(rsp *remote.SessionPool, sched *schedule.Scheduler, rawCAPriKey []byte, gomoteGCSBucket string, storageClient *storage.Client) *Server

New creates a gomote server. If the rawCAPriKey is invalid, the program will exit.

func (*Server) AddBootstrap

AddBootstrap adds the bootstrap version of Go to an instance and returns the URL for the bootstrap version. If no bootstrap version is defined then the returned version URL will be empty.

func (*Server) Authenticate

Authenticate will allow the caller to verify that they are properly authenticated and authorized to interact with the Service.

func (*Server) CreateInstance

CreateInstance will create a gomote instance for the authenticated user.

func (*Server) DestroyInstance

DestroyInstance will destroy a gomote instance. It will ensure that the caller is authenticated and is the owner of the instance before it destroys the instance.

func (*Server) ExecuteCommand

ExecuteCommand will execute a command on a gomote instance. The output from the command will be streamed back to the caller if the output is set.

func (*Server) InstanceAlive

InstanceAlive will ensure that the gomote instance is still alive and will extend the timeout. The requester must be authenticated.

func (*Server) ListDirectory

ListDirectory lists the contents of the directory on a gomote instance.

func (*Server) ListInstances

ListInstances will list the gomote instances owned by the requester. The requester must be authenticated.

func (*Server) ReadTGZToURL

ReadTGZToURL retrieves a directory from the gomote instance and writes the file to GCS. It returns a signed URL which the caller uses to read the file from GCS.

func (*Server) RemoveFiles

RemoveFiles removes files or directories from the gomote instance.

func (*Server) SignSSHKey

SignSSHKey signs the public SSH key with a certificate. The signed public SSH key is intended for use with the gomote service SSH server. It will be signed by the certificate authority of the server and will restrict access to the gomote instance that it was signed for.

func (*Server) UploadFile

UploadFile creates a URL and a set of HTTP post fields which are used to upload a file to a staging GCS bucket. Uploaded files are made available to the gomote instances via a subsequent call to one of the WriteFromURL endpoints.

func (*Server) WriteFileFromURL

WriteFileFromURL initiates an HTTP request to the passed in URL and streams the contents of the request to the gomote instance.

func (*Server) WriteTGZFromURL

WriteTGZFromURL will instruct the gomote instance to download the tar.gz from the provided URL. The tar.gz file will be unpacked in the work directory relative to the directory provided.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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