📦 Go version of the Python pewn library.

Gownload

Go version of pewn. Allows you to Download file(s) easily.

Size License Stars Release

Installation

  • Initialize your project with go mod init .
  • Get the package with go get github.com/5elenay/gownload.

API Reference

Click here for API reference.

Example

Download single file example

package main

import (
    "fmt"

    "github.com/5elenay/gownload"
)

func main() {
    // Create an option
    option := gownload.Options{
        Name:   "photo.png",
        Folder: []string{"path", "to", "photos"},
    }

    // Download file.
    res := gownload.Download("https://picsum.photos/500/300", option)

    // An helper function for gownload.Result which allows you to handle result and error easily.
    res.Handle(res.Error, func(path string) {
        // Use file path
        fmt.Println(path)
    })
}

Download multiple-file example

package main

import (
    "fmt"

    "github.com/5elenay/gownload"
)

func main() {
    // Create an option.
    option := gownload.Options{
        Name:   "photo.png",
        Folder: []string{"path", "to", "photos"},
    }

    // Make a string slice and add the url 10 times.
    var urls []string

    for i := 0; i < 10; i++ {
        urls = append(urls, "https://picsum.photos/500/300")
    }

    // Download all of the files.
    results := gownload.DownloadMultiple(urls, option)

    // Loop through files
    for _, res := range results {
        // An helper function for gownload.Result which allows you to handle result and error easily.
        res.Handle(res.Error, func(path string) {
            // Use file path
            fmt.Println(path)
        })
    }
}
Owner
Penguen
I'm 15 years old programmer from Turkey. I always wanted to learn new technologies!
Penguen
Similar Resources

An simple, easily extensible and concurrent health-check library for Go services

An simple, easily extensible and concurrent health-check library for Go services

Healthcheck A simple and extensible RESTful Healthcheck API implementation for Go services. Health provides an http.Handlefunc for use as a healthchec

Dec 30, 2022

Simple licensing library for golang.

license-key A simple licensing library in Golang, that generates license files containing arbitrary data. Note that this implementation is quite basic

Dec 24, 2022

Library for interacting with LLVM IR in pure Go.

llvm Library for interacting with LLVM IR in pure Go. Introduction Introductory blog post "LLVM IR and Go" Our Document Installation go get -u github.

Dec 28, 2022

atomic measures + Prometheus exposition library

About Atomic measures with Prometheus exposition for the Go programming language. This is free and unencumbered software released into the public doma

Sep 27, 2022

Morse Code Library in Go

morse Morse Code Library in Go Download and Use go get -u -v github.com/alwindoss/morse or dep ensure -add github.com/alwindoss/morse Sample Usage pac

Dec 30, 2022

A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell.

shellwords A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell. Installation go get github.com/Wing924

Sep 27, 2022

Notification library for gophers and their furry friends.

Notification library for gophers and their furry friends.

Shoutrrr Notification library for gophers and their furry friends. Heavily inspired by caronc/apprise. Quick Start As a package Using shoutrrr is easy

Jan 3, 2023

Go library for creating state machines

Go library for creating state machines

Stateless Create state machines and lightweight state machine-based workflows directly in Go code: phoneCall := stateless.NewStateMachine(stateOffHook

Jan 6, 2023

biogo is a bioinformatics library for Go

biogo is a bioinformatics library for Go

bíogo Installation $ go get github.com/biogo/biogo/... Overview bíogo is a bioinformatics library for the Go language. Getting help Help or simil

Jan 5, 2023
Record CS knowlegement with XMind, version 2.0. 使用 XMind 记录 Linux 操作系统,网络,C++,Golang 以及数据库的一些设计
Record CS knowlegement with XMind, version 2.0. 使用 XMind 记录 Linux 操作系统,网络,C++,Golang 以及数据库的一些设计

Psyduck 另一个用 XMind 记录 CS 基础问题的地方,同样提供了 .xmind 源文件以及导出的 .pdf 文件,XMind 版本为「XMind 2020」。 在 2020 年时,曾花了约 2 个月的时间整理了第一份 XMind 知识库: ZeroMind。 之所以额外创建一个 Repo

Dec 30, 2022
TheOtherRolesInstaller - A simple tool to install the latest version of TheOtherRoles Mod

TheOtherRoles Installer This is a simple tool to install TheOtherRoles Mod for A

Sep 30, 2022
A patcher for the MS-DOS version of Fallout 1 including Crafty's sFall1 patches and maybe more

A patcher for the MS-DOS version of Fallout 1 including Crafty's sFall1 patches and maybe more

Oct 13, 2022
Library to work with MimeHeaders and another mime types. Library support wildcards and parameters.

Mime header Motivation This library created to help people to parse media type data, like headers, and store and match it. The main features of the li

Nov 9, 2022
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)

eaopt is an evolutionary optimization library Table of Contents Changelog Example Background Features Usage General advice Genetic algorithms Overview

Dec 30, 2022
cross-platform, normalized battery information library

battery Cross-platform, normalized battery information library. Gives access to a system independent, typed battery state, capacity, charge and voltag

Dec 22, 2022
GoLang Library for Browser Capabilities Project

Browser Capabilities GoLang Project PHP has get_browser() function which tells what the user's browser is capable of. You can check original documenta

Sep 27, 2022
Go bindings for unarr (decompression library for RAR, TAR, ZIP and 7z archives)

go-unarr Golang bindings for the unarr library from sumatrapdf. unarr is a decompression library and CLI for RAR, TAR, ZIP and 7z archives. GoDoc See

Dec 29, 2022
Type-safe Prometheus metrics builder library for golang

gotoprom A Prometheus metrics builder gotoprom offers an easy to use declarative API with type-safe labels for building and using Prometheus metrics.

Dec 5, 2022
An easy to use, extensible health check library for Go applications.

Try browsing the code on Sourcegraph! Go Health Check An easy to use, extensible health check library for Go applications. Table of Contents Example M

Dec 30, 2022