/httpfs

Go Library for open http file like local file

Primary LanguageGoMIT LicenseMIT

httpfs

GoDoc

Golang library for open http file like open local file

Example

Usage in unzip http file

package main

import (
    "github.com/codeskyblue/httpfs"
    "archive/zip"
    "fmt"
    "log"
)

func main(){
    file, err := Open("http://some-host/file.zip")
	if err != nil {
		log.Fatal(err)
	}
    zrd, err := zip.NewReader(file, file.Size())
    if err != nil {
		log.Fatal(err)
	}
    for _, f := range zrd.File {
        fmt.Printf("F-Name: %s\n", f.Name)
    }
}

LICENSE

MIT