zipfly

package
v0.0.0-...-46f00a0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalPayload

func UnmarshalPayload(payload []byte) (*zipPayload, error)

Types

type Entry

type Entry struct {
	Url               string
	ZipPath           string
	CompressionMethod uint16
	ContentReader     io.ReadCloser
}

func NewEntry

func NewEntry(urlString string, zipPath string, compress bool) (*Entry, error)

func (*Entry) Content

func (e *Entry) Content() (io.ReadCloser, error)

func (*Entry) Size

func (e *Entry) Size() uint64

type File

type File struct {
	Url      string `json:"url"`
	Filename string `json:"filename"`
	Compress bool   `json:"compress,omitempty"`
}

type Server

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

func NewServer

func NewServer(env string, options ServerOptions) *Server

func (*Server) HandleGetStreamZip

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

func (*Server) HandlePostStreamZip

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

func (*Server) HealthCheck

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

func (*Server) ServeHTTP

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

type ServerOptions

type ServerOptions struct {
	ValidateSignature bool
	SigningSecret     string
	PublicUrl         string
}

type ZipStreamer

type ZipStreamer struct {
	Entries []*Entry
}

func NewZipStreamer

func NewZipStreamer(files []File) (*ZipStreamer, error)

func (*ZipStreamer) StreamFiles

func (z *ZipStreamer) StreamFiles(w io.Writer) error

Jump to

Keyboard shortcuts

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