apt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AptMessage

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

AptMessage represents a single RFC822 Apt message.

func (*AptMessage) Get

func (m *AptMessage) Get(key string) string

Get returns the first AptMessage Field for `key`, or "".

func (*AptMessage) String

func (m *AptMessage) String() string

type AptMessageReader

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

AptMessageReader supports reading Apt messages.

func NewAptMessageReader

func NewAptMessageReader(r *bufio.Reader) *AptMessageReader

NewAptMessageReader returns an AptMessageReader.

func (*AptMessageReader) ReadMessage

func (r *AptMessageReader) ReadMessage(ctx context.Context) (*AptMessage, error)

ReadMessage reads lines from `reader` until a complete message is received.

type AptMessageWriter

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

AptMessageWriter supports writing Apt messages.

func NewAptMessageWriter

func NewAptMessageWriter(w io.Writer) *AptMessageWriter

NewAptMessageWriter returns an AptMessageWriter.

func (*AptMessageWriter) Fail

func (w *AptMessageWriter) Fail(msg string) error

Fail writes a 401 General Failure message.

func (*AptMessageWriter) FailURI

func (w *AptMessageWriter) FailURI(uri, msg string) error

FailURI writes a 400 URI Failure message.

func (*AptMessageWriter) Log

func (w *AptMessageWriter) Log(msg string) error

Log writes a 101 Log message.

func (*AptMessageWriter) SendCapabilities

func (w *AptMessageWriter) SendCapabilities() error

SendCapabilities writes a 100 Capabilities message.

func (*AptMessageWriter) URIDone

func (w *AptMessageWriter) URIDone(uri, size, lastModified, md5Hash, filename string, ims bool) error

URIDone writes a 201 URI Done message.

func (*AptMessageWriter) URIStart

func (w *AptMessageWriter) URIStart(uri, size, lastModified string) error

URIStart writes a 200 URI Start message.

func (*AptMessageWriter) WriteMessage

func (w *AptMessageWriter) WriteMessage(m AptMessage) error

WriteMessage writes an AptMessage.

type AptMethod

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

AptMethod represents the method handler.

func NewAptMethod

func NewAptMethod(input *bufio.Reader, output io.Writer) *AptMethod

NewAptMethod returns an AptMethod.

func (*AptMethod) Run

func (m *AptMethod) Run(ctx context.Context)

Run runs the method.

Jump to

Keyboard shortcuts

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