Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plumbing: transport, refactor and define transport operations #3

Draft
wants to merge 5 commits into
base: v6-transport-packp
Choose a base branch
from

Conversation

aymanbagabas
Copy link
Owner

This change redefines the transport package to be more modular and extensible. It redefines the transport.Transport, transport.Session, and transport.Commander and transport.Command interfaces. It also introduces a new transport.Connection that abstracts the logic of sending and receiving git data to and from a server.

There are 2 main transports. The pack transport which is a full-duplex command based transport that uses transport.PackSession. And the other is the HTTP transport which is a half-duplex transport that uses transport.HTTPSession. All of file, git, and ssh transports use the pack transport.

The rest of the abstractions are defined in transport.NegotiatePack, transport.FetchPack, transport.UploadPack, transport.SendPack, and tansport.ReceivePack. All of these static functions are used by the transport.Connection to send and receive data to and from a storage.Storer interface type.

Reference: https://gist.github.com/aymanbagabas/1b5ccc265ee62dd574c62d378b4b57bb

refactor transport: plumbing: packp, refactor types (1/5)
@aymanbagabas aymanbagabas force-pushed the v6-transport-transport branch from f077b31 to 2d37d80 Compare January 1, 2025 13:51
This change redefines the transport package to be more modular and
extensible. It redefines the `transport.Transport`, `transport.Session`,
and `transport.Commander` and `transport.Command` interfaces. It also
introduces a new `transport.Connection` that abstracts the logic of
sending and receiving git data to and from a server.

There are 2 main transports. The pack transport which is a full-duplex
command based transport that uses `transport.PackSession`. And the other
is the HTTP transport which is a half-duplex transport that uses
`transport.HTTPSession`. All of file, git, and ssh transports use the
pack transport.

The rest of the abstractions are defined in `transport.NegotiatePack`,
`transport.FetchPack`, `transport.UploadPack`, `transport.SendPack`, and
`tansport.ReceivePack`. All of these static functions are used by the
`transport.Connection` to send and receive data to and from a
`storage.Storer` interface type.

Reference: https://gist.github.com/aymanbagabas/1b5ccc265ee62dd574c62d378b4b57bb
We no longer need a separate package for the server protocol, as it is
now implemented in the transport package.
It makes more sense to have this living in the transport package, as it
is related to the transport layer.
@aymanbagabas aymanbagabas force-pushed the v6-transport-transport branch from 2d37d80 to 95f4718 Compare January 1, 2025 13:57
Co-authored-by: Paulo Gomes <[email protected]>

Update remote.go

Co-authored-by: Paulo Gomes <[email protected]>
@aymanbagabas aymanbagabas force-pushed the v6-transport-transport branch from a639d95 to 2279b8a Compare January 1, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants