gitpktline

package
v0.26.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

https://git-scm.com/docs/pack-protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LongRunningProcess

type LongRunningProcess struct {
	// contains filtered or unexported fields
}

func NewLongRunningProcess

func NewLongRunningProcess(r io.Reader, w io.Writer, caps []string) *LongRunningProcess

func (*LongRunningProcess) Handshake

func (p *LongRunningProcess) Handshake(caps []string) error

Handshake initates the handshake with the parent git process, advertises the given capabilities.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader reads git-pkt-line formatted slices.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a new git-pkt-line reader.

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

https://git-scm.com/docs/protocol-common

func (*Reader) ReadPacket

func (r *Reader) ReadPacket() ([]byte, error)

ReadPacket reads and returns then next packet (line). The returned buffer is valid only till the next call to ReadPacket/Read.

func (*Reader) ReadPackets

func (r *Reader) ReadPackets() ([][]byte, error)

ReadPackets reads the input till a flush packet.

type Writer

type Writer struct{ io.Writer }

Writer writes in git-pkt-line format (prefix each line with hex-encoded line length, including the first 4 bytes.

func NewWriter

func NewWriter(w io.Writer) Writer

func (Writer) Write

func (w Writer) Write(p []byte) (int, error)

func (Writer) WritePackets

func (w Writer) WritePackets(pkts ...[]byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL