~ubuntu-branches/ubuntu/saucy/juju-core/saucy

« back to all changes in this revision

Viewing changes to src/github.com/andelf/go-curl/README.md

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 16:02:16 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130820160216-5yu1llasa2e2youn
Tags: 1.13.1-0ubuntu1
* New upstream release.
  - Build and install juju metadata plugin.
  - d/NEWS: Add some guidance on upgrading environments from 1.11.x
    to 1.13.x.
* d/NEWS: Add details about lack of upgrade path from juju < 1.11
  and how to interact with older juju environments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
go-curl
2
 
=======
3
 
 
4
 
my golang libcurl(curl) binding.
5
 
 
6
 
See more examples in ./examples/ directory~!
7
 
 
8
 
LICENSE
9
 
-------
10
 
 
11
 
go-curl is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
12
 
 
13
 
Current Development Statue
14
 
--------------------------
15
 
 
16
 
 * currently stable
17
 
 * READ, WRITE, HEADER, PROGRESS function callback
18
 
 * a Multipart Form supports file uploading
19
 
 * Most curl_easy_setopt option
20
 
 * partly implement share & multi interface
21
 
 * new callback function prototype
22
 
 
23
 
How to Install
24
 
--------------
25
 
 
26
 
Make Sure You Have libcurl (and its develop headers, static/dynamic libs) installed!
27
 
 
28
 
 
29
 
    $ go get -u github.com/andelf/go-curl
30
 
 
31
 
Current Status
32
 
--------------
33
 
 
34
 
 * Linux x64
35
 
   * passed go1 (ArchLinux)
36
 
 * Windows x86
37
 
   * passed go1 (win7, mingw-gcc 4.5.2, curl 7.22.0)
38
 
 * Mac OS
39
 
   * passed go1 (Mac OS X 10.7.3, curl 7.21.4)
40
 
 
41
 
Sample Program
42
 
--------------
43
 
 
44
 
```go
45
 
package main
46
 
 
47
 
import (
48
 
    "fmt"
49
 
    curl "github.com/andelf/go-curl"
50
 
)
51
 
 
52
 
func main() {
53
 
    easy := curl.EasyInit()
54
 
    defer easy.Cleanup()
55
 
 
56
 
    easy.Setopt(curl.OPT_URL, "http://www.baidu.com/")
57
 
 
58
 
    // make a callback function
59
 
    fooTest := func (buf []byte, userdata interface{}) bool {
60
 
        println("DEBUG: size=>", len(buf))
61
 
        println("DEBUG: content=>", string(buf))
62
 
        return true
63
 
    }
64
 
 
65
 
    easy.Setopt(curl.OPT_WRITEFUNCTION, fooTest)
66
 
 
67
 
    if err := easy.Perform(); err != nil {
68
 
        fmt.Printf("ERROR: %v\n", err)
69
 
    }
70
 
}
71
 
```