Documentation ¶
Overview ¶
Package archiveserver implements an HTTP server for downloading archives.
See: https://www.notion.so/2023-04-03-HTTP-file-and-archive-downloads-cfb56fac16e54957b015070416b09e94
Index ¶
Constants ¶
const (
EncodingVersion1 = uint8(0x01)
)
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode begins the decoding process; all versions are base64url-encoded bytes prefixed with a uint8 version number. Decode returns a reader of the bytes right after the version, and the version number.
func DecodeV1 ¶
DecodeV1 returns a bufio.Scanner that returns each encoded path. The reader should already be read past the version number; Decode() above does exactly this.
func DecodeV1Path ¶
DecodeV1Path decodes a V1 path. pachctl's convention of branch=commit is not supported.
Types ¶
type ArchiveFormat ¶
type ArchiveFormat string
ArchiveFormat is the file format to produce.
const (
ArchiveFormatZip ArchiveFormat = "zip" // A ZIP file.
)
func (ArchiveFormat) ContentType ¶
func (f ArchiveFormat) ContentType() string
type ArchiveRequest ¶
type ArchiveRequest struct { Format ArchiveFormat // The desired format of the archive. // contains filtered or unexported fields }
An ArchiveRequest is a valid archive download URL.
func ArchiveFromURL ¶
func ArchiveFromURL(u *url.URL) (*ArchiveRequest, error)
ArchiveFromURL parses a URL into an ArchiveRequest.
func (*ArchiveRequest) ForEachPath ¶
func (req *ArchiveRequest) ForEachPath(cb func(path string) error) error
ForEachPath calls the callback with each requested file.