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: server, remove package in favor of transport #4

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

Conversation

aymanbagabas
Copy link
Owner

We no longer need a separate package for the server protocol, as it is now implemented in the transport package.

This change makes packp types follow the git protocol and simplifies the
implementation of `Encode` and `Decode` methods to be consistent with
the rest of the types.

Reference: https://git-scm.com/docs/gitprotocol-pack
This type is used to represent HTTP smart protocol service payload
request and response.
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
@aymanbagabas aymanbagabas force-pushed the v6-transport-transport branch from 0319a50 to 130063f Compare December 29, 2024 18:25
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 7 times, most recently from 2d37d80 to 95f4718 Compare January 1, 2025 13:57
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.

1 participant