Help us shape the future of Go! Take the 2026 Go Developer Survey

yaz

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(root string) (string, error)

Compress a package

func CompressTo

func CompressTo(root string, output string) error

CompressTo builds a package and saves it to a file

func Decrypt

func Decrypt(cipher Cipher, reader io.Reader, writer io.Writer) error

Decrypt a package

func DecryptBytes

func DecryptBytes(cipher Cipher, data []byte) ([]byte, error)

DecryptBytes decrypts a byte slice

func DecryptFile

func DecryptFile(cipher Cipher, file string, output string) error

DecryptFile decrypts a file

func Encrypt

func Encrypt(cipher Cipher, reader io.Reader, writer io.Writer) error

Encrypt a package

func EncryptBytes

func EncryptBytes(cipher Cipher, data []byte) ([]byte, error)

EncryptBytes encrypts a byte slice

func EncryptFile

func EncryptFile(cipher Cipher, file string, output string) error

EncryptFile encrypts a file

func Pack

func Pack(root string, cipher Cipher) (string, error)

Pack a package

func PackTo

func PackTo(root string, output string, cipher Cipher) error

PackTo packs a package and saves it to a file

func Uncompress

func Uncompress(reader io.Reader) (string, error)

Uncompress a package

func UncompressFile

func UncompressFile(file string) (string, error)

UncompressFile a package

func UncompressFileTo

func UncompressFileTo(file string, output string) error

UncompressFileTo uncompress a package to a specified directory.

func UncompressTo

func UncompressTo(reader io.Reader, output string) error

UncompressTo uncompress a package to a specified directory.

func Unpack

func Unpack(file string, cipher Cipher) (string, error)

Unpack a package

func UnpackTo

func UnpackTo(file string, output string, cipher Cipher) error

UnpackTo unpacks a package to a directory

Types

type Cipher

type Cipher interface {
	Encrypt(reader io.Reader, writer io.Writer) error
	Decrypt(reader io.Reader, writer io.Writer) error
}

Cipher is a type that represents a cipher.

type Dir

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

Dir is the public path

func (Dir) Open

func (dir Dir) Open(name string) (http.File, error)

Open implements FileSystem using os.Open, opening files for reading rooted

type File

type File struct {
	*os.File
	// contains filtered or unexported fields
}

File is the file

func (*File) Close

func (file *File) Close() error

Close closes the File, rendering it unusable for I/O.

func (*File) Read

func (file *File) Read(p []byte) (n int, err error)

Read reads up to len(p) bytes into p.

type Yaz

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

Yaz is a type that represents a package.

func Open

func Open(reader io.Reader, file string, cipher Cipher, cache ...bool) (*Yaz, error)

Open opens a package file.

func OpenCache

func OpenCache(file string, cipher Cipher) (*Yaz, error)

OpenCache opens a package file from cache

func OpenFile

func OpenFile(file string, cipher Cipher, cache ...bool) (*Yaz, error)

OpenFile opens a package file.

func (*Yaz) Exists

func (yaz *Yaz) Exists(name string) (bool, error)

Exists checks if a file exists in the package.

func (*Yaz) FS

func (yaz *Yaz) FS(root string) http.FileSystem

FS returns a http.FileSystem that serves files from the public directory

func (*Yaz) Glob

func (yaz *Yaz) Glob(pattern string) (matches []string, err error)

Glob searches for files in the package.

func (*Yaz) Info

func (yaz *Yaz) Info(name string) (os.FileInfo, error)

Info the file info

func (*Yaz) Read

func (yaz *Yaz) Read(name string) ([]byte, error)

Read reads a file from the package.

func (*Yaz) Remove

func (yaz *Yaz) Remove(name string) error

Remove removes a file from the package.

func (*Yaz) Root

func (yaz *Yaz) Root() string

Root return the root path

func (*Yaz) Walk

func (yaz *Yaz) Walk(root string, handler func(root, filename string, isdir bool) error, patterns ...string) error

Walk walks the package file.

func (*Yaz) Watch

func (yaz *Yaz) Watch(handler func(event string, name string), interrupt chan uint8) error

Watch watches the package file.

func (*Yaz) Write

func (yaz *Yaz) Write(name string, content []byte) error

Write writes a file to the package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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