zip_streamer

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const UrlPrefixEnvVar = "ZS_URL_PREFIX"

Variables

This section is empty.

Functions

This section is empty.

Types

type FileEntry

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

func NewFileEntry

func NewFileEntry(urlString string, zipPath string) (*FileEntry, error)

func (*FileEntry) Url

func (f *FileEntry) Url() *url.URL

func (*FileEntry) ZipPath

func (f *FileEntry) ZipPath() string

type LinkCache

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

func NewLinkCache

func NewLinkCache(timeout *time.Duration) LinkCache

func (*LinkCache) Get

func (c *LinkCache) Get(linkKey string) *ZipDescriptor

func (*LinkCache) Set

func (c *LinkCache) Set(linkKey string, descriptor *ZipDescriptor)

type Server

type Server struct {
	Compression       bool
	ListfileUrlPrefix string
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server
func (s *Server) HandleCreateLink(w http.ResponseWriter, req *http.Request)
func (s *Server) HandleDownloadLink(w http.ResponseWriter, req *http.Request)

func (*Server) HandleGetDownload

func (s *Server) HandleGetDownload(w http.ResponseWriter, req *http.Request)

func (*Server) HandlePostDownload

func (s *Server) HandlePostDownload(w http.ResponseWriter, req *http.Request)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ZipDescriptor

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

func NewZipDescriptor

func NewZipDescriptor() *ZipDescriptor

func UnmarshalJsonZipDescriptor

func UnmarshalJsonZipDescriptor(payload []byte) (*ZipDescriptor, error)

func (ZipDescriptor) EscapedSuggestedFilename

func (zd ZipDescriptor) EscapedSuggestedFilename() string

Filename limited to US-ASCII per https://www.rfc-editor.org/rfc/rfc2183#section-2.3 Filter " as it's used to quote this filename

func (ZipDescriptor) Files

func (zd ZipDescriptor) Files() []*FileEntry

type ZipStream

type ZipStream struct {
	CompressionMethod uint16
	// contains filtered or unexported fields
}

func NewZipStream

func NewZipStream(entries []*FileEntry, w io.Writer) (*ZipStream, error)

func (*ZipStream) StreamAllFiles

func (z *ZipStream) StreamAllFiles() error

Jump to

Keyboard shortcuts

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