Skip to contents

Wraps the background processx server process for one repository. Printing a session never reveals its token.

Methods


gitneighbr_session$new()

Create a session. Not normally called directly; use open_repo().

Usage

gitneighbr_session$new(process, host, port, token, repo_root)

Arguments

process

A live processx::process.

host, port

Where the server is bound.

token

The bearer token required by the API.

repo_root

The repository root this session serves.


gitneighbr_session$is_alive()

Is the server process still running?

Usage

gitneighbr_session$is_alive()


gitneighbr_session$repo_path()

The repository root this session serves.

Usage

gitneighbr_session$repo_path()


gitneighbr_session$url()

The session URL.

Usage

gitneighbr_session$url(redact = TRUE)

Arguments

redact

If TRUE (the default), omit the token fragment.


gitneighbr_session$browse()

Open the session, preferring the RStudio/Positron Viewer pane (via getOption("viewer"), the same hook shiny, profvis, and htmlwidgets use) and falling back to the default system browser everywhere else.

Usage

gitneighbr_session$browse()


gitneighbr_session$logs()

The last n lines of newly captured server output (both stdout and stderr), for troubleshooting. Each call drains the process's output buffer, so previously returned lines are not repeated.

Usage

gitneighbr_session$logs(n = 100L)

Arguments

n

Number of lines to return.


gitneighbr_session$stop()

Stop the server and clean up its process tree.

Usage

gitneighbr_session$stop()


gitneighbr_session$print()

Custom print method that never reveals the token.

Usage

gitneighbr_session$print(...)

Arguments

...

Unused; present for S3/R6 print-method compatibility.


gitneighbr_session$clone()

The objects of this class are cloneable with this method.

Usage

gitneighbr_session$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.