zipfile

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 7 Imported by: 4

README

zipfile

zipfile reads & parses zip archives

Functions

ZipFile(data)

opens an archive for reading

Types

ZipFile

a zip archive object Methods

namelist() list

return a list of files in the archive

open(filename string) ZipInfo

open a file for reading

parameters:

name type description
filename string name of the file in the archive to open
ZipInfo

Methods

read() string

read the file, returning it's string representation

Documentation

Overview

Package zipfile reads & parses zip archives

outline: zipfile
  zipfile reads & parses zip archives
  path: zipfile
  functions:
    ZipFile(data)
      opens an archive for reading

  types:
    ZipFile
      a zip archive object
      methods:
        namelist() list
          return a list of files in the archive
        open(filename string) ZipInfo
          open a file for reading
          params:
            filename string
              name of the file in the archive to open
    ZipInfo
      methods:
        read() string
          read the file, returning it's string representation

Package zipfile defines zipfileimatical functions, it's intended to be a drop-in subset of python's zipfile module for starlark: https://docs.python.org/3/library/zipfile.html

Index

Constants

View Source
const ModuleName = "zipfile.star"

ModuleName defines the expected name for this Module when used in starlark's load() function, eg: load('zipfile.star', 'zipfile')

Variables

This section is empty.

Functions

func LoadModule

func LoadModule() (starlark.StringDict, error)

LoadModule loads the zipfile module. It is concurrency-safe and idempotent.

Types

type ZipFile

type ZipFile struct {
	*zip.Reader
}

ZipFile is a starlark zip file

func (ZipFile) Struct

func (zf ZipFile) Struct() *starlarkstruct.Struct

Struct turns zipFile into a starlark struct value

type ZipInfo

type ZipInfo struct {
	*zip.File
}

ZipInfo is a starlark information object for a Zip archive component

func (ZipInfo) Struct

func (zi ZipInfo) Struct() *starlarkstruct.Struct

Struct turns zipInfo into a starlark struct value

Jump to

Keyboard shortcuts

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