starlib: github.com/qri-io/starlib/zipfile Index | Files

package zipfile

import "github.com/qri-io/starlib/zipfile"

Package zipfile reads & parses zip archives

outline: 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
          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 intented to be a drop-in subset of python's zipfile module for starlark: https://docs.python.org/3/library/zipfile.html

Index

Package Files

doc.go zip.go

Constants

const ModuleName = "zipfile.star"

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

func LoadModule Uses

func LoadModule() (starlark.StringDict, error)

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

type ZipFile Uses

type ZipFile struct {
    *zip.Reader
}

ZipFile is a starlark zip file

func (ZipFile) Struct Uses

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

Struct turns zipFile into a starlark struct value

type ZipInfo Uses

type ZipInfo struct {
    *zip.File
}

ZipInfo is a starlark information object for a Zip archive component

func (ZipInfo) Struct Uses

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

Struct turns zipInfo into a starlark struct value

Package zipfile imports 7 packages (graph) and is imported by 1 packages. Updated 2019-01-21. Refresh now. Tools for package owners.