remote

package
v0.0.0-...-71af207 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 32 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLoggingCacheNotSupported = errors.New("logging cache is not supported")

ErrLoggingCacheNotSupported is an error indicating that the remote interface does not have a logging cache available.

Functions

func AttachService

func AttachService(ctx context.Context, manager jasper.Manager, s *grpc.Server) error

AttachService attaches the jasper GRPC server to the given manager. After this function successfully returns, calls to Manager functions will be sent over GRPC to the Jasper GRPC server.

func StartRPCService

func StartRPCService(ctx context.Context, manager jasper.Manager, addr net.Addr, creds *certdepot.Credentials) (util.CloseFunc, error)

StartRPCService starts an RPC server with the specified address addr around the given manager. If creds is non-nil, the credentials will be used to establish a secure TLS connection with clients; otherwise, it will start an insecure service. The caller is responsible for closing the connection using the returned jasper.CloseFunc.

func StartRPCServiceWithFile

func StartRPCServiceWithFile(ctx context.Context, manager jasper.Manager, addr net.Addr, filePath string) (util.CloseFunc, error)

StartRPCServiceWithFile is the same as StartService, but the credentials will be read from the file given by filePath if the filePath is non-empty. The credentials file should contain the JSON-encoded bytes from (*certdepot.Credentials).Export().

Types

type Manager

type Manager interface {
	jasper.Manager

	CloseConnection() error
	ConfigureCache(ctx context.Context, opts options.Cache) error
	DownloadFile(ctx context.Context, opts options.Download) error
	DownloadMongoDB(ctx context.Context, opts options.MongoDBDownload) error
	GetLogStream(ctx context.Context, id string, count int) (jasper.LogStream, error)
	GetBuildloggerURLs(ctx context.Context, id string) ([]string, error)
	SignalEvent(ctx context.Context, name string) error
	SendMessages(context.Context, options.LoggingPayload) error
}

Manager provides an interface to access all functionality from a Jasper service. It includes an interface to interact with Jasper Managers and Processes remotely as well as access to remote-specific functionality.

func NewRESTClient

func NewRESTClient(addr net.Addr) Manager

NewRESTClient creates a REST client with a new HTTP client that connects to the given address running the Jasper REST service. The HTTP client should be cleaned up by calling CloseConnection.

func NewRESTClientWithExistingClient

func NewRESTClientWithExistingClient(addr net.Addr, client *http.Client) Manager

NewRESTClientWithExistingClient creates a REST client that uses an existing HTTP client to connect to the given address running the Jasper REST service. This does not take ownership of the HTTP client, so the HTTP client is not cleaned up when CloseConnection is called.

func NewRPCClient

func NewRPCClient(ctx context.Context, addr net.Addr, creds *certdepot.Credentials) (Manager, error)

NewRPCClient creates a connection to the RPC service with the specified address addr. If creds is non-nil, the credentials will be used to establish a secure TLS connection with the service; otherwise, it will establish an insecure connection. The caller is responsible for closing the connection using the returned jasper.CloseFunc.

func NewRPCClientWithFile

func NewRPCClientWithFile(ctx context.Context, addr net.Addr, filePath string) (Manager, error)

NewRPCClientWithFile is the same as NewRPCClient but the credentials will be read from the file given by filePath if the filePath is non-empty. The credentials file should contain the JSON-encoded bytes from (*certdepot.Credentials).Export().

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service defines a REST service that provides a remote manager, using gimlet to publish routes.

func NewRESTService

func NewRESTService(m jasper.Manager) *Service

NewRESTService creates a service object around an existing manager. You must access the application and routes via the App() method separately.

func (*Service) App

func (s *Service) App(ctx context.Context) *gimlet.APIApp

App constructs and returns a gimlet application for this service. It attaches no middleware and does not start the service.

func (*Service) SetCacheMaxSize

func (s *Service) SetCacheMaxSize(size int)

SetCacheMaxSize sets the underlying option for the services cache.

func (*Service) SetDisableCachePruning

func (s *Service) SetDisableCachePruning(v bool)

SetDisableCachePruning toggles the underlying option for the services cache.

func (*Service) SetPruneDelay

func (s *Service) SetPruneDelay(dur time.Duration)

SetPruneDelay sets the underlying option for the services cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳