Documentation ¶
Index ¶
Constants ¶
const ( // GitServiceRecvPack constant for receive-pack GitServiceRecvPack = GitServiceType("git-receive-pack") // GitServiceUploadPack constant for upload-pack GitServiceUploadPack = GitServiceType("git-upload-pack") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHTTPService ¶
type GitHTTPService struct {
// contains filtered or unexported fields
}
GitHTTPService is a git http server
func NewGitHTTPService ¶
func NewGitHTTPService(repostore repository.RepositoryStore, objstore ObjectStorage) *GitHTTPService
NewGitHTTPService instantiates the git http service with the provided repo store and object store.
func (*GitHTTPService) ListReferences ¶
func (svr *GitHTTPService) ListReferences(w http.ResponseWriter, r *http.Request)
ListReferences per the git protocol
func (*GitHTTPService) ReceivePack ¶
func (svr *GitHTTPService) ReceivePack(w http.ResponseWriter, r *http.Request)
ReceivePack implements the receive-pack protocol over http
func (*GitHTTPService) UploadPack ¶
func (svr *GitHTTPService) UploadPack(w http.ResponseWriter, r *http.Request)
UploadPack implements upload-pack protocol over http
type GitHandler ¶
type GitHandler interface { // clone, fetch, pull ??? UploadPack(w http.ResponseWriter, r *http.Request) // push ReceivePack(w http.ResponseWriter, r *http.Request) // list refs based on receive or upload pack ListReferences(w http.ResponseWriter, r *http.Request) }
GitHandler interface for git specific operations
type GitServiceType ¶
type GitServiceType string
GitServiceType can be either receive or upload pack
type MemObjectStorage ¶
type MemObjectStorage struct {
// contains filtered or unexported fields
}
MemObjectStorage manages objects stores by id i.e. repo
func NewMemObjectStorage ¶
func NewMemObjectStorage() *MemObjectStorage
func (*MemObjectStorage) GetStore ¶
func (mos *MemObjectStorage) GetStore(id string) storer.EncodedObjectStorer
GetStore for the given id. Create one if it does not exist
type ObjectStorage ¶
type ObjectStorage interface { // GetStore gets an object store given the id where the id is the namespace // for storage GetStore(string) storer.EncodedObjectStorer }
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
Protocol implements the git pack protocol
func NewProtocol ¶
NewProtocol instantiates a new protocol with the given reader and writer
func (*Protocol) ListReferences ¶
func (proto *Protocol) ListReferences(service GitServiceType, refs *repository.RepositoryReferences)
ListReferences writes the references in the pack protocol given the repository and service type
func (*Protocol) ReceivePack ¶
func (proto *Protocol) ReceivePack(repo *repository.Repository, repostore repository.RepositoryStore, objstore storer.EncodedObjectStorer) error
ReceivePack implements the git receive pack protocol
func (*Protocol) UploadPack ¶
func (proto *Protocol) UploadPack(store storer.EncodedObjectStorer) ([]byte, error)
UploadPack implements the git upload pack protocol
type RepoHTTPService ¶
type RepoHTTPService struct {
// contains filtered or unexported fields
}
func NewRepoHTTPService ¶
func NewRepoHTTPService(store repository.RepositoryStore) *RepoHTTPService
func (*RepoHTTPService) ServeHTTP ¶
func (svr *RepoHTTPService) ServeHTTP(w http.ResponseWriter, r *http.Request)
Directories ¶
Path | Synopsis |
---|---|
Package pktline implements pkt-line format encoding used by Git's transfer protocol.
|
Package pktline implements pkt-line format encoding used by Git's transfer protocol. |