Documentation
¶
Index ¶
- Constants
- Variables
- func AttachService(ctx context.Context, manager jasper.Manager, s *grpc.Server) error
- func StartMDBService(ctx context.Context, m jasper.Manager, addr net.Addr) (util.CloseFunc, error)
- func StartRPCService(ctx context.Context, manager jasper.Manager, addr net.Addr, ...) (util.CloseFunc, error)
- func StartRPCServiceWithFile(ctx context.Context, manager jasper.Manager, addr net.Addr, filePath string) (util.CloseFunc, error)
- type Manager
- func NewMDBClient(ctx context.Context, addr net.Addr, reqTimeout time.Duration) (Manager, error)
- func NewRESTClient(addr net.Addr) Manager
- func NewRESTClientWithExistingClient(addr net.Addr, client *http.Client) Manager
- func NewRPCClient(ctx context.Context, addr net.Addr, creds *certdepot.Credentials) (Manager, error)
- func NewRPCClientWithFile(ctx context.Context, addr net.Addr, filePath string) (Manager, error)
- type Service
Constants ¶
const ( LoggingCacheCreateCommand = "logging_cache_create" LoggingCacheGetCommand = "logging_cache_get" LoggingCacheRemoveCommand = "logging_cache_remove" LoggingCacheCloseAndRemoveCommand = "logging_cache_close_and_remove" LoggingCacheClearCommand = "logging_cache_clear" LoggingCachePruneCommand = "logging_cache_prune" LoggingCacheLenCommand = "logging_cache_len" )
Constants representing logging cache commands.
const ( ManagerIDCommand = "id" CreateProcessCommand = "create_process" GetProcessCommand = "get_process" ListCommand = "list" GroupCommand = "group" ClearCommand = "clear" CloseCommand = "close" WriteFileCommand = "write_file" )
Constants representing manager commands.
const ( ConfigureCacheCommand = "configure_cache" DownloadFileCommand = "download_file" DownloadMongoDBCommand = "download_mongodb" GetLogStreamCommand = "get_log_stream" GetBuildloggerURLsCommand = "get_buildlogger_urls" SignalEventCommand = "signal_event" SendMessagesCommand = "send_messages" )
Constants representing remote client commands.
const ( ProcessIDCommand = "process_id" InfoCommand = "info" RunningCommand = "running" CompleteCommand = "complete" WaitCommand = "wait" RespawnCommand = "respawn" SignalCommand = "signal" RegisterSignalTriggerIDCommand = "register_signal_trigger_id" GetTagsCommand = "get_tags" TagCommand = "add_tag" ResetTagsCommand = "reset_tags" )
Constants representing process commands.
Variables ¶
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 ¶
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 StartMDBService ¶
StartMDBService wraps an existing Jasper manager in a MongoDB wire protocol service and starts it. The caller is responsible for closing the connection using the returned jasper.CloseFunc.
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 NewMDBClient ¶
NewMDBClient returns a remote client for connection to a MongoDB wire protocol service. reqTimeout specifies the timeout for a request, or uses a default timeout if zero.
func NewRESTClient ¶
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 ¶
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 ¶
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 ¶
NewRESTService creates a service object around an existing manager. You must access the application and routes via the App() method separately.
func (*Service) App ¶
App constructs and returns a gimlet application for this service. It attaches no middleware and does not start the service.
func (*Service) SetCacheMaxSize ¶
SetCacheMaxSize sets the underlying option for the services cache.
func (*Service) SetDisableCachePruning ¶
SetDisableCachePruning toggles the underlying option for the services cache.
func (*Service) SetPruneDelay ¶
SetPruneDelay sets the underlying option for the services cache.
Source Files
¶
- interface.go
- mdb_client.go
- mdb_client_logging_cache.go
- mdb_client_process.go
- mdb_io.go
- mdb_service.go
- mdb_service_logging_cache.go
- mdb_service_manager.go
- mdb_service_process.go
- rest_client.go
- rest_client_logging_cache.go
- rest_client_process.go
- rest_service.go
- rest_service_logging_cache.go
- rpc_client.go
- rpc_client_logging_cache.go
- rpc_client_process.go
- rpc_service.go