zipwrite

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package zipwrite provides good enough write-only file system implementation for the artifactcollector to create zip files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

FS implements a write-only file system for zip files.

func New

func New(writer io.Writer) *FS

New creates a new zipwrite FS.

func (*FS) Chmod

func (fs *FS) Chmod(name string, mode os.FileMode) error

Chmod changes the mode of the named file to mode.

func (*FS) Chtimes

func (fs *FS) Chtimes(name string, atime time.Time, mtime time.Time) error

Chtimes changes the access and modification times of the named file.

func (*FS) Close

func (fs *FS) Close() error

Close closes the file freeing the resource. Usually additional IO operations fail after closing.

func (*FS) Create

func (fs *FS) Create(name string) (afero.File, error)

Create creates a file in the filesystem, returning the file and an error, if any happens.

func (*FS) Mkdir

func (fs *FS) Mkdir(name string, perm os.FileMode) error

Mkdir creates a directory in the filesystem, return an error if any happens.

func (*FS) MkdirAll

func (fs *FS) MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a directory path and all parents that does not exist yet.

func (*FS) Name

func (fs *FS) Name() string

Name returns the name of this file system.

func (*FS) Open

func (fs *FS) Open(name string) (afero.File, error)

Open opens a file, returning it or an error, if any happens.

func (*FS) OpenFile

func (fs *FS) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

OpenFile opens a file using the given flags and the given mode.

func (*FS) Remove

func (fs *FS) Remove(name string) error

Remove removes a file identified by name, returning an error, if any happens.

func (*FS) RemoveAll

func (fs *FS) RemoveAll(path string) error

RemoveAll removes a directory path and any children it contains. It does not fail if the path does not exist (return nil).

func (*FS) Rename

func (fs *FS) Rename(oldname, newname string) error

Rename renames a file.

func (*FS) Stat

func (fs *FS) Stat(name string) (os.FileInfo, error)

Stat returns a RootInfo describing the named file, or an error, if any happens.

type Item

type Item struct {
	io.Writer
	// contains filtered or unexported fields
}

Item describes files and directories in the XXX file system.

func (Item) Close

func (i Item) Close() error

Close does not do anything.

func (Item) Name

func (i Item) Name() string

Name returns the name of the file.

func (Item) Read

func (i Item) Read(b []byte) (n int, err error)

Read fails in a write-only fs.

func (Item) ReadAt

func (i Item) ReadAt(b []byte, off int64) (n int, err error)

ReadAt fails in a write-only fs.

func (Item) Readdir

func (i Item) Readdir(count int) ([]os.FileInfo, error)

Readdir fails in a write-only fs.

func (Item) Readdirnames

func (i Item) Readdirnames(n int) ([]string, error)

Readdirnames fails in a write-only fs.

func (Item) Seek

func (i Item) Seek(offset int64, whence int) (ret int64, err error)

Seek fails in a write-only fs.

func (Item) Stat

func (i Item) Stat() (os.FileInfo, error)

Stat fails in a write-only fs.

func (Item) Sync

func (i Item) Sync() error

Sync fails in a write-only fs.

func (Item) Truncate

func (i Item) Truncate(size int64) error

Truncate fails in a write-only fs.

func (Item) WriteAt

func (i Item) WriteAt(b []byte, off int64) (n int, err error)

WriteAt is not implemented.

func (Item) WriteString

func (i Item) WriteString(s string) (n int, err error)

WriteString is not implemented.

Jump to

Keyboard shortcuts

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