GithubHelp home page GithubHelp logo

lamoulie / go-curl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andelf/go-curl

0.0 0.0 0.0 177 KB

golang curl(libcurl) binding.

License: Apache License 2.0

C 25.21% Go 67.76% Python 6.89% C++ 0.14%

go-curl's Introduction

go-curl

Build Status

my golang libcurl(curl) binding.

See more examples in ./examples/ directory~!

LICENSE

go-curl is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).

Current Development Status

  • currently stable
  • READ, WRITE, HEADER, PROGRESS function callback
  • a Multipart Form supports file uploading
  • Most curl_easy_setopt option
  • partly implement share & multi interface
  • new callback function prototype

How to Install

Make Sure You Have libcurl (and its develop headers, static/dynamic libs) installed!

$ go get -u github.com/andelf/go-curl

Current Status

  • Linux x64
    • passed go1 (ArchLinux)
  • Windows x86
    • passed go1 (win7, mingw-gcc 4.5.2, curl 7.22.0)
  • Mac OS
    • passed go1 (Mac OS X 10.7.3, curl 7.21.4)

Sample Program

package main

import (
    "fmt"
    curl "github.com/andelf/go-curl"
)

func main() {
    easy := curl.EasyInit()
    defer easy.Cleanup()

    easy.Setopt(curl.OPT_URL, "http://www.baidu.com/")

    // make a callback function
    fooTest := func (buf []byte, userdata interface{}) bool {
        println("DEBUG: size=>", len(buf))
        println("DEBUG: content=>", string(buf))
        return true
    }

    easy.Setopt(curl.OPT_WRITEFUNCTION, fooTest)

    if err := easy.Perform(); err != nil {
        fmt.Printf("ERROR: %v\n", err)
    }
}

go-curl's People

Contributors

andelf avatar pyrrvs avatar madisongh avatar atercattus avatar aquaklaster avatar ceejatec avatar notwa avatar jhfeng avatar mn7z avatar markatwood avatar ottob avatar xiaopeng163 avatar rilutham avatar avsej avatar umurkontaci avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.