Documentation ¶
Index ¶
- Constants
- 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 MakeRestClient(addr net.Addr, client *http.Client) Manager
- func NewMDBClient(ctx context.Context, addr net.Addr, reqTimeout time.Duration) (Manager, error)
- func NewRPCClient(ctx context.Context, addr net.Addr, creds *options.CertificateCredentials) (Manager, error)
- func NewRPCClientWithFile(ctx context.Context, addr net.Addr, filePath string) (Manager, error)
- func NewRestClient(addr net.Addr) Manager
- type Service
Constants ¶
const ( DownloadFileCommand = "download_file" GetLogStreamCommand = "get_log_stream" SignalEventCommand = "signal_event" )
Constants representing remote client commands.
const ( LoggingSendMessagesCommand = "send_messages" LoggingCacheSizeCommand = "logging_cache_size" LoggingCacheCreateCommand = "logging_cache_create" LoggingCacheDeleteCommand = "logging_cache_remove" LoggingCacheCloseAndRemoveCommand = "logging_cache_close_and_remove" LoggingCacheClearCommand = "logging_cache_clear" LoggingCacheGetCommand = "logging_cache_get" LoggingCachePruneCommand = "logging_cache_prune" )
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 ( 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.
const ( ScriptingCreateCommand = "create_scripting" ScriptingGetCommand = "get_scripting" ScriptingSetupCommand = "setup_scripting" ScriptingCleanupCommand = "cleanup_scripting" ScriptingRunCommand = "run_scripting" ScriptingRunScriptCommand = "run_script_scripting" ScriptingBuildCommand = "build_scripting" ScriptingTestCommand = "test_scripting" )
Variables ¶
This section is empty.
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 *options.CertificateCredentials, opts ...grpc.ServerOption) (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.
This service does not have any kind of interceptors (middleware) or logging configured, and panics are not handled. Passing interceptors from the aviation package or grpc-middleware as gprc.ServerOptions to this function can handle that.
func StartRPCServiceWithFile ¶
func StartRPCServiceWithFile(ctx context.Context, manager jasper.Manager, addr net.Addr, filePath string, opts ...grpc.ServerOption) (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 (*Credentials).Export().
Types ¶
type Manager ¶
type Manager interface { jasper.Manager CloseConnection() error DownloadFile(ctx context.Context, opts options.Download) error GetLogStream(ctx context.Context, id string, count int) (jasper.LogStream, error) SignalEvent(ctx context.Context, name string) error CreateScripting(context.Context, options.ScriptingHarness) (scripting.Harness, error) GetScripting(context.Context, string) (scripting.Harness, 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 MakeRestClient ¶
MakeRestClient constructs a REST client that connects to the given address running the Jasper REST service and the specified HTTP client.
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 NewRPCClient ¶
func NewRPCClient(ctx context.Context, addr net.Addr, creds *options.CertificateCredentials) (Manager, error)
NewClient 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 ¶
NewClientWithFile is the same as NewClient 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().
func NewRestClient ¶
NewRestClient creates a REST client that connects to the given address running the Jasper REST service. This function uses the http package's default client.
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 ¶
NewManagerService creates a service object around an existing manager. You must access the application and routes via the App() method separately. The constructor wraps basic managers with a manager implementation that does locking.
Source Files ¶
- interface.go
- mdb_client.go
- mdb_client_logging_cache.go
- mdb_io.go
- mdb_process.go
- mdb_service.go
- mdb_service_logging.go
- mdb_service_manager.go
- mdb_service_process.go
- mdb_service_scripting.go
- rest_client.go
- rest_client_logging_cache.go
- rest_service.go
- rpc_client.go
- rpc_client_logging_cache.go
- rpc_service.go