pub struct WireTransport { /* private fields */ }Expand description
gunnar-wire, wired to the SSH listener.
Implementations§
Source§impl WireTransport
impl WireTransport
Sourcepub fn new(stores: Arc<ServerStores>) -> Self
pub fn new(stores: Arc<ServerStores>) -> Self
Serve repositories out of stores.
Sourcepub fn with_wire_config(self, wire: WireConfig) -> Self
pub fn with_wire_config(self, wire: WireConfig) -> Self
Serve under wire rather than gunnar-wire’s defaults.
The whole of what makes WireConfig reachable. Without a call to
this, every knob on it is a comment.
Sourcepub fn with_metrics(self, metrics: Arc<ServerMetrics>) -> Self
pub fn with_metrics(self, metrics: Arc<ServerMetrics>) -> Self
Count into the server’s counters rather than into a private set.
gunnar serve mints one ServerMetrics and hands the same Arc here
and to the SSH listener, so connections_refused and pushes_rejected
are two readings of one server. A transport built without this still
counts, into a set only it can see, which is what a unit test wants.
Sourcepub fn with_bus(self, bus: Arc<EventBus>) -> Self
pub fn with_bus(self, bus: Arc<EventBus>) -> Self
Publish RefUpdated / RefDeleted / PushRejected / PushAttestation
to the event bus.
The bus is optional; the attestation log is not. A server started
with --no-grpc has nobody to notify, but the attestation’s durable record is not a
notification. It is the thing the event stream explicitly does not
promise to keep (see EventBus::publish), so the log is written either
way and only the publish is conditional.
Sourcepub fn attestation_log(&self) -> &AttestationLog
pub fn attestation_log(&self) -> &AttestationLog
Where the attestation’s JSON lines land.
Trait Implementations§
Source§impl GitTransport for WireTransport
impl GitTransport for WireTransport
Source§fn serve<'a>(
&'a self,
request: ServiceRequest,
stream: Box<dyn DuplexStream>,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'a>>
fn serve<'a>( &'a self, request: ServiceRequest, stream: Box<dyn DuplexStream>, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'a>>
Source§impl LfsTransport for WireTransport
The LFS object store, opened the one way — for the SSH session and for
the HTTP batch API alike (one implementation).
impl LfsTransport for WireTransport
The LFS object store, opened the one way — for the SSH session and for the HTTP batch API alike (one implementation).
The two surfaces used to be one call apart from having two answers to where
does this repository keep its LFS objects: serve_blocking reached for
stores.repo_store(...).git_dir() and anything else would have had to
re-derive it. It is <git_dir>/lfs/, the symlink check in
ServerStores::repo_dir is not optional on either path, and the handle the
store lock lives on is the same handle, so a repack and an LFS transfer
exclude each other the same way on both transports.
Source§fn open_lfs(
&self,
request: &ServiceRequest,
) -> Result<LfsAccess, TransportError>
fn open_lfs( &self, request: &ServiceRequest, ) -> Result<LfsAccess, TransportError>
request’s repository.Auto Trait Implementations§
impl !RefUnwindSafe for WireTransport
impl !UnwindSafe for WireTransport
impl Freeze for WireTransport
impl Send for WireTransport
impl Sync for WireTransport
impl Unpin for WireTransport
impl UnsafeUnpin for WireTransport
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request