You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/05/22 21:45:24 UTC

[01/24] qpid-proton git commit: PROTON-827: Moved go binding work to branch `go`

Repository: qpid-proton
Updated Branches:
  refs/heads/go1 ac6f82436 -> 4f6389aca


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/interop_test.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/interop_test.go b/proton-c/bindings/go/src/qpid.apache.org/proton/interop_test.go
deleted file mode 100644
index 67d804c..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/interop_test.go
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Test that conversion of Go type to/from AMQP is compatible with other
-// bindings.
-//
-package proton
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"os"
-	"reflect"
-	"strings"
-	"testing"
-)
-
-func assertEqual(want interface{}, got interface{}) {
-	if !reflect.DeepEqual(want, got) {
-		panic(fmt.Errorf("%#v != %#v", want, got))
-	}
-}
-
-func assertNil(err interface{}) {
-	if err != nil {
-		panic(err)
-	}
-}
-
-func getReader(name string) (r io.Reader) {
-	r, err := os.Open("../../../../../../tests/interop/" + name + ".amqp")
-	if err != nil {
-		panic(fmt.Errorf("Can't open %#v: %v", name, err))
-	}
-	return
-}
-
-func remaining(d *Decoder) string {
-	remainder, _ := ioutil.ReadAll(io.MultiReader(d.Buffered(), d.reader))
-	return string(remainder)
-}
-
-// assertDecode: want is the expected value, gotPtr is a pointer to a
-// instance of the same type for Decode.
-func assertDecode(d *Decoder, want interface{}, gotPtr interface{}) {
-
-	assertNil(d.Decode(gotPtr))
-
-	got := reflect.ValueOf(gotPtr).Elem().Interface()
-	assertEqual(want, got)
-
-	// Try round trip encoding
-	bytes, err := Marshal(want, nil)
-	assertNil(err)
-	n, err := Unmarshal(bytes, gotPtr)
-	assertNil(err)
-	assertEqual(n, len(bytes))
-	got = reflect.ValueOf(gotPtr).Elem().Interface()
-	assertEqual(want, got)
-}
-
-func TestUnmarshal(t *testing.T) {
-	bytes, err := ioutil.ReadAll(getReader("strings"))
-	if err != nil {
-		t.Error(err)
-	}
-	for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} {
-		var got string
-		n, err := Unmarshal(bytes, &got)
-		if err != nil {
-			t.Error(err)
-		}
-		if want != got {
-			t.Errorf("%#v != %#v", want, got)
-		}
-		bytes = bytes[n:]
-	}
-}
-
-func TestPrimitivesExact(t *testing.T) {
-	d := NewDecoder(getReader("primitives"))
-	// Decoding into exact types
-	var b bool
-	assertDecode(d, true, &b)
-	assertDecode(d, false, &b)
-	var u8 uint8
-	assertDecode(d, uint8(42), &u8)
-	var u16 uint16
-	assertDecode(d, uint16(42), &u16)
-	var i16 int16
-	assertDecode(d, int16(-42), &i16)
-	var u32 uint32
-	assertDecode(d, uint32(12345), &u32)
-	var i32 int32
-	assertDecode(d, int32(-12345), &i32)
-	var u64 uint64
-	assertDecode(d, uint64(12345), &u64)
-	var i64 int64
-	assertDecode(d, int64(-12345), &i64)
-	var f32 float32
-	assertDecode(d, float32(0.125), &f32)
-	var f64 float64
-	assertDecode(d, float64(0.125), &f64)
-}
-
-func TestPrimitivesCompatible(t *testing.T) {
-	d := NewDecoder(getReader("primitives"))
-	// Decoding into compatible types
-	var b bool
-	var i int
-	var u uint
-	var f float64
-	assertDecode(d, true, &b)
-	assertDecode(d, false, &b)
-	assertDecode(d, uint(42), &u)
-	assertDecode(d, uint(42), &u)
-	assertDecode(d, -42, &i)
-	assertDecode(d, uint(12345), &u)
-	assertDecode(d, -12345, &i)
-	assertDecode(d, uint(12345), &u)
-	assertDecode(d, -12345, &i)
-	assertDecode(d, 0.125, &f)
-	assertDecode(d, 0.125, &f)
-}
-
-// assertDecodeValue: want is the expected value, decode into a reflect.Value
-func assertDecodeInterface(d *Decoder, want interface{}) {
-
-	var got, got2 interface{}
-	assertNil(d.Decode(&got))
-
-	assertEqual(want, got)
-
-	// Try round trip encoding
-	bytes, err := Marshal(got, nil)
-	assertNil(err)
-	n, err := Unmarshal(bytes, &got2)
-	assertNil(err)
-	assertEqual(n, len(bytes))
-	assertEqual(want, got2)
-}
-
-func TestPrimitivesInterface(t *testing.T) {
-	d := NewDecoder(getReader("primitives"))
-	assertDecodeInterface(d, true)
-	assertDecodeInterface(d, false)
-	assertDecodeInterface(d, uint8(42))
-	assertDecodeInterface(d, uint16(42))
-	assertDecodeInterface(d, int16(-42))
-	assertDecodeInterface(d, uint32(12345))
-	assertDecodeInterface(d, int32(-12345))
-	assertDecodeInterface(d, uint64(12345))
-	assertDecodeInterface(d, int64(-12345))
-	assertDecodeInterface(d, float32(0.125))
-	assertDecodeInterface(d, float64(0.125))
-}
-
-func TestStrings(t *testing.T) {
-	d := NewDecoder(getReader("strings"))
-	// Test decoding as plain Go strings
-	for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} {
-		var got string
-		assertDecode(d, want, &got)
-	}
-	remains := remaining(d)
-	if remains != "" {
-		t.Errorf("leftover: %s", remains)
-	}
-
-	// Test decoding as specific string types
-	d = NewDecoder(getReader("strings"))
-	var bytes []byte
-	var str, sym string
-	assertDecode(d, []byte("abc\000defg"), &bytes)
-	assertDecode(d, "abcdefg", &str)
-	assertDecode(d, "abcdefg", &sym)
-	assertDecode(d, make([]byte, 0), &bytes)
-	assertDecode(d, "", &str)
-	assertDecode(d, "", &sym)
-	remains = remaining(d)
-	if remains != "" {
-		t.Fatalf("leftover: %s", remains)
-	}
-
-	// Test some error handling
-	d = NewDecoder(getReader("strings"))
-	var s string
-	err := d.Decode(s)
-	if err == nil {
-		t.Fatal("Expected error")
-	}
-	if !strings.Contains(err.Error(), "not a pointer") {
-		t.Error(err)
-	}
-	var i int
-	err = d.Decode(&i)
-	if !strings.Contains(err.Error(), "cannot unmarshal") {
-		t.Error(err)
-	}
-	_, err = Unmarshal([]byte{}, nil)
-	if !strings.Contains(err.Error(), "not enough data") {
-		t.Error(err)
-	}
-	_, err = Unmarshal([]byte("foobar"), nil)
-	if !strings.Contains(err.Error(), "invalid-argument") {
-		t.Error(err)
-	}
-}
-
-func TestEncodeDecode(t *testing.T) {
-	type data struct {
-		s  string
-		i  int
-		u8 uint8
-		b  bool
-		f  float32
-		v  interface{}
-	}
-
-	in := data{"foo", 42, 9, true, 1.234, "thing"}
-
-	buf := bytes.Buffer{}
-	e := NewEncoder(&buf)
-	assertNil(e.Encode(in.s))
-	assertNil(e.Encode(in.i))
-	assertNil(e.Encode(in.u8))
-	assertNil(e.Encode(in.b))
-	assertNil(e.Encode(in.f))
-	assertNil(e.Encode(in.v))
-
-	var out data
-	d := NewDecoder(&buf)
-	assertNil(d.Decode(&out.s))
-	assertNil(d.Decode(&out.i))
-	assertNil(d.Decode(&out.u8))
-	assertNil(d.Decode(&out.b))
-	assertNil(d.Decode(&out.f))
-	assertNil(d.Decode(&out.v))
-
-	assertEqual(in, out)
-}
-
-func TestMap(t *testing.T) {
-	d := NewDecoder(getReader("maps"))
-
-	// Generic map
-	var m Map
-	assertDecode(d, Map{"one": int32(1), "two": int32(2), "three": int32(3)}, &m)
-
-	// Interface as map
-	var i interface{}
-	assertDecode(d, Map{int32(1): "one", int32(2): "two", int32(3): "three"}, &i)
-
-	d = NewDecoder(getReader("maps"))
-	// Specific typed map
-	var m2 map[string]int
-	assertDecode(d, map[string]int{"one": 1, "two": 2, "three": 3}, &m2)
-
-	// Round trip a nested map
-	m = Map{int64(1): "one", "two": int32(2), true: Map{uint8(1): true, uint8(2): false}}
-	bytes, err := Marshal(m, nil)
-	assertNil(err)
-	_, err = Unmarshal(bytes, &i)
-	assertNil(err)
-	assertEqual(m, i)
-}
-
-func TestList(t *testing.T) {
-	d := NewDecoder(getReader("lists"))
-	var l List
-	assertDecode(d, List{int32(32), "foo", true}, &l)
-	assertDecode(d, List{}, &l)
-}
-
-func FIXMETestMessage(t *testing.T) {
-	// FIXME aconway 2015-04-09: integrate Message encoding under marshal/unmarshal API.
-	bytes, err := ioutil.ReadAll(getReader("message"))
-	assertNil(err)
-	m, err := DecodeMessage(bytes)
-	assertNil(err)
-	fmt.Printf("%+v\n", m)
-	assertEqual(m.Body(), "hello")
-
-	bytes2 := make([]byte, len(bytes))
-	bytes2, err = m.Encode(bytes2)
-	assertNil(err)
-	assertEqual(bytes, bytes2)
-}
-
-// FIXME aconway 2015-03-13: finish the full interop test

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/marshal.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/marshal.go b/proton-c/bindings/go/src/qpid.apache.org/proton/marshal.go
deleted file mode 100644
index e4f230d..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/marshal.go
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"io"
-	"qpid.apache.org/proton/internal"
-	"reflect"
-	"unsafe"
-)
-
-func dataError(prefix string, data *C.pn_data_t) error {
-	err := internal.PnError(unsafe.Pointer(C.pn_data_error(data)))
-	if err != nil {
-		err = internal.Errorf("%s: %s", prefix, err.(internal.Error))
-	}
-	return err
-}
-
-/*
-Marshal encodes a Go value as AMQP data in buffer.
-If buffer is nil, or is not large enough, a new buffer  is created.
-
-Returns the buffer used for encoding with len() adjusted to the actual size of data.
-
-Go types are encoded as follows
-
- +-------------------------------------+--------------------------------------------+
- |Go type                              |AMQP type                                   |
- +-------------------------------------+--------------------------------------------+
- |bool                                 |bool                                        |
- +-------------------------------------+--------------------------------------------+
- |int8, int16, int32, int64 (int)      |byte, short, int, long (int or long)        |
- +-------------------------------------+--------------------------------------------+
- |uint8, uint16, uint32, uint64 (uint) |ubyte, ushort, uint, ulong (uint or ulong)  |
- +-------------------------------------+--------------------------------------------+
- |float32, float64                     |float, double.                              |
- +-------------------------------------+--------------------------------------------+
- |string                               |string                                      |
- +-------------------------------------+--------------------------------------------+
- |[]byte, Binary                       |binary                                      |
- +-------------------------------------+--------------------------------------------+
- |Symbol                               |symbol                                      |
- +-------------------------------------+--------------------------------------------+
- |interface{}                          |the contained type                          |
- +-------------------------------------+--------------------------------------------+
- |nil                                  |null                                        |
- +-------------------------------------+--------------------------------------------+
- |map[K]T                              |map with K and T converted as above         |
- +-------------------------------------+--------------------------------------------+
- |Map                                  |map, may have mixed types for keys, values  |
- +-------------------------------------+--------------------------------------------+
- |[]T                                  |list with T converted as above              |
- +-------------------------------------+--------------------------------------------+
- |List                                 |list, may have mixed types  values          |
- +-------------------------------------+--------------------------------------------+
-
-TODO Go types: array, slice, struct
-
-Go types that cannot be marshaled: complex64/128, uintptr, function, interface, channel
-*/
-func Marshal(v interface{}, buffer []byte) (outbuf []byte, err error) {
-	defer internal.DoRecover(&err)
-	data := C.pn_data(0)
-	defer C.pn_data_free(data)
-	put(data, v)
-	encode := func(buf []byte) ([]byte, error) {
-		n := int(C.pn_data_encode(data, cPtr(buf), cLen(buf)))
-		switch {
-		case n == int(C.PN_OVERFLOW):
-			return buf, overflow
-		case n < 0:
-			return buf, dataError("marshal error", data)
-		default:
-			return buf[:n], nil
-		}
-	}
-	return encodeGrow(buffer, encode)
-}
-
-const minEncode = 256
-
-// overflow is returned when an encoding function can't fit data in the buffer.
-var overflow = internal.Errorf("buffer too small")
-
-// encodeFn encodes into buffer[0:len(buffer)].
-// Returns buffer with length adjusted for data encoded.
-// If buffer too small, returns overflow as error.
-type encodeFn func(buffer []byte) ([]byte, error)
-
-// encodeGrow calls encode() into buffer, if it returns overflow grows the buffer.
-// Returns the final buffer.
-func encodeGrow(buffer []byte, encode encodeFn) ([]byte, error) {
-	if buffer == nil || len(buffer) == 0 {
-		buffer = make([]byte, minEncode)
-	}
-	var err error
-	for buffer, err = encode(buffer); err == overflow; buffer, err = encode(buffer) {
-		buffer = make([]byte, 2*len(buffer))
-	}
-	return buffer, err
-}
-
-func put(data *C.pn_data_t, v interface{}) {
-	switch v := v.(type) {
-	case nil:
-		C.pn_data_put_null(data)
-	case bool:
-		C.pn_data_put_bool(data, C.bool(v))
-	case int8:
-		C.pn_data_put_byte(data, C.int8_t(v))
-	case int16:
-		C.pn_data_put_short(data, C.int16_t(v))
-	case int32:
-		C.pn_data_put_int(data, C.int32_t(v))
-	case int64:
-		C.pn_data_put_long(data, C.int64_t(v))
-	case int:
-		if unsafe.Sizeof(0) == 8 {
-			C.pn_data_put_long(data, C.int64_t(v))
-		} else {
-			C.pn_data_put_int(data, C.int32_t(v))
-		}
-	case uint8:
-		C.pn_data_put_ubyte(data, C.uint8_t(v))
-	case uint16:
-		C.pn_data_put_ushort(data, C.uint16_t(v))
-	case uint32:
-		C.pn_data_put_uint(data, C.uint32_t(v))
-	case uint64:
-		C.pn_data_put_ulong(data, C.uint64_t(v))
-	case uint:
-		if unsafe.Sizeof(0) == 8 {
-			C.pn_data_put_ulong(data, C.uint64_t(v))
-		} else {
-			C.pn_data_put_uint(data, C.uint32_t(v))
-		}
-	case float32:
-		C.pn_data_put_float(data, C.float(v))
-	case float64:
-		C.pn_data_put_double(data, C.double(v))
-	case string:
-		C.pn_data_put_string(data, pnBytes([]byte(v)))
-	case []byte:
-		C.pn_data_put_binary(data, pnBytes(v))
-	case Binary:
-		C.pn_data_put_binary(data, pnBytes([]byte(v)))
-	case Symbol:
-		C.pn_data_put_symbol(data, pnBytes([]byte(v)))
-	case Map: // Special map type
-		C.pn_data_put_map(data)
-		C.pn_data_enter(data)
-		for key, val := range v {
-			put(data, key)
-			put(data, val)
-		}
-		C.pn_data_exit(data)
-	default:
-		switch reflect.TypeOf(v).Kind() {
-		case reflect.Map:
-			putMap(data, v)
-		case reflect.Slice:
-			putList(data, v)
-		default:
-			panic(internal.Errorf("cannot marshal %s to AMQP", reflect.TypeOf(v)))
-		}
-	}
-	err := dataError("marshal", data)
-	if err != nil {
-		panic(err)
-	}
-	return
-}
-
-func putMap(data *C.pn_data_t, v interface{}) {
-	mapValue := reflect.ValueOf(v)
-	C.pn_data_put_map(data)
-	C.pn_data_enter(data)
-	for _, key := range mapValue.MapKeys() {
-		put(data, key.Interface())
-		put(data, mapValue.MapIndex(key).Interface())
-	}
-	C.pn_data_exit(data)
-}
-
-func putList(data *C.pn_data_t, v interface{}) {
-	listValue := reflect.ValueOf(v)
-	C.pn_data_put_list(data)
-	C.pn_data_enter(data)
-	for i := 0; i < listValue.Len(); i++ {
-		put(data, listValue.Index(i).Interface())
-	}
-	C.pn_data_exit(data)
-}
-
-// Encoder encodes AMQP values to an io.Writer
-type Encoder struct {
-	writer io.Writer
-	buffer []byte
-}
-
-// New encoder returns a new encoder that writes to w.
-func NewEncoder(w io.Writer) *Encoder {
-	return &Encoder{w, make([]byte, minEncode)}
-}
-
-func (e *Encoder) Encode(v interface{}) (err error) {
-	e.buffer, err = Marshal(v, e.buffer)
-	if err == nil {
-		e.writer.Write(e.buffer)
-	}
-	return err
-}
-
-func replace(data *C.pn_data_t, v interface{}) {
-	C.pn_data_clear(data)
-	put(data, v)
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/message.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/message.go b/proton-c/bindings/go/src/qpid.apache.org/proton/message.go
deleted file mode 100644
index 44be51d..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/message.go
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// #include <proton/types.h>
-// #include <proton/message.h>
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"qpid.apache.org/proton/internal"
-	"time"
-	"unsafe"
-)
-
-// FIXME aconway 2015-04-28: Do we need the interface or can we just export the struct?
-
-// Message is the interface to an AMQP message.
-// Instances of this interface contain a pointer to the underlying struct.
-type Message interface {
-	/**
-	 * Inferred indicates how the message content
-	 * is encoded into AMQP sections. If inferred is true then binary and
-	 * list values in the body of the message will be encoded as AMQP DATA
-	 * and AMQP SEQUENCE sections, respectively. If inferred is false,
-	 * then all values in the body of the message will be encoded as AMQP
-	 * VALUE sections regardless of their type.
-	 */
-	Inferred() bool
-	SetInferred(bool)
-
-	/**
-	 * Durable indicates that any parties taking responsibility
-	 * for the message must durably store the content.
-	 */
-	Durable() bool
-	SetDurable(bool)
-
-	/**
-	 * Priority impacts ordering guarantees. Within a
-	 * given ordered context, higher priority messages may jump ahead of
-	 * lower priority messages.
-	 */
-	Priority() uint8
-	SetPriority(uint8)
-
-	/**
-	 * TTL or Time To Live, a message it may be dropped after this duration
-	 */
-	TTL() time.Duration
-	SetTTL(time.Duration)
-
-	/**
-	 * FirstAcquirer indicates
-	 * that the recipient of the message is the first recipient to acquire
-	 * the message, i.e. there have been no failed delivery attempts to
-	 * other acquirers. Note that this does not mean the message has not
-	 * been delivered to, but not acquired, by other recipients.
-	 */
-	FirstAcquirer() bool
-	SetFirstAcquirer(bool)
-
-	/**
-	 * DeliveryCount tracks how many attempts have been made to
-	 * delivery a message.
-	 */
-	DeliveryCount() uint32
-	SetDeliveryCount(uint32)
-
-	/**
-	 * MessageId provides a unique identifier for a message.
-	 * it can be an a string, an unsigned long, a uuid or a
-	 * binary value.
-	 */
-	MessageId() interface{}
-	SetMessageId(interface{})
-
-	UserId() string
-	SetUserId(string)
-
-	Address() string
-	SetAddress(string)
-
-	Subject() string
-	SetSubject(string)
-
-	ReplyTo() string
-	SetReplyTo(string)
-
-	/**
-	 * CorrelationId is set on correlated request and response messages. It can be an a string, an unsigned long, a uuid or a
-	 * binary value.
-	 */
-	CorrelationId() interface{}
-	SetCorrelationId(interface{})
-
-	ContentType() string
-	SetContentType(string)
-
-	ContentEncoding() string
-	SetContentEncoding(string)
-
-	// ExpiryTime indicates an absoulte time when the message may be dropped.
-	// A Zero time (i.e. t.isZero() == true) indicates a message never expires.
-	ExpiryTime() time.Time
-	SetExpiryTime(time.Time)
-
-	CreationTime() time.Time
-	SetCreationTime(time.Time)
-
-	GroupId() string
-	SetGroupId(string)
-
-	GroupSequence() int32
-	SetGroupSequence(int32)
-
-	ReplyToGroupId() string
-	SetReplyToGroupId(string)
-
-	/**
-	 * Instructions can be used to access or modify AMQP delivery instructions.
-	 */
-	Instructions() *map[string]interface{}
-
-	/**
-	 * Annotations  can be used to access or modify AMQP annotations.
-	 */
-	Annotations() *map[string]interface{}
-
-	/**
-	 * Properties  can be used to access or modify the application properties of a message.
-	 */
-	Properties() *map[string]interface{}
-
-	/**
-	 * Body of the message can be any AMQP encodable type.
-	 */
-	Body() interface{}
-	SetBody(interface{})
-
-	// Encode encodes the message as AMQP data. If buffer is non-nil and is large enough
-	// the message is encoded into it, otherwise a new buffer is created.
-	// Returns the buffer containing the message.
-	Encode(buffer []byte) ([]byte, error)
-}
-
-// NewMessage creates a new message instance. The returned interface contains a pointer.
-func NewMessage() Message {
-	pn := C.pn_message() // Pick up default setting from C message.
-	defer C.pn_message_free(pn)
-	return goMessage(pn)
-}
-
-// Message implementation copies all message data into Go space so it can be proprely
-// memory managed.
-//
-type message struct {
-	inferred, durable, firstAcquirer      bool
-	priority                              uint8
-	ttl                                   time.Duration
-	deliveryCount                         uint32
-	messageId                             interface{}
-	userId, address, subject, replyTo     string
-	contentType, contentEncoding          string
-	groupId, replyToGroupId               string
-	creationTime, expiryTime              time.Time
-	groupSequence                         int32
-	correlationId                         interface{}
-	instructions, annotations, properties map[string]interface{}
-	body                                  interface{}
-}
-
-func (m *message) Inferred() bool                        { return m.inferred }
-func (m *message) SetInferred(b bool)                    { m.inferred = b }
-func (m *message) Durable() bool                         { return m.durable }
-func (m *message) SetDurable(b bool)                     { m.durable = b }
-func (m *message) Priority() uint8                       { return m.priority }
-func (m *message) SetPriority(b uint8)                   { m.priority = b }
-func (m *message) TTL() time.Duration                    { return m.ttl }
-func (m *message) SetTTL(d time.Duration)                { m.ttl = d }
-func (m *message) FirstAcquirer() bool                   { return m.firstAcquirer }
-func (m *message) SetFirstAcquirer(b bool)               { m.firstAcquirer = b }
-func (m *message) DeliveryCount() uint32                 { return m.deliveryCount }
-func (m *message) SetDeliveryCount(c uint32)             { m.deliveryCount = c }
-func (m *message) MessageId() interface{}                { return m.messageId }
-func (m *message) SetMessageId(id interface{})           { m.messageId = id }
-func (m *message) UserId() string                        { return m.userId }
-func (m *message) SetUserId(s string)                    { m.userId = s }
-func (m *message) Address() string                       { return m.address }
-func (m *message) SetAddress(s string)                   { m.address = s }
-func (m *message) Subject() string                       { return m.subject }
-func (m *message) SetSubject(s string)                   { m.subject = s }
-func (m *message) ReplyTo() string                       { return m.replyTo }
-func (m *message) SetReplyTo(s string)                   { m.replyTo = s }
-func (m *message) CorrelationId() interface{}            { return m.correlationId }
-func (m *message) SetCorrelationId(c interface{})        { m.correlationId = c }
-func (m *message) ContentType() string                   { return m.contentType }
-func (m *message) SetContentType(s string)               { m.contentType = s }
-func (m *message) ContentEncoding() string               { return m.contentEncoding }
-func (m *message) SetContentEncoding(s string)           { m.contentEncoding = s }
-func (m *message) ExpiryTime() time.Time                 { return m.expiryTime }
-func (m *message) SetExpiryTime(t time.Time)             { m.expiryTime = t }
-func (m *message) CreationTime() time.Time               { return m.creationTime }
-func (m *message) SetCreationTime(t time.Time)           { m.creationTime = t }
-func (m *message) GroupId() string                       { return m.groupId }
-func (m *message) SetGroupId(s string)                   { m.groupId = s }
-func (m *message) GroupSequence() int32                  { return m.groupSequence }
-func (m *message) SetGroupSequence(s int32)              { m.groupSequence = s }
-func (m *message) ReplyToGroupId() string                { return m.replyToGroupId }
-func (m *message) SetReplyToGroupId(s string)            { m.replyToGroupId = s }
-func (m *message) Instructions() *map[string]interface{} { return &m.instructions }
-func (m *message) Annotations() *map[string]interface{}  { return &m.annotations }
-func (m *message) Properties() *map[string]interface{}   { return &m.properties }
-func (m *message) Body() interface{}                     { return m.body }
-func (m *message) SetBody(b interface{})                 { m.body = b }
-
-// rewindGet rewinds and then gets the value from a data object.
-func rewindGet(data *C.pn_data_t, v interface{}) {
-	if data != nil && C.pn_data_size(data) > 0 {
-		C.pn_data_rewind(data)
-		C.pn_data_next(data)
-		get(data, v)
-	}
-}
-
-// goMessage populates a Go message from a pn_message_t
-func goMessage(pn *C.pn_message_t) *message {
-	m := &message{
-		inferred:        bool(C.pn_message_is_inferred(pn)),
-		durable:         bool(C.pn_message_is_durable(pn)),
-		priority:        uint8(C.pn_message_get_priority(pn)),
-		ttl:             time.Duration(C.pn_message_get_ttl(pn)) * time.Millisecond,
-		firstAcquirer:   bool(C.pn_message_is_first_acquirer(pn)),
-		deliveryCount:   uint32(C.pn_message_get_delivery_count(pn)),
-		userId:          goString(C.pn_message_get_user_id(pn)),
-		address:         C.GoString(C.pn_message_get_address(pn)),
-		subject:         C.GoString(C.pn_message_get_subject(pn)),
-		replyTo:         C.GoString(C.pn_message_get_reply_to(pn)),
-		contentType:     C.GoString(C.pn_message_get_content_type(pn)),
-		contentEncoding: C.GoString(C.pn_message_get_content_encoding(pn)),
-		expiryTime:      time.Unix(0, int64(time.Millisecond*time.Duration(C.pn_message_get_expiry_time(pn)))),
-		creationTime:    time.Unix(0, int64(time.Millisecond)*int64(C.pn_message_get_creation_time(pn))),
-		groupId:         C.GoString(C.pn_message_get_group_id(pn)),
-		groupSequence:   int32(C.pn_message_get_group_sequence(pn)),
-		replyToGroupId:  C.GoString(C.pn_message_get_reply_to_group_id(pn)),
-		messageId:       nil,
-		correlationId:   nil,
-		instructions:    make(map[string]interface{}),
-		annotations:     make(map[string]interface{}),
-		properties:      make(map[string]interface{}),
-	}
-	rewindGet(C.pn_message_id(pn), &m.messageId)
-	rewindGet(C.pn_message_correlation_id(pn), &m.correlationId)
-	rewindGet(C.pn_message_instructions(pn), &m.instructions)
-	rewindGet(C.pn_message_annotations(pn), &m.annotations)
-	rewindGet(C.pn_message_properties(pn), &m.properties)
-	rewindGet(C.pn_message_body(pn), &m.body)
-	return m
-}
-
-// pnMessage populates a pn_message_t from a Go message.
-func (m *message) pnMessage() *C.pn_message_t {
-	pn := C.pn_message()
-	C.pn_message_set_inferred(pn, C.bool(m.Inferred()))
-	C.pn_message_set_durable(pn, C.bool(m.Durable()))
-	C.pn_message_set_priority(pn, C.uint8_t(m.priority))
-	C.pn_message_set_ttl(pn, C.pn_millis_t(m.TTL()/time.Millisecond))
-	C.pn_message_set_first_acquirer(pn, C.bool(m.FirstAcquirer()))
-	C.pn_message_set_delivery_count(pn, C.uint32_t(m.deliveryCount))
-	replace(C.pn_message_id(pn), m.MessageId())
-	C.pn_message_set_user_id(pn, pnBytes([]byte(m.UserId())))
-	C.pn_message_set_address(pn, C.CString(m.Address()))
-	C.pn_message_set_subject(pn, C.CString(m.Subject()))
-	C.pn_message_set_reply_to(pn, C.CString(m.ReplyTo()))
-	replace(C.pn_message_correlation_id(pn), m.CorrelationId())
-	C.pn_message_set_content_type(pn, C.CString(m.ContentType()))
-	C.pn_message_set_content_encoding(pn, C.CString(m.ContentEncoding()))
-	C.pn_message_set_expiry_time(pn, pnTime(m.ExpiryTime()))
-	C.pn_message_set_creation_time(pn, pnTime(m.CreationTime()))
-	C.pn_message_set_group_id(pn, C.CString(m.GroupId()))
-	C.pn_message_set_group_sequence(pn, C.pn_sequence_t(m.GroupSequence()))
-	C.pn_message_set_reply_to_group_id(pn, C.CString(m.ReplyToGroupId()))
-	replace(C.pn_message_instructions(pn), *m.Instructions())
-	replace(C.pn_message_annotations(pn), *m.Annotations())
-	replace(C.pn_message_properties(pn), *m.Properties())
-	replace(C.pn_message_body(pn), m.Body())
-	return pn
-}
-
-// FIXME aconway 2015-04-08: Move message encode/decode under Marshal/Unmarshal interfaces.
-
-// DecodeMessage decodes bytes as a message
-func DecodeMessage(data []byte) (Message, error) {
-	pnMsg := C.pn_message()
-	defer C.pn_message_free(pnMsg)
-	if len(data) == 0 {
-		return nil, internal.Errorf("empty buffer for decode")
-	}
-	if C.pn_message_decode(pnMsg, cPtr(data), cLen(data)) < 0 {
-		return nil, internal.Errorf("decoding message: %s",
-			internal.PnError(unsafe.Pointer(C.pn_message_error(pnMsg))))
-	}
-	return goMessage(pnMsg), nil
-}
-
-// Encode the message into bufffer.
-// If buffer is nil or len(buffer) is not sufficient to encode the message a larger
-// buffer will be returned.
-func (m *message) Encode(buffer []byte) ([]byte, error) {
-	pn := m.pnMessage()
-	defer C.pn_message_free(pn)
-	encode := func(buf []byte) ([]byte, error) {
-		len := cLen(buf)
-		result := C.pn_message_encode(pn, cPtr(buf), &len)
-		switch {
-		case result == C.PN_OVERFLOW:
-			return buf, overflow
-		case result < 0:
-			return buf, internal.Errorf("cannot encode message: %s", internal.PnErrorCode(result))
-		default:
-			return buf[:len], nil
-		}
-	}
-	return encodeGrow(buffer, encode)
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/message_test.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/message_test.go b/proton-c/bindings/go/src/qpid.apache.org/proton/message_test.go
deleted file mode 100644
index 2baec22..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/message_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import (
-	"reflect"
-	"testing"
-	"time"
-)
-
-func roundTrip(t *testing.T, m Message) {
-	buffer, err := m.Encode(nil)
-	if err != nil {
-		t.Fatalf("Encode failed: %v", err)
-	}
-	m2, err := DecodeMessage(buffer)
-	if err != nil {
-		t.Fatalf("Decode failed: %v", err)
-	}
-	if !reflect.DeepEqual(m, m2) {
-		t.Errorf("Message mismatch got\n%#v\nwant\n%#v", m, m2)
-	}
-}
-
-func TestDefaultMessageRoundTrip(t *testing.T) {
-	m := NewMessage()
-	// Check defaults
-	assertEqual(m.Inferred(), false)
-	assertEqual(m.Durable(), false)
-	assertEqual(m.Priority(), uint8(4))
-	assertEqual(m.TTL(), time.Duration(0))
-	assertEqual(m.UserId(), "")
-	assertEqual(m.Address(), "")
-	assertEqual(m.Subject(), "")
-	assertEqual(m.ReplyTo(), "")
-	assertEqual(m.ContentType(), "")
-	assertEqual(m.ContentEncoding(), "")
-	assertEqual(m.GroupId(), "")
-	assertEqual(m.GroupSequence(), int32(0))
-	assertEqual(m.ReplyToGroupId(), "")
-	assertEqual(m.MessageId(), nil)
-	assertEqual(m.CorrelationId(), nil)
-	assertEqual(*m.Instructions(), map[string]interface{}{})
-	assertEqual(*m.Annotations(), map[string]interface{}{})
-	assertEqual(*m.Properties(), map[string]interface{}{})
-	assertEqual(m.Body(), nil)
-
-	roundTrip(t, m)
-}
-
-func TestMessageRoundTrip(t *testing.T) {
-	m := NewMessage()
-	m.SetInferred(false)
-	m.SetDurable(true)
-	m.SetPriority(42)
-	m.SetTTL(0)
-	m.SetUserId("user")
-	m.SetAddress("address")
-	m.SetSubject("subject")
-	m.SetReplyTo("replyto")
-	m.SetContentType("content")
-	m.SetContentEncoding("encoding")
-	m.SetGroupId("group")
-	m.SetGroupSequence(42)
-	m.SetReplyToGroupId("replytogroup")
-	m.SetMessageId("id")
-	m.SetCorrelationId("correlation")
-	*m.Instructions() = map[string]interface{}{"instructions": "foo"}
-	*m.Annotations() = map[string]interface{}{"annotations": "foo"}
-	*m.Properties() = map[string]interface{}{"int": int32(32), "bool": true, "string": "foo"}
-	m.SetBody("hello")
-	roundTrip(t, m)
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/doc.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/doc.go b/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/doc.go
deleted file mode 100644
index c815f4e..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/doc.go
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package messaging provides a procedural, concurrent Go API for exchanging AMQP messages.
-*/
-package messaging
-
-// #cgo LDFLAGS: -lqpid-proton
-import "C"
-
-// Just for package comment

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/example_test.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/example_test.go b/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/example_test.go
deleted file mode 100644
index 02302b6..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/example_test.go
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Tests to verify that example code behaves as expected.
-package messaging
-
-import (
-	"bufio"
-	"bytes"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"math/rand"
-	"net"
-	"os"
-	"os/exec"
-	"path"
-	"path/filepath"
-	"reflect"
-	"testing"
-	"time"
-)
-
-func panicIf(err error) {
-	if err != nil {
-		panic(err)
-	}
-}
-
-// A demo broker process
-type broker struct {
-	cmd    *exec.Cmd
-	addr   string
-	runerr chan error
-	err    error
-}
-
-// Try to connect to the broker to verify it is ready, give up after a timeout
-func (b *broker) check() error {
-	dialer := net.Dialer{Deadline: time.Now().Add(time.Second * 10)}
-	for {
-		c, err := dialer.Dial("tcp", b.addr)
-		if err == nil { // Success
-			c.Close()
-			return nil
-		}
-		select {
-		case runerr := <-b.runerr: // Broker exited.
-			return runerr
-		default:
-		}
-		if neterr, ok := err.(net.Error); ok && neterr.Timeout() { // Running but timed out
-			b.stop()
-			return fmt.Errorf("timed out waiting for broker")
-		}
-		time.Sleep(time.Second / 10)
-	}
-}
-
-// Start the demo broker, wait till it is listening on *addr. No-op if already started.
-func (b *broker) start() error {
-	build("event/broker.go")
-	if b.cmd == nil { // Not already started
-		// FIXME aconway 2015-04-30: better way to pick/configure a broker address.
-		b.addr = fmt.Sprintf(":%d", rand.Intn(10000)+10000)
-		b.cmd = exec.Command(exepath("broker"), "-addr", b.addr, "-verbose", "0")
-		b.runerr = make(chan error)
-		// Change the -verbose setting above to see broker output on stdout/stderr.
-		b.cmd.Stderr, b.cmd.Stdout = os.Stderr, os.Stdout
-		go func() {
-			b.runerr <- b.cmd.Run()
-		}()
-		b.err = b.check()
-	}
-	return b.err
-}
-
-func (b *broker) stop() {
-	if b != nil && b.cmd != nil {
-		b.cmd.Process.Kill()
-		b.cmd.Wait()
-	}
-}
-
-// FIXME aconway 2015-04-30: redo all assert/panic tests with checkEqual style.
-func checkEqual(want interface{}, got interface{}) error {
-	if reflect.DeepEqual(want, got) {
-		return nil
-	}
-	return fmt.Errorf("%#v != %#v", want, got)
-}
-
-// runCommand returns an exec.Cmd to run an example.
-func exampleCommand(prog string, arg ...string) *exec.Cmd {
-	build(prog + ".go")
-	cmd := exec.Command(exepath(prog), arg...)
-	cmd.Stderr = os.Stderr
-	return cmd
-}
-
-// Run an example Go program, return the combined output as a string.
-func runExample(prog string, arg ...string) (string, error) {
-	cmd := exampleCommand(prog, arg...)
-	out, err := cmd.Output()
-	return string(out), err
-}
-
-func prefix(prefix string, err error) error {
-	if err != nil {
-		return fmt.Errorf("%s: %s", prefix, err)
-	}
-	return nil
-}
-
-func runExampleWant(want string, prog string, args ...string) error {
-	out, err := runExample(prog, args...)
-	if err != nil {
-		return fmt.Errorf("%s failed: %s: %s", prog, err, out)
-	}
-	return prefix(prog, checkEqual(want, out))
-}
-
-func exampleArgs(args ...string) []string {
-	return append(args, testBroker.addr+"/foo", testBroker.addr+"/bar", testBroker.addr+"/baz")
-}
-
-// Send then receive
-func TestExampleSendReceive(t *testing.T) {
-	if testing.Short() {
-		t.Skip("Skip demo tests in short mode")
-	}
-	testBroker.start()
-	err := runExampleWant(
-		"send: Received all 15 acknowledgements\n",
-		"send",
-		exampleArgs("-count", "5", "-verbose", "1")...)
-	if err != nil {
-		t.Fatal(err)
-	}
-	err = runExampleWant(
-		"receive: Listening\nreceive: Received 15 messages\n",
-		"receive",
-		exampleArgs("-verbose", "1", "-count", "15")...)
-	if err != nil {
-		t.Fatal(err)
-	}
-}
-
-var ready error
-
-func init() { ready = fmt.Errorf("Ready") }
-
-// Run receive in a goroutine.
-// Send ready on errchan when it is listening.
-// Send final error when it is done.
-// Returns the Cmd, caller must Wait()
-func goReceiveWant(errchan chan<- error, want string, arg ...string) *exec.Cmd {
-	cmd := exampleCommand("receive", arg...)
-	go func() {
-		pipe, err := cmd.StdoutPipe()
-		if err != nil {
-			errchan <- err
-			return
-		}
-		out := bufio.NewReader(pipe)
-		cmd.Start()
-		line, err := out.ReadString('\n')
-		if err != nil && err != io.EOF {
-			errchan <- err
-			return
-		}
-		listening := "receive: Listening\n"
-		if line != listening {
-			errchan <- checkEqual(listening, line)
-			return
-		}
-		errchan <- ready
-		buf := bytes.Buffer{}
-		io.Copy(&buf, out) // Collect the rest of the output
-		errchan <- checkEqual(want, buf.String())
-		close(errchan)
-	}()
-	return cmd
-}
-
-// Start receiver first, wait till it is running, then send.
-func TestExampleReceiveSend(t *testing.T) {
-	if testing.Short() {
-		t.Skip("Skip demo tests in short mode")
-	}
-	testBroker.start()
-	recvErr := make(chan error)
-	recvCmd := goReceiveWant(recvErr,
-		"receive: Received 15 messages\n",
-		exampleArgs("-count", "15", "-verbose", "1")...)
-	defer func() {
-		recvCmd.Process.Kill()
-		recvCmd.Wait()
-	}()
-	if err := <-recvErr; err != ready { // Wait for receiver ready
-		t.Fatal(err)
-	}
-	err := runExampleWant(
-		"send: Received all 15 acknowledgements\n",
-		"send",
-		exampleArgs("-count", "5", "-verbose", "1")...)
-	if err != nil {
-		t.Fatal(err)
-	}
-	if err := <-recvErr; err != nil {
-		t.Fatal(err)
-	}
-}
-
-func exepath(relative string) string {
-	if binDir == "" {
-		panic("bindir not set, cannot run example binaries")
-	}
-	return path.Join(binDir, relative)
-}
-
-var testBroker *broker
-var binDir, exampleDir string
-var built map[string]bool
-
-func init() {
-	built = make(map[string]bool)
-}
-
-func build(prog string) {
-	if !built[prog] {
-		build := exec.Command("go", "build", path.Join(exampleDir, prog))
-		build.Dir = binDir
-		out, err := build.CombinedOutput()
-		if err != nil {
-			panic(fmt.Errorf("%v: %s", err, out))
-		}
-		built[prog] = true
-	}
-}
-
-func TestMain(m *testing.M) {
-	var err error
-	exampleDir, err = filepath.Abs("../../../../../../../examples/go")
-	panicIf(err)
-	binDir, err = ioutil.TempDir("", "example_test.go")
-	panicIf(err)
-	defer os.Remove(binDir) // Clean up binaries
-	testBroker = &broker{}  // Broker is started on-demand by tests.
-	defer testBroker.stop()
-	os.Exit(m.Run())
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/handler.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/handler.go b/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/handler.go
deleted file mode 100644
index 514f0cf..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/handler.go
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package messaging
-
-import (
-	"qpid.apache.org/proton"
-	"qpid.apache.org/proton/event"
-)
-
-// FIXME aconway 2015-04-28: cleanup - exposing delivery vs. disposition.
-
-type acksMap map[event.Delivery]chan Disposition
-type receiverMap map[event.Link]chan proton.Message
-
-type handler struct {
-	connection *Connection
-	acks       acksMap
-	receivers  receiverMap
-}
-
-func newHandler(c *Connection) *handler {
-	return &handler{c, make(acksMap), make(receiverMap)}
-}
-
-func (h *handler) HandleMessagingEvent(t event.MessagingEventType, e event.Event) error {
-	switch t {
-	// FIXME aconway 2015-04-29: handle errors.
-	case event.MConnectionClosed:
-		for _, ack := range h.acks {
-			// FIXME aconway 2015-04-29: communicate error info
-			close(ack)
-		}
-
-	case event.MSettled:
-		ack := h.acks[e.Delivery()]
-		if ack != nil {
-			ack <- Disposition(e.Delivery().Remote().Type())
-			close(ack)
-			delete(h.acks, e.Delivery())
-		}
-
-	case event.MMessage:
-		r := h.receivers[e.Link()]
-		if r != nil {
-			m, _ := event.DecodeMessage(e)
-			// FIXME aconway 2015-04-29: hack, direct send, possible blocking.
-			r <- m
-		} else {
-			// FIXME aconway 2015-04-29: Message with no receiver - log? panic? deadletter? drop?
-		}
-	}
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/messaging.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/messaging.go b/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/messaging.go
deleted file mode 100644
index d32aada..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/messaging/messaging.go
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package messaging
-
-// #include <proton/disposition.h>
-import "C"
-
-import (
-	"net"
-	"qpid.apache.org/proton"
-	"qpid.apache.org/proton/event"
-)
-
-// Connection is a connection to a remote AMQP endpoint.
-//
-// You can set exported fields to configure the connection before calling
-// Connection.Open()
-//
-type Connection struct {
-	// Server = true means a the connection will do automatic protocol detection.
-	Server bool
-
-	// FIXME aconway 2015-04-17: Other parameters to set up SSL, SASL etc.
-
-	handler *handler
-	pump    *event.Pump
-	session Session
-}
-
-// Make an AMQP connection over a net.Conn connection.
-//
-// Use Connection.Close() to close the Connection, this will also close conn.
-// Using conn.Close() directly will cause an abrupt disconnect rather than an
-// orderly AMQP close.
-//
-func (c *Connection) Open(conn net.Conn) (err error) {
-	c.handler = newHandler(c)
-	c.pump, err = event.NewPump(conn,
-		event.NewMessagingDelegator(c.handler),
-	)
-	if err != nil {
-		return err
-	}
-	if c.Server {
-		c.pump.Server()
-	}
-	go c.pump.Run()
-	return nil
-}
-
-// Connect opens a default client connection. It is a shortcut for
-//    c := &Connection
-//    c.Open()
-//
-func Connect(conn net.Conn) (*Connection, error) {
-	c := &Connection{}
-	err := c.Open(conn)
-	return c, err
-}
-
-// Close the connection.
-//
-// Connections must be closed to clean up resources and stop associated goroutines.
-func (c *Connection) Close() error { return c.pump.Close() }
-
-// DefaultSession returns a default session for the connection.
-//
-// It is created on the first call to DefaultSession() and returned from all subsequent calls.
-// Use Session() for more control over creating sessions.
-//
-func (c *Connection) DefaultSession() (s Session, err error) {
-	if c.session.e.IsNil() {
-		c.session, err = c.Session()
-	}
-	return c.session, err
-}
-
-type sessionErr struct {
-	s   event.Session
-	err error
-}
-
-// Session creates a new session.
-func (c *Connection) Session() (Session, error) {
-	connection := c.pump.Connection()
-	result := make(chan sessionErr)
-	c.pump.Inject <- func() {
-		s, err := connection.Session()
-		if err == nil {
-			s.Open()
-		}
-		result <- sessionErr{s, err}
-	}
-	se := <-result
-	return Session{se.s, c.pump}, se.err
-}
-
-// FIXME aconway 2015-04-27: set sender name, options etc.
-
-// Sender creates a Sender that will send messages to the address addr.
-func (c *Connection) Sender(addr string) (s Sender, err error) {
-	session, err := c.DefaultSession()
-	if err != nil {
-		return Sender{}, err
-	}
-	result := make(chan Sender)
-	c.pump.Inject <- func() {
-		link := session.e.Sender(linkNames.Next())
-		if link.IsNil() {
-			err = session.e.Error()
-		} else {
-			link.Target().SetAddress(addr)
-			// FIXME aconway 2015-04-27: link options?
-			link.Open()
-		}
-		result <- Sender{Link{c, link}}
-	}
-	return <-result, err
-}
-
-// Receiver returns a receiver that will receive messages sent to address addr.
-func (c *Connection) Receiver(addr string) (r Receiver, err error) {
-	// FIXME aconway 2015-04-29: move code to session, in link.go?
-	session, err := c.DefaultSession()
-	if err != nil {
-		return Receiver{}, err
-	}
-	result := make(chan Receiver)
-	c.pump.Inject <- func() {
-		link := session.e.Receiver(linkNames.Next())
-		if link.IsNil() {
-			err = session.e.Error()
-		} else {
-			link.Source().SetAddress(addr)
-			// FIXME aconway 2015-04-27: link options?
-			link.Open()
-		}
-		// FIXME aconway 2015-04-29: hack to avoid blocking, need proper buffering linked to flow control
-		rchan := make(chan proton.Message, 1000)
-		c.handler.receivers[link] = rchan
-		result <- Receiver{Link{c, link}, rchan}
-	}
-	return <-result, err
-}
-
-// FIXME aconway 2015-04-29: counter per session.
-var linkNames proton.UidCounter
-
-// Session is an AMQP session, it contains Senders and Receivers.
-// Every Connection has a DefaultSession, you can create additional sessions
-// with Connection.Session()
-type Session struct {
-	e    event.Session
-	pump *event.Pump
-}
-
-// FIXME aconway 2015-05-05: REWORK Sender/receiver/session.
-
-// Disposition indicates the outcome of a settled message delivery.
-type Disposition uint64
-
-const (
-	// Message was accepted by the receiver
-	Accepted Disposition = C.PN_ACCEPTED
-	// Message was rejected as invalid by the receiver
-	Rejected = C.PN_REJECTED
-	// Message was not processed by the receiver but may be processed by some other receiver.
-	Released = C.PN_RELEASED
-)
-
-// String human readable name for a Disposition.
-func (d Disposition) String() string {
-	switch d {
-	case Accepted:
-		return "Accepted"
-	case Rejected:
-		return "Rejected"
-	case Released:
-		return "Released"
-	default:
-		return "Unknown"
-	}
-}
-
-// FIXME aconway 2015-04-29: How to signal errors via ack channels.
-
-// An Acknowledgement is a channel which will receive the Disposition of the message
-// when it is acknowledged. The channel is closed after the disposition is sent.
-type Acknowledgement <-chan Disposition
-
-// Link has common data and methods for Sender and Receiver links.
-type Link struct {
-	connection *Connection
-	elink      event.Link
-}
-
-// Sender sends messages.
-type Sender struct {
-	Link
-}
-
-// FIXME aconway 2015-04-28: allow user to specify delivery tag.
-// FIXME aconway 2015-04-28: should we provide a sending channel rather than a send function?
-
-// Send sends a message. If d is not nil, the disposition is retured on d.
-// If d is nil the message is sent pre-settled and no disposition is returned.
-func (s *Sender) Send(m proton.Message) (ack Acknowledgement, err error) {
-	ackChan := make(chan Disposition, 1)
-	ack = ackChan
-	s.connection.pump.Inject <- func() {
-		// FIXME aconway 2015-04-28: flow control & credit, buffer or fail?
-		delivery, err := s.elink.Send(m)
-		if err == nil { // FIXME aconway 2015-04-28: error handling
-			s.connection.handler.acks[delivery] = ackChan
-		}
-	}
-	return ack, nil
-}
-
-// Close the sender.
-func (s *Sender) Close() error { return nil } // FIXME aconway 2015-04-27: close/free
-
-// Receiver receives messages via the channel Receive.
-type Receiver struct {
-	Link
-	// Channel of messag
-	Receive <-chan proton.Message
-}
-
-// FIXME aconway 2015-04-29: settlement - ReceivedMessage with Settle() method?
-
-// Close the Receiver.
-func (r *Receiver) Close() error { return nil } // FIXME aconway 2015-04-29: close/free

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/types.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/types.go b/proton-c/bindings/go/src/qpid.apache.org/proton/types.go
deleted file mode 100644
index 07f8aea..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/types.go
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// #include <proton/codec.h>
-// const pn_type_t PN_DATA_TYPE_ERROR = (pn_type_t) -1;
-import "C"
-
-import (
-	"bytes"
-	"fmt"
-	"reflect"
-	"time"
-	"unsafe"
-)
-
-func pnTypeString(pt C.pn_type_t) string {
-	switch pt {
-	case C.PN_NULL:
-		return "null"
-	case C.PN_BOOL:
-		return "bool"
-	case C.PN_UBYTE:
-		return "ubyte"
-	case C.PN_BYTE:
-		return "byte"
-	case C.PN_USHORT:
-		return "ushort"
-	case C.PN_SHORT:
-		return "short"
-	case C.PN_CHAR:
-		return "char"
-	case C.PN_UINT:
-		return "uint"
-	case C.PN_INT:
-		return "int"
-	case C.PN_ULONG:
-		return "ulong"
-	case C.PN_LONG:
-		return "long"
-	case C.PN_TIMESTAMP:
-		return "timestamp"
-	case C.PN_FLOAT:
-		return "float"
-	case C.PN_DOUBLE:
-		return "double"
-	case C.PN_DECIMAL32:
-		return "decimal32"
-	case C.PN_DECIMAL64:
-		return "decimal64"
-	case C.PN_DECIMAL128:
-		return "decimal128"
-	case C.PN_UUID:
-		return "uuid"
-	case C.PN_BINARY:
-		return "binary"
-	case C.PN_STRING:
-		return "string"
-	case C.PN_SYMBOL:
-		return "symbol"
-	case C.PN_DESCRIBED:
-		return "described"
-	case C.PN_ARRAY:
-		return "array"
-	case C.PN_LIST:
-		return "list"
-	case C.PN_MAP:
-		return "map"
-	case C.PN_DATA_TYPE_ERROR:
-		return "no-data"
-	default:
-		return fmt.Sprintf("unknown-type(%d)", pt)
-	}
-}
-
-// Go types
-var (
-	bytesType = reflect.TypeOf([]byte{})
-	valueType = reflect.TypeOf(reflect.Value{})
-)
-
-// FIXME aconway 2015-04-08: can't handle AMQP maps with key types that are not valid Go map keys.
-
-// Map is a generic map that can have mixed key and value types and so can represent any AMQP map
-type Map map[interface{}]interface{}
-
-// List is a generic list that can hold mixed values and can represent any AMQP list.
-//
-type List []interface{}
-
-// Symbol is a string that is encoded as an AMQP symbol
-type Symbol string
-
-// Binary is a string that is encoded as an AMQP binary.
-// It is a string rather than a byte[] because byte[] is not hashable and can't be used as
-// a map key, AMQP frequently uses binary types as map keys. It can convert to and from []byte
-type Binary string
-
-// GoString for Map prints values with their types, useful for debugging.
-func (m Map) GoString() string {
-	out := &bytes.Buffer{}
-	fmt.Fprintf(out, "%T{", m)
-	i := len(m)
-	for k, v := range m {
-		fmt.Fprintf(out, "%T(%#v): %T(%#v)", k, k, v, v)
-		i--
-		if i > 0 {
-			fmt.Fprint(out, ", ")
-		}
-	}
-	fmt.Fprint(out, "}")
-	return out.String()
-}
-
-// GoString for List prints values with their types, useful for debugging.
-func (l List) GoString() string {
-	out := &bytes.Buffer{}
-	fmt.Fprintf(out, "%T{", l)
-	for i := 0; i < len(l); i++ {
-		fmt.Fprintf(out, "%T(%#v)", l[i], l[i])
-		if i == len(l)-1 {
-			fmt.Fprint(out, ", ")
-		}
-	}
-	fmt.Fprint(out, "}")
-	return out.String()
-}
-
-// pnTime converts Go time.Time to Proton millisecond Unix time.
-func pnTime(t time.Time) C.pn_timestamp_t {
-	secs := t.Unix()
-	// Note: sub-second accuracy is not guaraunteed if the Unix time in
-	// nanoseconds cannot be represented by an int64 (sometime around year 2260)
-	msecs := (t.UnixNano() % int64(time.Second)) / int64(time.Millisecond)
-	return C.pn_timestamp_t(secs*1000 + msecs)
-}
-
-// goTime converts a pn_timestamp_t to a Go time.Time.
-func goTime(t C.pn_timestamp_t) time.Time {
-	secs := int64(t) / 1000
-	nsecs := (int64(t) % 1000) * int64(time.Millisecond)
-	return time.Unix(secs, nsecs)
-}
-
-func goBytes(cBytes C.pn_bytes_t) (bytes []byte) {
-	if cBytes.start != nil {
-		bytes = C.GoBytes(unsafe.Pointer(cBytes.start), C.int(cBytes.size))
-	}
-	return
-}
-
-func goString(cBytes C.pn_bytes_t) (str string) {
-	if cBytes.start != nil {
-		str = C.GoStringN(cBytes.start, C.int(cBytes.size))
-	}
-	return
-}
-
-func pnBytes(b []byte) C.pn_bytes_t {
-	if len(b) == 0 {
-		return C.pn_bytes_t{0, nil}
-	} else {
-		return C.pn_bytes_t{C.size_t(len(b)), (*C.char)(unsafe.Pointer(&b[0]))}
-	}
-}
-
-func cPtr(b []byte) *C.char {
-	if len(b) == 0 {
-		return nil
-	}
-	return (*C.char)(unsafe.Pointer(&b[0]))
-}
-
-func cLen(b []byte) C.size_t {
-	return C.size_t(len(b))
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/uid.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/uid.go b/proton-c/bindings/go/src/qpid.apache.org/proton/uid.go
deleted file mode 100644
index de80846..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/uid.go
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Generating unique IDs for various things.
-
-package proton
-
-import (
-	"strconv"
-	"sync/atomic"
-)
-
-// A simple atomic counter to generate unique 64 bit IDs.
-type UidCounter struct{ count uint64 }
-
-// NextInt gets the next uint64 value from the atomic counter.
-func (uc *UidCounter) NextInt() uint64 {
-	return atomic.AddUint64(&uc.count, 1)
-}
-
-// Next gets the next integer value encoded as a base32 string, safe for NUL terminated C strings.
-func (uc *UidCounter) Next() string {
-	return strconv.FormatUint(uc.NextInt(), 32)
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/unmarshal.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/unmarshal.go b/proton-c/bindings/go/src/qpid.apache.org/proton/unmarshal.go
deleted file mode 100644
index f904aae..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/unmarshal.go
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-oor more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"qpid.apache.org/proton/internal"
-	"reflect"
-	"unsafe"
-)
-
-const minDecode = 1024
-
-// Error returned if AMQP data cannot be unmarshaled as the desired Go type.
-type BadUnmarshal struct {
-	// The name of the AMQP type.
-	AMQPType string
-	// The Go type.
-	GoType reflect.Type
-}
-
-func newBadUnmarshal(pnType C.pn_type_t, v interface{}) *BadUnmarshal {
-	return &BadUnmarshal{pnTypeString(pnType), reflect.TypeOf(v)}
-}
-
-func (e BadUnmarshal) Error() string {
-	if e.GoType.Kind() != reflect.Ptr {
-		return fmt.Sprintf("proton: cannot unmarshal to type %s, not a pointer", e.GoType)
-	} else {
-		return fmt.Sprintf("proton: cannot unmarshal AMQP %s to %s", e.AMQPType, e.GoType)
-	}
-}
-
-//
-// Decoding from a pn_data_t
-//
-// NOTE: we use panic() to signal a decoding error, simplifies decoding logic.
-// We recover() at the highest possible level - i.e. in the exported Unmarshal or Decode.
-//
-
-// Decoder decodes AMQP values from an io.Reader.
-//
-type Decoder struct {
-	reader io.Reader
-	buffer bytes.Buffer
-}
-
-// NewDecoder returns a new decoder that reads from r.
-//
-// The decoder has it's own buffer and may read more data than required for the
-// AMQP values requested.  Use Buffered to see if there is data left in the
-// buffer.
-//
-func NewDecoder(r io.Reader) *Decoder {
-	return &Decoder{r, bytes.Buffer{}}
-}
-
-// Buffered returns a reader of the data remaining in the Decoder's buffer. The
-// reader is valid until the next call to Decode.
-//
-func (d *Decoder) Buffered() io.Reader {
-	return bytes.NewReader(d.buffer.Bytes())
-}
-
-// Decode reads the next AMQP value from the Reader and stores it in the value pointed to by v.
-//
-// See the documentation for Unmarshal for details about the conversion of AMQP into a Go value.
-//
-func (d *Decoder) Decode(v interface{}) (err error) {
-	defer internal.DoRecover(&err)
-	data := C.pn_data(0)
-	defer C.pn_data_free(data)
-	var n int
-	for n == 0 && err == nil {
-		n = unmarshal(data, d.buffer.Bytes(), v)
-		if n == 0 { // n == 0 means not enough data, read more
-			err = d.more()
-			if err != nil {
-				return
-			}
-		}
-	}
-	d.buffer.Next(n)
-	return
-}
-
-/*
-Unmarshal decodes AMQP-encoded bytes and stores the result in the value pointed to by v.
-Types are converted as follows:
-
- +---------------------------+----------------------------------------------------------------------+
- |To Go types                |From AMQP types                                                       |
- +===========================+======================================================================+
- |bool                       |bool                                                                  |
- +---------------------------+----------------------------------------------------------------------+
- |int, int8, int16,          |Equivalent or smaller signed integer type: char, byte, short, int,    |
- |int32, int64               |long.                                                                 |
- +---------------------------+----------------------------------------------------------------------+
- |uint, uint8, uint16,       |Equivalent or smaller unsigned integer type: char, ubyte, ushort,     |
- |uint32, uint64 types       |uint, ulong                                                           |
- +---------------------------+----------------------------------------------------------------------+
- |float32, float64           |Equivalent or smaller float or double.                                |
- +---------------------------+----------------------------------------------------------------------+
- |string, []byte             |string, symbol or binary.                                             |
- +---------------------------+----------------------------------------------------------------------+
- |Symbol                     |symbol                                                                |
- +---------------------------+----------------------------------------------------------------------+
- |map[K]T                    |map, provided all keys and values can unmarshal to types K, T         |
- +---------------------------+----------------------------------------------------------------------+
- |Map                        |map, any AMQP map                                                     |
- +---------------------------+----------------------------------------------------------------------+
- |interface{}                |Any AMQP value can be unmarshaled to an interface{} as follows:       |
- |                           +------------------------+---------------------------------------------+
- |                           |AMQP Type               |Go Type in interface{}                       |
- |                           +========================+=============================================+
- |                           |bool                    |bool                                         |
- |                           +------------------------+---------------------------------------------+
- |                           |char                    |unint8                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |byte,short,int,long     |int8,int16,int32,int64                       |
- |                           +------------------------+---------------------------------------------+
- |                           |ubyte,ushort,uint,ulong |uint8,uint16,uint32,uint64                   |
- |                           +------------------------+---------------------------------------------+
- |                           |float, double           |float32, float64                             |
- |                           +------------------------+---------------------------------------------+
- |                           |string                  |string                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |symbol                  |Symbol                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |binary                  |Binary                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |nulll                   |nil                                          |
- |                           +------------------------+---------------------------------------------+
- |                           |map                     |Map                                          |
- |                           +------------------------+---------------------------------------------+
- |                           |list                    |List                                         |
- +---------------------------+------------------------+---------------------------------------------+
-
-The following Go types cannot be unmarshaled: complex64/128, uintptr, function, interface, channel.
-
-TODO types
-
-AMQP: timestamp, decimal32/64/128, uuid, described, array.
-
-Go: array, struct.
-
-Maps: currently we cannot unmarshal AMQP maps with unhashable key types, need an alternate
-representation for those.
-*/
-func Unmarshal(bytes []byte, v interface{}) (n int, err error) {
-	defer internal.DoRecover(&err)
-	data := C.pn_data(0)
-	defer C.pn_data_free(data)
-	n = unmarshal(data, bytes, v)
-	if n == 0 {
-		err = internal.Errorf("not enough data")
-	}
-	return
-}
-
-// more reads more data when we can't parse a complete AMQP type
-func (d *Decoder) more() error {
-	var readSize int64 = minDecode
-	if int64(d.buffer.Len()) > readSize { // Grow by doubling
-		readSize = int64(d.buffer.Len())
-	}
-	var n int64
-	n, err := d.buffer.ReadFrom(io.LimitReader(d.reader, readSize))
-	if n == 0 && err == nil { // ReadFrom won't report io.EOF, just returns 0
-		err = io.EOF
-	}
-	return err
-}
-
-// unmarshal decodes from bytes and converts into the value pointed to by v.
-// Used by Unmarshal and Decode
-//
-// Returns the number of bytes decoded or 0 if not enough data.
-//
-func unmarshal(data *C.pn_data_t, bytes []byte, v interface{}) (n int) {
-	n = decode(data, bytes)
-	if n == 0 {
-		return 0
-	}
-	get(data, v)
-	return
-}
-
-// get value from data into value pointed at by v.
-func get(data *C.pn_data_t, v interface{}) {
-	pnType := C.pn_data_type(data)
-
-	switch v := v.(type) {
-	case *bool:
-		switch pnType {
-		case C.PN_BOOL:
-			*v = bool(C.pn_data_get_bool(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	case *int8:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int8(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int8(C.pn_data_get_byte(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	case *uint8:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint8(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint8(C.pn_data_get_ubyte(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	case *int16:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int16(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int16(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int16(C.pn_data_get_short(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	case *uint16:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint16(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint16(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint16(C.pn_data_get_ushort(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	case *int32:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int32(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int32(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int32(C.pn_data_get_short(data))
-		case C.PN_INT:
-			*v = int32(C.pn_data_get_int(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	case *uint32:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint32(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint32(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint32(C.pn_data_get_ushort(data))
-		case C.PN_UINT:
-			*v = uint32(C.pn_data_get_uint(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *int64:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int64(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int64(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int64(C.pn_data_get_short(data))
-		case C.PN_INT:
-			*v = int64(C.pn_data_get_int(data))
-		case C.PN_LONG:
-			*v = int64(C.pn_data_get_long(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *uint64:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint64(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint64(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint64(C.pn_data_get_ushort(data))
-		case C.PN_ULONG:
-			*v = uint64(C.pn_data_get_ulong(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *int:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int(C.pn_data_get_short(data))
-		case C.PN_INT:
-			*v = int(C.pn_data_get_int(data))
-		case C.PN_LONG:
-			if unsafe.Sizeof(0) == 8 {
-				*v = int(C.pn_data_get_long(data))
-			} else {
-				panic(newBadUnmarshal(pnType, v))
-			}
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *uint:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint(C.pn_data_get_ushort(data))
-		case C.PN_UINT:
-			*v = uint(C.pn_data_get_uint(data))
-		case C.PN_ULONG:
-			if unsafe.Sizeof(0) == 8 {
-				*v = uint(C.pn_data_get_ulong(data))
-			} else {
-				panic(newBadUnmarshal(pnType, v))
-			}
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *float32:
-		switch pnType {
-		case C.PN_FLOAT:
-			*v = float32(C.pn_data_get_float(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *float64:
-		switch pnType {
-		case C.PN_FLOAT:
-			*v = float64(C.pn_data_get_float(data))
-		case C.PN_DOUBLE:
-			*v = float64(C.pn_data_get_double(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *string:
-		switch pnType {
-		case C.PN_STRING:
-			*v = goString(C.pn_data_get_string(data))
-		case C.PN_SYMBOL:
-			*v = goString(C.pn_data_get_symbol(data))
-		case C.PN_BINARY:
-			*v = goString(C.pn_data_get_binary(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *[]byte:
-		switch pnType {
-		case C.PN_STRING:
-			*v = goBytes(C.pn_data_get_string(data))
-		case C.PN_SYMBOL:
-			*v = goBytes(C.pn_data_get_symbol(data))
-		case C.PN_BINARY:
-			*v = goBytes(C.pn_data_get_binary(data))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *Binary:
-		switch pnType {
-		case C.PN_BINARY:
-			*v = Binary(goBytes(C.pn_data_get_binary(data)))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *Symbol:
-		switch pnType {
-		case C.PN_SYMBOL:
-			*v = Symbol(goBytes(C.pn_data_get_symbol(data)))
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-
-	case *interface{}:
-		getInterface(data, v)
-
-	default:
-		if reflect.TypeOf(v).Kind() != reflect.Ptr {
-			panic(newBadUnmarshal(pnType, v))
-		}
-		switch reflect.TypeOf(v).Elem().Kind() {
-		case reflect.Map:
-			getMap(data, v)
-		case reflect.Slice:
-			getList(data, v)
-		default:
-			panic(newBadUnmarshal(pnType, v))
-		}
-	}
-	err := dataError("unmarshaling", data)
-	if err != nil {
-		panic(err)
-	}
-	return
-}
-
-// Getting into an interface is driven completely by the AMQP type, since the interface{}
-// target is type-neutral.
-func getInterface(data *C.pn_data_t, v *interface{}) {
-	pnType := C.pn_data_type(data)
-	switch pnType {
-	case C.PN_NULL:
-		*v = nil
-	case C.PN_BOOL:
-		*v = bool(C.pn_data_get_bool(data))
-	case C.PN_UBYTE:
-		*v = uint8(C.pn_data_get_ubyte(data))
-	case C.PN_BYTE:
-		*v = int8(C.pn_data_get_byte(data))
-	case C.PN_USHORT:
-		*v = uint16(C.pn_data_get_ushort(data))
-	case C.PN_SHORT:
-		*v = int16(C.pn_data_get_short(data))
-	case C.PN_UINT:
-		*v = uint32(C.pn_data_get_uint(data))
-	case C.PN_INT:
-		*v = int32(C.pn_data_get_int(data))
-	case C.PN_CHAR:
-		*v = uint8(C.pn_data_get_char(data))
-	case C.PN_ULONG:
-		*v = uint64(C.pn_data_get_ulong(data))
-	case C.PN_LONG:
-		*v = int64(C.pn_data_get_long(data))
-	case C.PN_FLOAT:
-		*v = float32(C.pn_data_get_float(data))
-	case C.PN_DOUBLE:
-		*v = float64(C.pn_data_get_double(data))
-	case C.PN_BINARY:
-		*v = Binary(goBytes(C.pn_data_get_binary(data)))
-	case C.PN_STRING:
-		*v = goString(C.pn_data_get_string(data))
-	case C.PN_SYMBOL:
-		*v = Symbol(goString(C.pn_data_get_symbol(data)))
-	case C.PN_MAP:
-		m := make(Map)
-		get(data, &m)
-		*v = m // FIXME aconway 2015-03-13: avoid the copy?
-	case C.PN_LIST:
-		l := make(List, 0)
-		get(data, &l)
-		*v = l // FIXME aconway 2015-03-13: avoid the copy?
-	default:
-		panic(newBadUnmarshal(pnType, v))
-	}
-}
-
-// get into map pointed at by v
-func getMap(data *C.pn_data_t, v interface{}) {
-	pnType := C.pn_data_type(data)
-	if pnType != C.PN_MAP {
-		panic(newBadUnmarshal(pnType, v))
-	}
-	mapValue := reflect.ValueOf(v).Elem()
-	mapValue.Set(reflect.MakeMap(mapValue.Type())) // Clear the map
-	count := int(C.pn_data_get_map(data))
-	if bool(C.pn_data_enter(data)) {
-		for i := 0; i < count/2; i++ {
-			if bool(C.pn_data_next(data)) {
-				key := reflect.New(mapValue.Type().Key())
-				get(data, key.Interface())
-				if bool(C.pn_data_next(data)) {
-					val := reflect.New(mapValue.Type().Elem())
-					get(data, val.Interface())
-					mapValue.SetMapIndex(key.Elem(), val.Elem())
-				}
-			}
-		}
-		C.pn_data_exit(data)
-	}
-}
-
-func getList(data *C.pn_data_t, v interface{}) {
-	pnType := C.pn_data_type(data)
-	if pnType != C.PN_LIST {
-		panic(newBadUnmarshal(pnType, v))
-	}
-	count := int(C.pn_data_get_list(data))
-	listValue := reflect.MakeSlice(reflect.TypeOf(v).Elem(), count, count)
-	if bool(C.pn_data_enter(data)) {
-		for i := 0; i < count; i++ {
-			if bool(C.pn_data_next(data)) {
-				val := reflect.New(listValue.Type().Elem())
-				get(data, val.Interface())
-				listValue.Index(i).Set(val.Elem())
-			}
-		}
-		C.pn_data_exit(data)
-	}
-	// FIXME aconway 2015-04-09: avoid the copy?
-	reflect.ValueOf(v).Elem().Set(listValue)
-}
-
-// decode from bytes.
-// Return bytes decoded or 0 if we could not decode a complete object.
-//
-func decode(data *C.pn_data_t, bytes []byte) int {
-	if len(bytes) == 0 {
-		return 0
-	}
-	n := int(C.pn_data_decode(data, cPtr(bytes), cLen(bytes)))
-	if n == int(C.PN_UNDERFLOW) {
-		C.pn_error_clear(C.pn_data_error(data))
-		return 0
-	} else if n <= 0 {
-		panic(internal.Errorf("unmarshal %s", internal.PnErrorCode(n)))
-	}
-	return n
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/url.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/url.go b/proton-c/bindings/go/src/qpid.apache.org/proton/url.go
deleted file mode 100644
index 5bac6ac..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/url.go
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-/*
-#include <stdlib.h>
-#include <string.h>
-#include <proton/url.h>
-
-// Helper function for setting URL fields.
-typedef void (*setter_fn)(pn_url_t* url, const char* value);
-inline void	set(pn_url_t *url, setter_fn s, const char* value) {
-  s(url, value);
-}
-*/
-import "C"
-
-import (
-	"net"
-	"net/url"
-	"qpid.apache.org/proton/internal"
-	"unsafe"
-)
-
-const (
-	amqp  string = "amqp"
-	amqps        = "amqps"
-)
-
-// ParseUrl parses an AMQP URL string and returns a net/url.Url.
-//
-// It is more forgiving than net/url.Parse and allows most of the parts of the
-// URL to be missing, assuming AMQP defaults.
-//
-func ParseURL(s string) (u *url.URL, err error) {
-	cstr := C.CString(s)
-	defer C.free(unsafe.Pointer(cstr))
-	pnUrl := C.pn_url_parse(cstr)
-	if pnUrl == nil {
-		return nil, internal.Errorf("bad URL %#v", s)
-	}
-	defer C.pn_url_free(pnUrl)
-
-	scheme := C.GoString(C.pn_url_get_scheme(pnUrl))
-	username := C.GoString(C.pn_url_get_username(pnUrl))
-	password := C.GoString(C.pn_url_get_password(pnUrl))
-	host := C.GoString(C.pn_url_get_host(pnUrl))
-	port := C.GoString(C.pn_url_get_port(pnUrl))
-	path := C.GoString(C.pn_url_get_path(pnUrl))
-
-	if err != nil {
-		return nil, internal.Errorf("bad URL %#v: %s", s, err)
-	}
-	if scheme == "" {
-		scheme = amqp
-	}
-	if port == "" {
-		if scheme == amqps {
-			port = amqps
-		} else {
-			port = amqp
-		}
-	}
-	var user *url.Userinfo
-	if password != "" {
-		user = url.UserPassword(username, password)
-	} else if username != "" {
-		user = url.User(username)
-	}
-
-	u = &url.URL{
-		Scheme: scheme,
-		User:   user,
-		Host:   net.JoinHostPort(host, port),
-		Path:   path,
-	}
-
-	return u, nil
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/url_test.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/url_test.go b/proton-c/bindings/go/src/qpid.apache.org/proton/url_test.go
deleted file mode 100644
index 7315511..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/url_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import (
-	"fmt"
-)
-
-func ExampleParseURL() {
-	for _, s := range []string{
-		"amqp://username:password@host:1234/path",
-		"host:1234",
-		"host",
-		":1234",
-		"host/path",
-		"amqps://host",
-		"",
-	} {
-		u, err := ParseURL(s)
-		if err != nil {
-			fmt.Println(err)
-		} else {
-			fmt.Println(u)
-		}
-	}
-	// Output:
-	// amqp://username:password@host:1234/path
-	// amqp://host:1234
-	// amqp://host:amqp
-	// amqp://:1234
-	// amqp://host:amqp/path
-	// amqps://host:amqps
-	// proton: bad URL ""
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[19/24] qpid-proton git commit: PROTON-883: Wrap pn_transport_peek for Ruby.

Posted by ac...@apache.org.
PROTON-883: Wrap pn_transport_peek for Ruby.

Returns an array consisting of the number of bytes returned an a String
packed with the bytes in the buffer.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/585b306b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/585b306b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/585b306b

Branch: refs/heads/go1
Commit: 585b306bd22f500cdfc268c759ed2b9c7738940e
Parents: ff159e8
Author: Darryl L. Pierce <mc...@gmail.com>
Authored: Mon May 11 10:01:46 2015 -0400
Committer: Darryl L. Pierce <mc...@gmail.com>
Committed: Tue May 19 08:06:49 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/ruby/ruby.i | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/585b306b/proton-c/bindings/ruby/ruby.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
index e0ffb17..7380068 100644
--- a/proton-c/bindings/ruby/ruby.i
+++ b/proton-c/bindings/ruby/ruby.i
@@ -273,6 +273,20 @@ ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGT
 %}
 %ignore pn_transport_output;
 
+%rename(pn_transport_peek) wrap_pn_transport_peek;
+%inline %{
+  int wrap_pn_transport_peek(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
+    ssize_t sz = pn_transport_peek(transport, OUTPUT, OUTPUT_SIZE);
+    if(sz >= 0) {
+      *OUTPUT_SIZE = sz;
+    } else {
+      *OUTPUT_SIZE = 0;
+    }
+    return sz;
+  }
+%}
+%ignore pn_transport_peek;
+
 %rename(pn_delivery) wrap_pn_delivery;
 %inline %{
   pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[22/24] qpid-proton git commit: PROTON-885: add manifest, move license file into setuputils

Posted by ac...@apache.org.
PROTON-885: add manifest, move license file into setuputils


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c1f9ed41
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c1f9ed41
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c1f9ed41

Branch: refs/heads/go1
Commit: c1f9ed41ac144f4cd451af4f3e0d0ba36dd1f203
Parents: d98fa57
Author: Ken Giusti <kg...@apache.org>
Authored: Wed May 20 19:56:29 2015 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Wed May 20 19:56:29 2015 -0400

----------------------------------------------------------------------
 LICENSE                                         |  9 +++---
 proton-c/bindings/python/MANIFEST.in            |  2 ++
 proton-c/bindings/python/PYZMQ_LICENSE.BSD      | 32 --------------------
 .../python/setuputils/PYZMQ_LICENSE.BSD         | 32 ++++++++++++++++++++
 4 files changed, 39 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c1f9ed41/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 6d1be4d..7d0fda9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -208,7 +208,8 @@ Proton includes freegetopt with a separate BSD license.  Your use
 of the source code for freegetopt is subject to the terms and
 conditions of its license in examples/include/pncompat/internal/LICENSE.
 
-The python bindings includes files derived by PyZMQ an are licensed
-with a separate Modified BSD license.  Use of the source code in these
-files are subject to the terms and conditions in the license:
-proton-c/bindings/python/PYZMQ_LICENSE.BSD.
+The setup scripts for the python bindings include files derived by
+PyZMQ and are licensed with a separate Modified BSD license.  Use of
+the source code in these setup files are subject to the terms and
+conditions in the license:
+proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c1f9ed41/proton-c/bindings/python/MANIFEST.in
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/MANIFEST.in b/proton-c/bindings/python/MANIFEST.in
new file mode 100644
index 0000000..a89a962
--- /dev/null
+++ b/proton-c/bindings/python/MANIFEST.in
@@ -0,0 +1,2 @@
+graft docs
+graft setuputils

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c1f9ed41/proton-c/bindings/python/PYZMQ_LICENSE.BSD
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/PYZMQ_LICENSE.BSD b/proton-c/bindings/python/PYZMQ_LICENSE.BSD
deleted file mode 100644
index a0a3790..0000000
--- a/proton-c/bindings/python/PYZMQ_LICENSE.BSD
+++ /dev/null
@@ -1,32 +0,0 @@
-PyZMQ is licensed under the terms of the Modified BSD License (also known as
-New or Revised BSD), as follows:
-
-Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright notice, this
-list of conditions and the following disclaimer in the documentation and/or
-other materials provided with the distribution.
-
-Neither the name of PyZMQ nor the names of its contributors may be used to
-endorse or promote products derived from this software without specific prior
-written permission.
-
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c1f9ed41/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD b/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD
new file mode 100644
index 0000000..a0a3790
--- /dev/null
+++ b/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD
@@ -0,0 +1,32 @@
+PyZMQ is licensed under the terms of the Modified BSD License (also known as
+New or Revised BSD), as follows:
+
+Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+Neither the name of PyZMQ nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[16/24] qpid-proton git commit: PROTON-861: add dummy impl method to ssl stub

Posted by ac...@apache.org.
PROTON-861: add dummy impl method to ssl stub


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/37fc7be5
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/37fc7be5
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/37fc7be5

Branch: refs/heads/go1
Commit: 37fc7be58fa518961aca4a8da1dcd64c7c83a804
Parents: cb6c172
Author: Gordon Sim <gs...@redhat.com>
Authored: Fri May 15 19:43:49 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Fri May 15 19:44:14 2015 +0100

----------------------------------------------------------------------
 proton-c/src/ssl/ssl_stub.c | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/37fc7be5/proton-c/src/ssl/ssl_stub.c
----------------------------------------------------------------------
diff --git a/proton-c/src/ssl/ssl_stub.c b/proton-c/src/ssl/ssl_stub.c
index cea5dc4..4749d0c 100644
--- a/proton-c/src/ssl/ssl_stub.c
+++ b/proton-c/src/ssl/ssl_stub.c
@@ -137,3 +137,8 @@ int pn_ssl_get_peer_hostname( pn_ssl_t *ssl, char *hostname, size_t *bufsize )
 {
   return -1;
 }
+
+const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl)
+{
+  return NULL;
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[17/24] qpid-proton git commit: PROTON-861: PROTON-887: add dummy impl method to schannel impl

Posted by ac...@apache.org.
PROTON-861: PROTON-887: add dummy impl method to schannel impl


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ff159e81
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ff159e81
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ff159e81

Branch: refs/heads/go1
Commit: ff159e815b7d843abd2f0bbf93709a933b5acee8
Parents: 37fc7be
Author: Gordon Sim <gs...@redhat.com>
Authored: Fri May 15 19:56:58 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Fri May 15 19:56:58 2015 +0100

----------------------------------------------------------------------
 proton-c/src/windows/schannel.c | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ff159e81/proton-c/src/windows/schannel.c
----------------------------------------------------------------------
diff --git a/proton-c/src/windows/schannel.c b/proton-c/src/windows/schannel.c
index 57d2256..78d05bf 100644
--- a/proton-c/src/windows/schannel.c
+++ b/proton-c/src/windows/schannel.c
@@ -795,6 +795,12 @@ int pn_ssl_get_peer_hostname( pn_ssl_t *ssl0, char *hostname, size_t *bufsize )
   return 0;
 }
 
+const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl)
+{
+  //TODO: actual implementation
+  return NULL;
+}
+
 
 /** SChannel specific: */
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[09/24] qpid-proton git commit: PROTON-860: store ssl_domain pointer as PN_VOID

Posted by ac...@apache.org.
PROTON-860: store ssl_domain pointer as PN_VOID


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d4437729
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d4437729
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d4437729

Branch: refs/heads/go1
Commit: d4437729d5b3bed6209f01aa52629574142e14e4
Parents: 995e00d
Author: Gordon Sim <gs...@redhat.com>
Authored: Thu May 14 15:04:23 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Thu May 14 15:04:23 2015 +0100

----------------------------------------------------------------------
 proton-c/src/reactor/acceptor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4437729/proton-c/src/reactor/acceptor.c
----------------------------------------------------------------------
diff --git a/proton-c/src/reactor/acceptor.c b/proton-c/src/reactor/acceptor.c
index 31fa0cc..819af8e 100644
--- a/proton-c/src/reactor/acceptor.c
+++ b/proton-c/src/reactor/acceptor.c
@@ -92,6 +92,6 @@ void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain
 {
   pn_selectable_t *sel = (pn_selectable_t *) acceptor;
   pn_record_t *record = pn_selectable_attachments(sel);
-  pn_record_def(record, PNI_ACCEPTOR_SSL_DOMAIN, PN_WEAKREF);
+  pn_record_def(record, PNI_ACCEPTOR_SSL_DOMAIN, PN_VOID);
   pn_record_set(record, PNI_ACCEPTOR_SSL_DOMAIN, domain);
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[07/24] qpid-proton git commit: NO-JIRA: updated go README for change of branch.

Posted by ac...@apache.org.
NO-JIRA: updated go README for change of branch.

Using go1 instead of go, go get will download from this branch.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d5bd60d9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d5bd60d9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d5bd60d9

Branch: refs/heads/go1
Commit: d5bd60d9aa001533ce23bb202465756eec02903b
Parents: 5741434
Author: Alan Conway <ac...@redhat.com>
Authored: Wed May 13 16:30:30 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Wed May 13 16:30:30 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/go/README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d5bd60d9/proton-c/bindings/go/README.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/README.md b/proton-c/bindings/go/README.md
index 9fd0a0f..4ac15a1 100644
--- a/proton-c/bindings/go/README.md
+++ b/proton-c/bindings/go/README.md
@@ -1,5 +1,5 @@
 # *EXPERIMENTAL* Go binding for proton
 
-Experimental work on the Go language binding has been moved to the `go` branch
-until it is ready for use. You can `git checkout go` on your git clone, or
-browse at https://github.com/apache/qpid-proton/blob/go/proton-c/bindings/go/README.md
+Experimental work on the Go language binding has been moved to the `go1` branch
+until it is ready for use. You can `git checkout go1` on your git clone, or
+browse at https://github.com/apache/qpid-proton/blob/go/proton-c/bindings/go1/README.md


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[23/24] qpid-proton git commit: PROTON-883: Fixed using a pointer value as a size - It's not clear to me how the warning message this caused went ignored - It's also not clear to me why this error passed the tests without crashing, probably the ruby te

Posted by ac...@apache.org.
PROTON-883: Fixed using a pointer value as a size
- It's not clear to me how the warning message this caused went ignored
- It's also not clear to me why this error passed the tests without
  crashing, probably the ruby tests need improving.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e349a021
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e349a021
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e349a021

Branch: refs/heads/go1
Commit: e349a02120d306babb0219238f172c26cc8b49ea
Parents: c1f9ed4
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu May 21 16:27:25 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu May 21 16:27:25 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/ruby/ruby.i | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e349a021/proton-c/bindings/ruby/ruby.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
index 7380068..7205f57 100644
--- a/proton-c/bindings/ruby/ruby.i
+++ b/proton-c/bindings/ruby/ruby.i
@@ -276,7 +276,7 @@ ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGT
 %rename(pn_transport_peek) wrap_pn_transport_peek;
 %inline %{
   int wrap_pn_transport_peek(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_transport_peek(transport, OUTPUT, OUTPUT_SIZE);
+    ssize_t sz = pn_transport_peek(transport, OUTPUT, *OUTPUT_SIZE);
     if(sz >= 0) {
       *OUTPUT_SIZE = sz;
     } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[18/24] qpid-proton git commit: PROTON-885: update the top-level license file

Posted by ac...@apache.org.
PROTON-885: update the top-level license file


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/59afc558
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/59afc558
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/59afc558

Branch: refs/heads/go1
Commit: 59afc5588f0203b427f22b4f9486d27af5cdaa9e
Parents: 2e2ba9c
Author: Ken Giusti <kg...@apache.org>
Authored: Fri May 15 17:17:09 2015 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Fri May 15 17:17:09 2015 -0400

----------------------------------------------------------------------
 LICENSE | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/59afc558/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 4956407..6d1be4d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -207,3 +207,8 @@ PROTON SUBCOMPONENTS:
 Proton includes freegetopt with a separate BSD license.  Your use
 of the source code for freegetopt is subject to the terms and
 conditions of its license in examples/include/pncompat/internal/LICENSE.
+
+The python bindings includes files derived by PyZMQ an are licensed
+with a separate Modified BSD license.  Use of the source code in these
+files are subject to the terms and conditions in the license:
+proton-c/bindings/python/PYZMQ_LICENSE.BSD.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[10/24] qpid-proton git commit: Allow setup.py for bundling proton

Posted by ac...@apache.org.
Allow setup.py for bundling proton

As of now, it's not possible to install python-qpid-proton if
libqpid-proton is not present in the system. To be more precises, it's
possible to build python-qpid-proton using cmake, upload it and beg to
the gods of OPs that the required (and correct) shared library will be
present in the system.

This patch adds to python-qpid-proton the ability to download, build and
install qpid-proton if the required version is not present in the
system. It does this by checking - using pkg-config - whether the
required version is installed and if not, it goes to downloading the
package from the official apache source and builds it using cmake.

As nasty as it sounds, this process is not strange in the Python
community. Very famous - and way more used - libraries like PyZMQ (from
which this work took lots of inspiration) do this already in a fairly
more complex way.

This first step is quite simple, it checks, downloads and builds using
the standard tools. It's enabled just for linux and it does not use
fancy flags. Future enhancements could take care of improving the
implementation and extending it to support other systems.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/2e2ba9c7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/2e2ba9c7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/2e2ba9c7

Branch: refs/heads/go1
Commit: 2e2ba9c7597293883fc51b231786f7cd49796e28
Parents: d5bd60d
Author: Flavio Percoco <fl...@gmail.com>
Authored: Wed May 13 18:45:07 2015 +0200
Committer: Flavio Percoco <fl...@gmail.com>
Committed: Thu May 14 16:24:45 2015 +0200

----------------------------------------------------------------------
 proton-c/bindings/python/PYZMQ_LICENSE.BSD      |  32 ++++
 proton-c/bindings/python/setup.py               | 188 ++++++++++++++++++-
 proton-c/bindings/python/setuputils/__init__.py |   0
 proton-c/bindings/python/setuputils/bundle.py   |  84 +++++++++
 proton-c/bindings/python/setuputils/log.py      |  46 +++++
 proton-c/bindings/python/setuputils/misc.py     | 137 ++++++++++++++
 6 files changed, 485 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e2ba9c7/proton-c/bindings/python/PYZMQ_LICENSE.BSD
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/PYZMQ_LICENSE.BSD b/proton-c/bindings/python/PYZMQ_LICENSE.BSD
new file mode 100644
index 0000000..a0a3790
--- /dev/null
+++ b/proton-c/bindings/python/PYZMQ_LICENSE.BSD
@@ -0,0 +1,32 @@
+PyZMQ is licensed under the terms of the Modified BSD License (also known as
+New or Revised BSD), as follows:
+
+Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+Neither the name of PyZMQ nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior
+written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e2ba9c7/proton-c/bindings/python/setup.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setup.py b/proton-c/bindings/python/setup.py
index cdfa104..e61edc7 100755
--- a/proton-c/bindings/python/setup.py
+++ b/proton-c/bindings/python/setup.py
@@ -16,12 +16,195 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
 
+"""
+python-qpid-proton setup script
+
+DISCLAIMER: This script took lots of inspirations from PyZMQ, which is licensed
+under the 'MODIFIED BSD LICENSE'.
+
+Although inspired by the work in PyZMQ, this script and the modules it depends
+on were largely simplified to meet the requirements of the library.
+
+The default behavior of this script is to build the registered `_cproton`
+extension using the system qpid-proton library. However, before doing that, the
+script will try to discover the available qpid-proton's version and whether it's
+suitable for the version of this library. This allows us to have a tight release
+between the versions of the bindings and qpid-proton's version.
+
+The versions used to verify this are in `setuputils.bundle` and they should be
+increased on every release. Note that `bundled_version` matches the current
+released version. The motivation behind this is that we don't know how many
+new releases will be made in the `0.9` series, therefore we need to target the
+latest possible.
+
+If qpid-proton is found in the system and the available versions are match the
+required ones, then the install process will continue normally.
+
+If the available versions are not good for the bindings or the library is
+missing, then the following will happen:
+
+The setup script will attempt to download qpid-proton's tar - see
+`setuputils.bundle.fetch_libqpid_proton` - and it'll build it and then install
+it. Note that if this is being executed outside a virtualenv, it'll install it
+on whatever `distutils.sysconfig.PREFIX` is available. Once qpid-proton has been
+built and installed, the extension build will proceed normally as if the library
+would have been found. The extension will use the recently built library.
+
+While the above removes the need of *always* having qpid-proton installed, it does
+not solve the need of having `cmake` and `swig` installed to make this setup work.
+Eventually, future works should remove the need of `cmake` by collecting sources
+and letting `distutils` do the compilation.
+
+On a final note, it's important to say that in either case, the library paths will
+be added as `rpaths` to the `_cproton` shared library. Mainly because we need to
+make sure `libqpid-proton.so` will be found and loaded when it's not installed in
+the main system.
+
+From the Python side, this scripts overrides 1 command - build_ext - and it adds a
+new one. The later - Configure - is called from the former to setup/discover what's
+in the system. The rest of the comands and steps are done normally without any kind
+of monkey patching.
+"""
+
+import os
+import subprocess
+import sys
+
+import distutils.spawn as ds_spawn
+import distutils.sysconfig as ds_sys
 from distutils.core import setup, Extension
+from distutils.command.build import build
+from distutils.command.build_ext import build_ext
+
+from setuputils import bundle
+from setuputils import log
+from setuputils import misc
+
+
+class CustomBuildOrder(build):
+    # NOTE(flaper87): The sole purpose of this class is to re-order
+    # the commands execution so that `build_ext` is executed *before*
+    # build_py. We need this to make sure `cproton.py` is generated
+    # before the python modules are collected. Otherwise, it won't
+    # be installed.
+    sub_commands = [
+        ('build_ext', build.has_ext_modules),
+        ('build_py', build.has_pure_modules),
+        ('build_clib', build.has_c_libraries),
+        ('build_scripts', build.has_scripts),
+    ]
+
+
+class CheckingBuildExt(build_ext):
+    """Subclass build_ext to build qpid-proton using `cmake`"""
+
+    def build_extensions(self):
+        self.check_extensions_list(self.extensions)
+
+        for ext in self.extensions:
+            self.build_extension(ext)
+
+    def build_cmake_proton(self, ext):
+        if not ds_spawn.find_executable('cmake'):
+            log.fatal("cmake needed for this script it work")
+
+        try:
+            ds_spawn.spawn(['cmake'] + ext.extra_compile_args + ext.sources)
+            ds_spawn.spawn(['make', 'install'])
+        except ds_spawn.DistutilsExecError:
+            msg = "Error while running cmake"
+            msg += "\nrun 'setup.py build --help' for build options"
+            log.fatal(msg)
+
+    def build_extension(self, ext):
+        if ext.name == 'cmake_cproton':
+            return self.build_cmake_proton(ext)
+
+        return build_ext.build_extension(self, ext)
+
+    def run(self):
+        # Discover qpid-proton in the system
+        self.distribution.run_command('configure')
+        build_ext.run(self)
+
+
+class Configure(build_ext):
+    description = "Discover Qpid Proton version"
+
+    def bundle_libqpid_proton_extension(self):
+        bundledir = "bundled"
+        ext_modules = self.distribution.ext_modules
+
+        log.info("Using bundled libqpid-proton")
+
+        if not os.path.exists(bundledir):
+            os.makedirs(bundledir)
+
+        bundle.fetch_libqpid_proton(bundledir)
+
+        libqpid_proton_dir = os.path.join(bundledir, 'qpid-proton')
+
+        # NOTE(flaper87): Find prefix. We need to run make ourselves
+        libqpid_proton = Extension(
+            'cmake_cproton',
+            sources = [libqpid_proton_dir],
+
+            # NOTE(flaper87): Disable all bindings, set the prefix to whatever
+            # is in `distutils.sysconfig.PREFIX` and finally, disable testing
+            # as well. The python binding will be built by this script later
+            # on. Don't let cmake do it.
+            extra_compile_args = ['-DCMAKE_INSTALL_PREFIX:PATH=%s' % ds_sys.PREFIX,
+                                  '-DBUILD_PYTHON=False',
+                                  '-DBUILD_JAVA=False',
+                                  '-DBUILD_PERL=False',
+                                  '-DBUILD_RUBY=False',
+                                  '-DBUILD_PHP=False',
+                                  '-DBUILD_JAVASCRIPT=False',
+                                  '-DBUILD_TESTING=False',
+            ]
+        )
+
+        # NOTE(flaper87): Register this new extension and make
+        # sure it's built and installed *before* `_cproton`.
+        self.distribution.ext_modules.insert(0, libqpid_proton)
+
+    def set_cproton_settings(self, prefix=None):
+        settings = misc.settings_from_prefix(prefix)
+        ext = self.distribution.ext_modules[-1]
+
+        for k, v in settings.items():
+            setattr(ext, k, v)
+
+    def check_qpid_proton_version(self):
+        """check the qpid_proton version"""
+
+        target_version = bundle.bundled_version_str
+        return (misc.pkg_config_version(max_version=target_version) and
+                misc.pkg_config_version(atleast=bundle.min_qpid_proton_str))
+
+
+    @property
+    def bundle_proton(self):
+        return sys.platform == 'linux2' and not self.check_qpid_proton_version()
+
+    def run(self):
+        prefix = None
+        if self.bundle_proton:
+            self.bundle_libqpid_proton_extension()
+            prefix = ds_sys.PREFIX
+
+        self.set_cproton_settings(prefix)
+
+
+# NOTE(flaper87): Override `build_ext` and add `configure`
+cmdclass = {'configure': Configure,
+            'build': CustomBuildOrder,
+            'build_ext': CheckingBuildExt}
+
 
 setup(name='python-qpid-proton',
-      version='0.9',
+      version=bundle.min_qpid_proton_str,
       description='An AMQP based messaging library.',
       author='Apache Qpid',
       author_email='proton@qpid.apache.org',
@@ -32,5 +215,6 @@ setup(name='python-qpid-proton',
       classifiers=["License :: OSI Approved :: Apache Software License",
                    "Intended Audience :: Developers",
                    "Programming Language :: Python"],
+      cmdclass = cmdclass,
       ext_modules=[Extension('_cproton', ['cproton.i'],
                              libraries=['qpid-proton'])])

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e2ba9c7/proton-c/bindings/python/setuputils/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setuputils/__init__.py b/proton-c/bindings/python/setuputils/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e2ba9c7/proton-c/bindings/python/setuputils/bundle.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setuputils/bundle.py b/proton-c/bindings/python/setuputils/bundle.py
new file mode 100644
index 0000000..498e163
--- /dev/null
+++ b/proton-c/bindings/python/setuputils/bundle.py
@@ -0,0 +1,84 @@
+#-----------------------------------------------------------------------------
+#  Copyright (C) PyZMQ Developers
+#  Distributed under the terms of the Modified BSD License.
+#
+#  This bundling code is largely adapted from pyzmq-static's get.sh by
+#  Brandon Craig-Rhodes, which is itself BSD licensed.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+#  This bundling code is largely adapted from pyzmq's code
+#  PyZMQ Developers, which is itself Modified BSD licensed.
+#-----------------------------------------------------------------------------
+
+import os
+import shutil
+import stat
+import sys
+import tarfile
+from glob import glob
+from subprocess import Popen, PIPE
+
+try:
+    # py2
+    from urllib2 import urlopen
+except ImportError:
+    # py3
+    from urllib.request import urlopen
+
+from . import log
+
+
+#-----------------------------------------------------------------------------
+# Constants
+#-----------------------------------------------------------------------------
+min_qpid_proton = (0, 9)
+min_qpid_proton_str = "%i.%i" % min_qpid_proton
+
+bundled_version = (0,9,1)
+bundled_version_str = "%i.%i.%i" % (0,9,1)
+libqpid_proton = "qpid-proton-%s.tar.gz" % bundled_version_str
+libqpid_proton_url = ("http://www.apache.org/dist/qpid/proton/%s/%s" %
+                      (bundled_version_str, libqpid_proton))
+
+HERE = os.path.dirname(__file__)
+ROOT = os.path.dirname(HERE)
+
+
+def fetch_archive(savedir, url, fname):
+    """Download an archive to a specific location
+
+    :param savedir: Destination dir
+    :param url: URL where the archive should be downloaded from
+    :param fname: Archive's filename
+    """
+    dest = os.path.join(savedir, fname)
+
+    if os.path.exists(dest):
+        log.info("already have %s" % fname)
+        return dest
+
+    log.info("fetching %s into %s" % (url, savedir))
+    if not os.path.exists(savedir):
+        os.makedirs(savedir)
+    req = urlopen(url)
+    with open(dest, 'wb') as f:
+        f.write(req.read())
+    return dest
+
+
+def fetch_libqpid_proton(savedir):
+    """Download qpid-proton to `savedir`."""
+    dest = os.path.join(savedir, 'qpid-proton')
+    if os.path.exists(dest):
+        log.info("already have %s" % dest)
+        return
+    fname = fetch_archive(savedir, libqpid_proton_url, libqpid_proton)
+    tf = tarfile.open(fname)
+    member = tf.firstmember.path
+    if member == '.':
+        member = tf.getmembers()[1].path
+    with_version = os.path.join(savedir, member)
+    tf.extractall(savedir)
+    tf.close()
+    shutil.move(with_version, dest)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e2ba9c7/proton-c/bindings/python/setuputils/log.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setuputils/log.py b/proton-c/bindings/python/setuputils/log.py
new file mode 100644
index 0000000..1e051d4
--- /dev/null
+++ b/proton-c/bindings/python/setuputils/log.py
@@ -0,0 +1,46 @@
+#-----------------------------------------------------------------------------
+#  Copyright (C) PyZMQ Developers
+#  Distributed under the terms of the Modified BSD License.
+#
+#  This bundling code is largely adapted from pyzmq-static's get.sh by
+#  Brandon Craig-Rhodes, which is itself BSD licensed.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Logging (adapted from h5py: http://h5py.googlecode.com)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+#  This log code is largely adapted from pyzmq's code
+#  PyZMQ Developers, which is itself Modified BSD licensed.
+#-----------------------------------------------------------------------------
+
+
+import os
+import sys
+import logging
+
+
+logger = logging.getLogger()
+if os.environ.get('DEBUG'):
+    logger.setLevel(logging.DEBUG)
+else:
+    logger.setLevel(logging.INFO)
+    logger.addHandler(logging.StreamHandler(sys.stderr))
+
+
+def debug(msg):
+    logger.debug(msg)
+
+
+def info(msg):
+    logger.info(msg)
+
+
+def fatal(msg, code=1):
+    logger.error("Fatal: " + msg)
+    exit(code)
+
+
+def warn(msg):
+    logger.error("Warning: " + msg)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e2ba9c7/proton-c/bindings/python/setuputils/misc.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setuputils/misc.py b/proton-c/bindings/python/setuputils/misc.py
new file mode 100644
index 0000000..3ebb160
--- /dev/null
+++ b/proton-c/bindings/python/setuputils/misc.py
@@ -0,0 +1,137 @@
+#-----------------------------------------------------------------------------
+#  Copyright (C) PyZMQ Developers
+#  Distributed under the terms of the Modified BSD License.
+#
+#  This bundling code is largely adapted from pyzmq-static's get.sh by
+#  Brandon Craig-Rhodes, which is itself BSD licensed.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+#  These functions were largely adapted from pyzmq's code
+#  PyZMQ Developers, which is itself Modified BSD licensed.
+#-----------------------------------------------------------------------------
+
+
+import os
+import subprocess
+import sys
+
+from . import log
+
+
+def settings_from_prefix(prefix=None):
+    """Load appropriate library/include settings from qpid-proton prefix
+
+    NOTE: Funcion adapted from PyZMQ, which is itself Modified BSD licensed.
+
+    :param prefix: The install prefix where the dependencies are expected to be
+    """
+    settings = {}
+    settings['libraries'] = []
+    settings['include_dirs'] = []
+    settings['library_dirs'] = []
+    settings['swig_opts'] = []
+    settings['runtime_library_dirs'] = []
+    settings['extra_link_args'] = []
+
+    if sys.platform.startswith('win'):
+        settings['libraries'].append('libqpid-proton')
+
+        if prefix:
+            settings['include_dirs'] += [os.path.join(prefix, 'include')]
+            settings['library_dirs'] += [os.path.join(prefix, 'lib')]
+    else:
+
+        # If prefix is not explicitly set, pull it from pkg-config by default.
+
+        if not prefix:
+            try:
+                cmd = 'pkg-config --variable=prefix --print-errors libqpid-proton'.split()
+                p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+            except OSError as e:
+                if e.errno == errno.ENOENT:
+                    log.info("pkg-config not found")
+                else:
+                    log.warn("Running pkg-config failed - %s." % e)
+                p = None
+            if p is not None:
+                if p.wait():
+                    log.info("Did not find libqpid-proton via pkg-config:")
+                    log.info(p.stderr.read().decode())
+                else:
+                    prefix = p.stdout.readline().strip().decode()
+                    log.info("Using qpid-proton-prefix %s (found via pkg-config)." % prefix)
+
+        settings['libraries'].append('qpid-proton')
+        # add pthread on freebsd
+        if sys.platform.startswith('freebsd'):
+            settings['libraries'].append('pthread')
+
+        if sys.platform == 'sunos5':
+          if platform.architecture()[0] == '32bit':
+            settings['extra_link_args'] += ['-m32']
+          else:
+            settings['extra_link_args'] += ['-m64']
+        if prefix:
+            settings['include_dirs'] += [os.path.join(prefix, 'include')]
+            settings['library_dirs'] += [os.path.join(prefix, 'lib')]
+            settings['library_dirs'] += [os.path.join(prefix, 'lib64')]
+
+        else:
+            if sys.platform == 'darwin' and os.path.isdir('/opt/local/lib'):
+                # allow macports default
+                settings['include_dirs'] += ['/opt/local/include']
+                settings['library_dirs'] += ['/opt/local/lib']
+                settings['library_dirs'] += ['/opt/local/lib64']
+            if os.environ.get('VIRTUAL_ENV', None):
+                # find libqpid_proton installed in virtualenv
+                env = os.environ['VIRTUAL_ENV']
+                settings['include_dirs'] += [os.path.join(env, 'include')]
+                settings['library_dirs'] += [os.path.join(env, 'lib')]
+                settings['library_dirs'] += [os.path.join(env, 'lib64')]
+
+        if sys.platform != 'darwin':
+            settings['runtime_library_dirs'] += [
+                os.path.abspath(x) for x in settings['library_dirs']
+            ]
+
+    for d in settings['include_dirs']:
+        settings['swig_opts'] += ['-I' + d]
+
+    return settings
+
+
+def pkg_config_version(atleast=None, max_version=None):
+    """Check the qpid_proton version using pkg-config
+
+    This function returns True/False depending on whether
+    the library is found and atleast/max_version are met.
+
+    :param atleast: The minimum required version
+    :param max_version: The maximum supported version. This
+        basically represents the target version.
+    """
+
+    if atleast and max_version:
+        log.error('Specify either atleast or max_version')
+
+    try:
+        cmd = ['pkg-config',
+               '--%s-version=%s' % (atleast and 'atleast' or 'max',
+                                    atleast or max_version),
+               'libqpid-proton']
+        p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    except OSError as e:
+        if e.errno == errno.ENOENT:
+            log.info("pkg-config not found")
+        else:
+            log.warn("Running pkg-config failed - %s." % e)
+        return False
+
+    if p.wait():
+        log.info("Did not find libqpid-proton via pkg-config:")
+        log.info(p.stderr.read().decode())
+        return False
+
+    log.info("Using libqpid-proton (found via pkg-config).")
+    return True


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[08/24] qpid-proton git commit: PROTON-860: allow acceptor to be configured for ssl

Posted by ac...@apache.org.
PROTON-860: allow acceptor to be configured for ssl


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/995e00d7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/995e00d7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/995e00d7

Branch: refs/heads/go1
Commit: 995e00d70b6f9005e116e352507127d9c930a4db
Parents: d5bd60d
Author: Gordon Sim <gs...@redhat.com>
Authored: Wed May 6 12:50:11 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Thu May 14 13:24:55 2015 +0100

----------------------------------------------------------------------
 proton-c/bindings/python/proton/reactor.py | 12 +++++++++---
 proton-c/include/proton/reactor.h          |  2 ++
 proton-c/src/reactor/acceptor.c            | 15 +++++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/995e00d7/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py
index 09cbc23..0145a25 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -51,6 +51,9 @@ class Acceptor(Wrapper):
     def __init__(self, impl):
         Wrapper.__init__(self, impl)
 
+    def set_ssl_domain(self, ssl_domain):
+        pn_acceptor_set_ssl_domain(self._impl, ssl_domain._domain)
+
     def close(self):
         pn_acceptor_close(self._impl)
 
@@ -742,10 +745,13 @@ class Container(Reactor):
         on the interface and port specified.
         """
         url = Url(url)
+        acceptor = self.acceptor(url.host, url.port)
         ssl_config = ssl_domain
-        if not ssl_config and url.scheme == 'amqps':
-            ssl_config = self.ssl_domain
-        return self.acceptor(url.host, url.port)
+        if not ssl_config and url.scheme == 'amqps' and self.ssl:
+            ssl_config = self.ssl.server
+        if ssl_config:
+            acceptor.set_ssl_domain(ssl_config)
+        return acceptor
 
     def do_work(self, timeout=None):
         if timeout:

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/995e00d7/proton-c/include/proton/reactor.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/reactor.h b/proton-c/include/proton/reactor.h
index 36ee336..59b2282 100644
--- a/proton-c/include/proton/reactor.h
+++ b/proton-c/include/proton/reactor.h
@@ -26,6 +26,7 @@
 #include <proton/type_compat.h>
 #include <proton/event.h>
 #include <proton/selectable.h>
+#include <proton/ssl.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -85,6 +86,7 @@ PN_EXTERN void pn_reactor_run(pn_reactor_t *reactor);
 PN_EXTERN pn_task_t *pn_reactor_schedule(pn_reactor_t *reactor, int delay, pn_handler_t *handler);
 
 
+PN_EXTERN void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain);
 PN_EXTERN void pn_acceptor_close(pn_acceptor_t *acceptor);
 
 PN_EXTERN pn_timer_t *pn_timer(pn_collector_t *collector);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/995e00d7/proton-c/src/reactor/acceptor.c
----------------------------------------------------------------------
diff --git a/proton-c/src/reactor/acceptor.c b/proton-c/src/reactor/acceptor.c
index f7202d4..31fa0cc 100644
--- a/proton-c/src/reactor/acceptor.c
+++ b/proton-c/src/reactor/acceptor.c
@@ -29,6 +29,7 @@
 pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport);
 
 PN_HANDLE(PNI_ACCEPTOR_HANDLER)
+PN_HANDLE(PNI_ACCEPTOR_SSL_DOMAIN)
 
 void pni_acceptor_readable(pn_selectable_t *sel) {
   pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
@@ -36,9 +37,15 @@ void pni_acceptor_readable(pn_selectable_t *sel) {
   pn_socket_t sock = pn_accept(pn_reactor_io(reactor), pn_selectable_get_fd(sel), name, 1024);
   pn_handler_t *handler = (pn_handler_t *) pn_record_get(pn_selectable_attachments(sel), PNI_ACCEPTOR_HANDLER);
   if (!handler) { handler = pn_reactor_get_handler(reactor); }
+  pn_record_t *record = pn_selectable_attachments(sel);
+  pn_ssl_domain_t *ssl_domain = (pn_ssl_domain_t *) pn_record_get(record, PNI_ACCEPTOR_SSL_DOMAIN);
   pn_connection_t *conn = pn_reactor_connection(reactor, handler);
   pn_transport_t *trans = pn_transport();
   pn_transport_set_server(trans);
+  if (ssl_domain) {
+    pn_ssl_t *ssl = pn_ssl(trans);
+    pn_ssl_init(ssl, ssl_domain, 0);
+  }
   pn_transport_bind(trans, conn);
   pn_decref(trans);
   pn_reactor_selectable_transport(reactor, sock, trans);
@@ -80,3 +87,11 @@ void pn_acceptor_close(pn_acceptor_t *acceptor) {
     pn_reactor_update(reactor, sel);
   }
 }
+
+void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain)
+{
+  pn_selectable_t *sel = (pn_selectable_t *) acceptor;
+  pn_record_t *record = pn_selectable_attachments(sel);
+  pn_record_def(record, PNI_ACCEPTOR_SSL_DOMAIN, PN_WEAKREF);
+  pn_record_set(record, PNI_ACCEPTOR_SSL_DOMAIN, domain);
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[15/24] qpid-proton git commit: NO-JIRA: Make Windows CI link go to master branch too

Posted by ac...@apache.org.
NO-JIRA: Make Windows CI link go to master branch too


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/cb6c172f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/cb6c172f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/cb6c172f

Branch: refs/heads/go1
Commit: cb6c172f97e9ca4896d389f7f7d2cc0453dfec7d
Parents: 894a463
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri May 15 13:36:57 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri May 15 13:36:57 2015 -0400

----------------------------------------------------------------------
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/cb6c172f/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 53bceac..9f95939 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Qpid Proton - AMQP messaging toolkit
 
 Linux Build | Windows Build
 ------------|--------------
-[![Linux Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/owb4mohqyxrnql98/branch/master?svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton)
+[![Linux Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/apache/qpid-proton?branch=master&svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton/branch/master)
 
 Qpid Proton is a high-performance, lightweight messaging library. It can be
 used in the widest range of messaging applications, including brokers, client


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[14/24] qpid-proton git commit: PROTON-861: expose the subject from peer certificate

Posted by ac...@apache.org.
PROTON-861: expose the subject from peer certificate


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/894a463b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/894a463b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/894a463b

Branch: refs/heads/go1
Commit: 894a463bf720ce15148059b6bb79f040f8ce8af2
Parents: 1e4042a
Author: Gordon Sim <gs...@redhat.com>
Authored: Thu May 14 14:54:23 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Fri May 15 17:28:44 2015 +0100

----------------------------------------------------------------------
 proton-c/bindings/python/proton/__init__.py |  7 ++++++-
 proton-c/include/proton/ssl.h               |  8 ++++++++
 proton-c/src/ssl/openssl.c                  | 25 ++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/894a463b/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index bc639e3..a4e01f8 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -3459,7 +3459,8 @@ class SSL(object):
       obj._ssl = pn_ssl( transport._impl )
       if obj._ssl is None:
         raise SSLUnavailable()
-      pn_ssl_init( obj._ssl, domain._domain, session_id )
+      if domain:
+        pn_ssl_init( obj._ssl, domain._domain, session_id )
       transport._ssl = obj
     return transport._ssl
 
@@ -3475,6 +3476,10 @@ class SSL(object):
       return name
     return None
 
+  @property
+  def remote_subject(self):
+    return pn_ssl_get_remote_subject( self._ssl )
+
   RESUME_UNKNOWN = PN_SSL_RESUME_UNKNOWN
   RESUME_NEW = PN_SSL_RESUME_NEW
   RESUME_REUSED = PN_SSL_RESUME_REUSED

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/894a463b/proton-c/include/proton/ssl.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/ssl.h b/proton-c/include/proton/ssl.h
index 0ac4aef..87e7025 100644
--- a/proton-c/include/proton/ssl.h
+++ b/proton-c/include/proton/ssl.h
@@ -318,6 +318,14 @@ PN_EXTERN int pn_ssl_set_peer_hostname( pn_ssl_t *ssl, const char *hostname);
  */
 PN_EXTERN int pn_ssl_get_peer_hostname( pn_ssl_t *ssl, char *hostname, size_t *bufsize );
 
+/** Get the subject from the peers certificate.
+ *
+ * @param[in] ssl the ssl client/server to query.
+ * @return A null terminated string representing the full subject,
+ * which is valid until the ssl object is destroyed.
+ */
+PN_EXTERN const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl);
+
 /** @} */
 
 #ifdef __cplusplus

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/894a463b/proton-c/src/ssl/openssl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/ssl/openssl.c b/proton-c/src/ssl/openssl.c
index 2bbdda0..02a16fc 100644
--- a/proton-c/src/ssl/openssl.c
+++ b/proton-c/src/ssl/openssl.c
@@ -111,6 +111,8 @@ struct pni_ssl_t {
   bool ssl_closed;      // shutdown complete, or SSL error
   bool read_blocked;    // SSL blocked until more network data is read
   bool write_blocked;   // SSL blocked until data is written to network
+
+  char *subject;
 };
 
 static inline pn_transport_t *get_transport_internal(pn_ssl_t *ssl)
@@ -780,6 +782,7 @@ void pn_ssl_free(pn_transport_t *transport)
   if (ssl->peer_hostname) free((void *)ssl->peer_hostname);
   if (ssl->inbuf) free((void *)ssl->inbuf);
   if (ssl->outbuf) free((void *)ssl->outbuf);
+  if (ssl->subject) free(ssl->subject);
   free(ssl);
 }
 
@@ -1179,6 +1182,7 @@ static int init_ssl_socket(pn_transport_t* transport, pni_ssl_t *ssl)
     BIO_set_ssl_mode(ssl->bio_ssl, 1);  // client mode
     ssl_log( transport, "Client SSL socket created." );
   }
+  ssl->subject = NULL;
   return 0;
 }
 
@@ -1249,6 +1253,27 @@ int pn_ssl_get_peer_hostname(pn_ssl_t *ssl0, char *hostname, size_t *bufsize)
   return 0;
 }
 
+const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl0)
+{
+  pni_ssl_t *ssl = get_ssl_internal(ssl0);
+  if (!ssl || !ssl->ssl) return NULL;
+  if (!ssl->subject) {
+    X509 *cert = SSL_get_peer_certificate(ssl->ssl);
+    if (!cert) return NULL;
+    X509_NAME *subject = X509_get_subject_name(cert);
+    if (!subject) return NULL;
+
+    BIO *out = BIO_new(BIO_s_mem());
+    X509_NAME_print_ex(out, subject, 0, XN_FLAG_RFC2253);
+    int len = BIO_number_written(out);
+    ssl->subject = (char*) malloc(len+1);
+    ssl->subject[len] = 0;
+    BIO_read(out, ssl->subject, len);
+    BIO_free(out);
+  }
+  return ssl->subject;
+}
+
 static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len)
 {
   return PN_EOS;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[12/24] qpid-proton git commit: NO-JIRA: Add Windows CI build badge to README.md

Posted by ac...@apache.org.
NO-JIRA: Add Windows CI build badge to README.md


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/0aa85920
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/0aa85920
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/0aa85920

Branch: refs/heads/go1
Commit: 0aa859208d729d04eebe7d9ee16d208b827f8b64
Parents: 145c017
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu May 14 13:28:24 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu May 14 13:28:24 2015 -0400

----------------------------------------------------------------------
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0aa85920/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index fe422dc..4f020f7 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
 Qpid Proton - AMQP messaging toolkit
 ====================================
 
-[![Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton)
+Linux Build | Windows Build
+------------|--------------
+[![Linux Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/owb4mohqyxrnql98?svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton)
 
 Qpid Proton is a high-performance, lightweight messaging library. It can be
 used in the widest range of messaging applications, including brokers, client


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[11/24] qpid-proton git commit: PROTON-827: Fix link in bindings/go/README.md for changed branch go -> go1

Posted by ac...@apache.org.
PROTON-827: Fix link in bindings/go/README.md for changed branch go -> go1

'go get' tool will pull go1 instead of master if it exists, so this works better.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/145c017d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/145c017d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/145c017d

Branch: refs/heads/go1
Commit: 145c017d2e92479c54701639a2af37081691d872
Parents: d443772
Author: Alan Conway <ac...@redhat.com>
Authored: Thu May 14 11:02:16 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu May 14 11:02:24 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/go/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/145c017d/proton-c/bindings/go/README.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/README.md b/proton-c/bindings/go/README.md
index 4ac15a1..a5580e9 100644
--- a/proton-c/bindings/go/README.md
+++ b/proton-c/bindings/go/README.md
@@ -2,4 +2,4 @@
 
 Experimental work on the Go language binding has been moved to the `go1` branch
 until it is ready for use. You can `git checkout go1` on your git clone, or
-browse at https://github.com/apache/qpid-proton/blob/go/proton-c/bindings/go1/README.md
+browse at https://github.com/apache/qpid-proton/blob/go1/go/README.md


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[03/24] qpid-proton git commit: Add testresults to .gitignore

Posted by ac...@apache.org.
Add testresults to .gitignore


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/96fdc65c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/96fdc65c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/96fdc65c

Branch: refs/heads/go1
Commit: 96fdc65cb67997e42e95940095880731cae71d4b
Parents: 132820c
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Wed May 13 13:57:37 2015 +0100
Committer: Dominic Evans <do...@uk.ibm.com>
Committed: Wed May 13 13:57:37 2015 +0100

----------------------------------------------------------------------
 .gitignore | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/96fdc65c/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 2b509c6..45dd364 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,6 @@ proton-c/build
 
 # Executables built by go binding tests
 proton-c/bindings/go/bin
+
+# Testresults from the jenkins build script
+testresults


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[21/24] qpid-proton git commit: Merge branch 'PROTON-885-flaper87' into PROTON-885

Posted by ac...@apache.org.
Merge branch 'PROTON-885-flaper87' into PROTON-885


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d98fa576
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d98fa576
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d98fa576

Branch: refs/heads/go1
Commit: d98fa576aa288b9e05976c17273e8be0d78cb50e
Parents: 585b306 786ba2a
Author: Ken Giusti <kg...@apache.org>
Authored: Wed May 20 19:01:27 2015 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Wed May 20 19:01:27 2015 -0400

----------------------------------------------------------------------
 LICENSE                                         |   5 +
 proton-c/bindings/python/PYZMQ_LICENSE.BSD      |  32 ++++
 proton-c/bindings/python/setup.py               | 188 ++++++++++++++++++-
 proton-c/bindings/python/setuputils/__init__.py |   0
 proton-c/bindings/python/setuputils/bundle.py   |  84 +++++++++
 proton-c/bindings/python/setuputils/log.py      |  46 +++++
 proton-c/bindings/python/setuputils/misc.py     | 137 ++++++++++++++
 7 files changed, 490 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[24/24] qpid-proton git commit: PROTON-827: Merge branch 'master' into go1

Posted by ac...@apache.org.
PROTON-827: Merge branch 'master' into go1


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/4f6389ac
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/4f6389ac
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/4f6389ac

Branch: refs/heads/go1
Commit: 4f6389aca34101e3f2cc24dbbf48e8aec293c379
Parents: ac6f824 e349a02
Author: Alan Conway <ac...@redhat.com>
Authored: Fri May 22 15:38:18 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Fri May 22 15:38:18 2015 -0400

----------------------------------------------------------------------
 .gitignore                                      |   3 +
 .travis.yml                                     |   2 +-
 LICENSE                                         |   6 +
 README.md                                       |   4 +
 appveyor.yml                                    |  16 ++
 go/README.md                                    |   7 +-
 proton-c/bindings/python/MANIFEST.in            |   2 +
 proton-c/bindings/python/proton/__init__.py     |   7 +-
 proton-c/bindings/python/proton/reactor.py      |  12 +-
 proton-c/bindings/python/setup.py               | 188 ++++++++++++++++++-
 .../python/setuputils/PYZMQ_LICENSE.BSD         |  32 ++++
 proton-c/bindings/python/setuputils/__init__.py |   0
 proton-c/bindings/python/setuputils/bundle.py   |  84 +++++++++
 proton-c/bindings/python/setuputils/log.py      |  46 +++++
 proton-c/bindings/python/setuputils/misc.py     | 137 ++++++++++++++
 proton-c/bindings/ruby/ruby.i                   |  14 ++
 proton-c/include/proton/reactor.h               |   2 +
 proton-c/include/proton/ssl.h                   |   8 +
 proton-c/src/reactor/acceptor.c                 |  15 ++
 proton-c/src/ssl/openssl.c                      |  25 +++
 proton-c/src/ssl/ssl_stub.c                     |   5 +
 proton-c/src/windows/schannel.c                 |   6 +
 22 files changed, 608 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4f6389ac/go/README.md
----------------------------------------------------------------------
diff --cc go/README.md
index 59ac624,0000000..4e72504
mode 100644,000000..100644
--- a/go/README.md
+++ b/go/README.md
@@@ -1,143 -1,0 +1,138 @@@
 +# *EXPERIMENTAL* Go binding for proton
 +
-     NOTE: The go directory is in the proton repository root with a symlink at
-     proton-c/bindings/go to facilitate use of go tools: go get, godep and godoc.
-     There may be a cleaner solution to this in future.
- 
 +This is the beginning of a [Go](http://golang.org) binding for proton.
 +
 +This work is in early *experimental* stages, *everything* may change in future.
 +Comments and contributions are strongly encouraged, this experiment is public so
 +early feedback can guide development.
 +
 +- Email <pr...@qpid.apache.org>
 +- Create issues <https://issues.apache.org/jira/browse/PROTON>, attach patches to an issue.
 +
- There are working [examples](../examples/go/README.md) and the examples README file
- explains how to install the packages in your go workspace and read the documentation.
++There are working [examples](../examples/go/README.md)
 +
 +## Goals
 +
 +The API should
 +
 +- be idiomatic, unsurprising, and easy to use for Go developers.
 +- support client and server development.
 +- make simple tasks simple.
 +- provide deep access to AMQP protocol when that is required.
 +
 +There are two types of developer we want to support
 +
 +1. Go developers using AMQP as a message transport:
 +   - Straightforward conversions between Go built-in types and AMQP types.
 +   - Easy message exchange via Go channels to support use in goroutines.
 +
 +2. AMQP-aware developers using Go as an implementation language:
 +   - Go types to exactly represent all AMQP types and encoding details.
 +   - Full access to detailed AMQP concepts: sessions, links, deliveries etc.
 +
 +## Status
 +
 +There are 3 go packages for proton:
 +
 +- qpid.apache.org/proton/go/amqp: converts AMQP messages and data types to and from Go data types.
 +- qpid.apache.org/proton/go/messaging: easy-to-use, concurrent API for messaging clients and servers.
 +- qpid.apache.org/proton/go/event: full low-level access to the proton engine.
 +
 +Most applications should use the `messaging` package. The `event` package is for
 +applications that need low-level access to the proton engine.
 +
 +The `event` package is fairly complete, with the exception of the proton
 +reactor. It's unclear if the reactor is important for go.
 +
 +The `messaging` package can run the examples but probably not much else. There
 +is work to do on error handling and the API may change.
 +
 +There are working [examples](../../../examples/go/README.md) of a broker using `event` and
 +a sender and receiver using `messaging`.
 +
 +## The event driven API
 +
 +See the package documentation for details.
 +
 +## The Go API
 +
 +The goal: A procedural API that allows any user goroutine to send and receive
 +AMQP messages and other information (acknowledgments, flow control instructions
 +etc.) using channels. There will be no user-visible locks and no need to run
 +user code in special goroutines, e.g. as handlers in a proton event loop.
 +
 +See the package documentation for emerging details.
 +
 +Currently using a channel to receive messages, a function to send them (channels
 +internally) and a channel as a "future" for acknowledgements to senders. This
 +may change.
 +
 +## Why a separate API for Go?
 +
 +Go is a concurrent language and encourages applications to be divided into
 +concurrent *goroutines*. It provides traditional locking but it encourages the
 +use *channels* to communicate between goroutines without explicit locks:
 +
 +  "Share memory by communicating, don't communicate by sharing memory"
 +
 +The idea is that a given value is only operated on by one goroutine at a time,
 +but values can easily be passed from one goroutine to another. This removes much
 +of the need for locking.
 +
 +Go literature distinguishes between:
 +
 +- *concurrency*: "keeping track of things that could be done in parallel"
 +- *parallelism*: "actually doing things in parallel"
 +
 +The application expresses concurrency by starting goroutines for potentially
 +concurrent tasks. The Go run-times schedule the activity of goroutines onto a
 +small number (possibly one) of actual parallel executions.
 +
 +Even with *no* parallelism, concurrency lets the Go run-times *order* work with
 +respect to events like file descriptors being readable/writable, channels having
 +data, timers firing etc. Go automatically takes care of switching out goroutines
 +that block or sleep so it is normal to write code in terms of blocking calls.
 +
 +Event-driven API (like poll, epoll, select or the proton event API) also
 +channel unpredictably ordered events to actions in one or a small pool of
 +execution threads. However this requires a different style of programming:
 +"event-driven" or "reactive" programming. Go developers call it "inside-out"
 +programming. In an event-driven architecture blocking is a big problem as it
 +consumes a scarce thread of execution, so actions that take time to complete
 +have to be re-structured in terms of future event delivery.
 +
 +The promise of Go is that you can express your application in concurrent,
 +procedural terms with simple blocking calls and the Go run-times will turn it
 +inside-out for you. Write as many goroutines as you want, and let Go interleave
 +and schedule them efficiently.
 +
 +For example: the Go equivalent of listening for connections is a goroutine with
 +a simple endless loop that calls a blocking Listen() function and starts a
 +goroutine for each new connection. Each connection has its own goroutine that
 +deals with just that connection till it closes.
 +
 +The benefit is that the variables and logic live closer together. Once you're in
 +a goroutine, you have everything you need in local variables, and they are
 +preserved across blocking calls. There's no need to store details in context
 +objects that you have to look up when handling a later event to figure out how
 +to continue where you left off.
 +
 +So a Go-like proton API does not force the users code to run in an event-loop
 +goroutine. Instead user goroutines communicate with the event loop(s) via
 +channels.  There's no need to funnel connections into one event loop, in fact it
 +makes no sense.  Connections can be processed concurrently so they should be
 +processed in separate goroutines and left to Go to schedule. User goroutines can
 +have simple loops that block channels till messages are available, the user can
 +start as many or as few such goroutines as they wish to implement concurrency as
 +simple or as complex as they wish. For example blocking request-response
 +vs. asynchronous flows of messages and acknowledgments.
 +
 +## New to Go?
 +
 +If you are new to Go then these are a good place to start:
 +
 +- [A Tour of Go](http://tour.golang.org)
 +- [Effective Go](http://golang.org/doc/effective_go.html)
 +
 +Then look at the tools and library docs at <http://golang.org> as you need them.
 +


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[05/24] qpid-proton git commit: Add travis-ci build status badge to README

Posted by ac...@apache.org.
Add travis-ci build status badge to README


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/3a340664
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/3a340664
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/3a340664

Branch: refs/heads/go1
Commit: 3a3406644ccebb31aa8cc739530a91950b7d3049
Parents: c476cdb
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Wed May 13 17:05:36 2015 +0100
Committer: Dominic Evans <do...@uk.ibm.com>
Committed: Wed May 13 17:05:36 2015 +0100

----------------------------------------------------------------------
 README.md | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/3a340664/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index c1d2bbf..fe422dc 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 Qpid Proton - AMQP messaging toolkit
 ====================================
 
+[![Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton)
+
 Qpid Proton is a high-performance, lightweight messaging library. It can be
 used in the widest range of messaging applications, including brokers, client
 libraries, routers, bridges, proxies, and more. Proton makes it trivial to


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[04/24] qpid-proton git commit: Add valgrind to travis yml

Posted by ac...@apache.org.
Add valgrind to travis yml


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c476cdb9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c476cdb9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c476cdb9

Branch: refs/heads/go1
Commit: c476cdb98a27b8332dfe45d10352dfd6c34f3343
Parents: 96fdc65
Author: Dominic Evans <do...@uk.ibm.com>
Authored: Wed May 13 13:58:14 2015 +0100
Committer: Dominic Evans <do...@uk.ibm.com>
Committed: Wed May 13 13:58:14 2015 +0100

----------------------------------------------------------------------
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c476cdb9/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 8104aa9..8d12bc4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 language: c
 install:
   - sudo apt-get update -qq
-  - sudo apt-get install -y -qq bash cmake libssl-dev maven ruby python php5 openjdk-7-jdk swig uuid-dev
+  - sudo apt-get install -y -qq bash cmake libssl-dev maven ruby python php5 openjdk-7-jdk swig uuid-dev valgrind
 script:
   - bin/jenkins-proton-c-build.sh


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[13/24] qpid-proton git commit: NO-JIRA: Update Windows CI badge to only report master branch

Posted by ac...@apache.org.
NO-JIRA: Update Windows CI badge to only report master branch


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1e4042ab
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1e4042ab
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1e4042ab

Branch: refs/heads/go1
Commit: 1e4042ab02e19f1a19a47b5b14fa68e08691b4f3
Parents: 0aa8592
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri May 15 12:03:59 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri May 15 12:03:59 2015 -0400

----------------------------------------------------------------------
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1e4042ab/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 4f020f7..53bceac 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Qpid Proton - AMQP messaging toolkit
 
 Linux Build | Windows Build
 ------------|--------------
-[![Linux Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/owb4mohqyxrnql98?svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton)
+[![Linux Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/owb4mohqyxrnql98/branch/master?svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton)
 
 Qpid Proton is a high-performance, lightweight messaging library. It can be
 used in the widest range of messaging applications, including brokers, client


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[06/24] qpid-proton git commit: NO-JIRA: Added Appveyor CI build instructions (Windows CI)

Posted by ac...@apache.org.
NO-JIRA: Added Appveyor CI build instructions (Windows CI)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/57414346
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/57414346
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/57414346

Branch: refs/heads/go1
Commit: 57414346bf50e662a22f13997797d59247b84b4d
Parents: 3a34066
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed May 13 12:39:05 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Wed May 13 12:39:05 2015 -0400

----------------------------------------------------------------------
 appveyor.yml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/57414346/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..a147e0d
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,16 @@
+version: 0.10-SNAPSHOT-{branch}.{build}
+configuration: RelWithDebInfo
+install:
+- cinst -y swig
+before_build:
+- mkdir BLD
+- cd BLD
+- cmake -G "Visual Studio 12" -DBUILD_PERL=no ..
+- cd ..
+build:
+  parallel: true
+  verbosity: normal
+test_script:
+- cd BLD
+- ctest -V -C RelWithDebInfo
+- cd ..


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[02/24] qpid-proton git commit: PROTON-827: Moved go binding work to branch `go`

Posted by ac...@apache.org.
PROTON-827: Moved go binding work to branch `go`

Go binding removed from master, available on branch `go`.

master still has bindings/go/README.md with a pointer to the branch, so people
following old discussions can find it.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/132820cb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/132820cb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/132820cb

Branch: refs/heads/go1
Commit: 132820cb5910f0bbe3c9ac4f702b04b4eb0051d0
Parents: 460c787
Author: Alan Conway <ac...@redhat.com>
Authored: Tue May 12 19:01:10 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Tue May 12 19:01:10 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/go/README.md                  | 197 +----
 proton-c/bindings/go/WARNING_EXPERIMENTAL       |   1 -
 proton-c/bindings/go/src/Makefile               |  16 -
 proton-c/bindings/go/src/genwrap.go             | 423 -----------
 .../go/src/qpid.apache.org/proton/doc.go        |  40 -
 .../go/src/qpid.apache.org/proton/event/doc.go  |  38 -
 .../qpid.apache.org/proton/event/handlers.go    | 411 -----------
 .../src/qpid.apache.org/proton/event/message.go |  75 --
 .../go/src/qpid.apache.org/proton/event/pump.go | 357 ---------
 .../qpid.apache.org/proton/event/wrappers.go    | 253 -------
 .../proton/event/wrappers_gen.go                | 732 -------------------
 .../qpid.apache.org/proton/internal/error.go    | 125 ----
 .../src/qpid.apache.org/proton/interop_test.go  | 308 --------
 .../go/src/qpid.apache.org/proton/marshal.go    | 238 ------
 .../go/src/qpid.apache.org/proton/message.go    | 342 ---------
 .../src/qpid.apache.org/proton/message_test.go  |  90 ---
 .../src/qpid.apache.org/proton/messaging/doc.go |  28 -
 .../proton/messaging/example_test.go            | 268 -------
 .../qpid.apache.org/proton/messaging/handler.go |  70 --
 .../proton/messaging/messaging.go               | 250 -------
 .../go/src/qpid.apache.org/proton/types.go      | 193 -----
 .../go/src/qpid.apache.org/proton/uid.go        |  40 -
 .../go/src/qpid.apache.org/proton/unmarshal.go  | 552 --------------
 .../go/src/qpid.apache.org/proton/url.go        |  96 ---
 .../go/src/qpid.apache.org/proton/url_test.go   |  51 --
 25 files changed, 3 insertions(+), 5191 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/README.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/README.md b/proton-c/bindings/go/README.md
index a70aa2c..9fd0a0f 100644
--- a/proton-c/bindings/go/README.md
+++ b/proton-c/bindings/go/README.md
@@ -1,196 +1,5 @@
 # *EXPERIMENTAL* Go binding for proton
 
-This is the beginning of a [Go](http://golang.org) binding for proton.
-
-This work is in early *experimental* stages, *everything* may change in future.
-Comments and contributions are strongly encouraged, this experiment is public so
-early feedback can guide development.
-
-- Email <pr...@qpid.apache.org>
-- Create issues <https://issues.apache.org/jira/browse/PROTON>, attach patches to an issue.
-
-## Goals
-
-The API should
-
-- be idiomatic, unsurprising, and easy to use for Go developers.
-- support client and server development.
-- make simple tasks simple.
-- provide deep access to AMQP protocol when that is required.
-
-There are two types of developer we want to support
-
-1. Go developers using AMQP as a message transport:
-   - Straightforward conversions between Go built-in types and AMQP types.
-   - Easy message exchange via Go channels to support use in goroutines.
-
-2. AMQP-aware developers using Go as an implementation language:
-   - Go types to exactly represent all AMQP types and encoding details.
-   - Full access to detailed AMQP concepts: sessions, links, deliveries etc.
-
-## Status
-
-Package proton encodes and decodes AMQP messages and data as Go types.
-
-Sub-packages 'event' and 'messaging' provide two alternative ways to write
-AMQP clients and servers. 'messaging' is easier for general purpose use. 'event'
-gives complete low-level control of the underlying proton C engine.
-
-The event package is fairly complete, with the exception of the proton
-reactor. It's unclear if the reactor is important for go.
-
-The messaging package is just starting. The examples work but anything else might not.
-
-There are working [examples](../../../examples/go) of a broker, sender and receiver.
-
-## The event driven API
-
-See the package documentation for details.
-
-## The Go API
-
-The goal: A procedural API that allows any user goroutine to send and receive
-AMQP messages and other information (acknowledgments, flow control instructions
-etc.) using channels. There will be no user-visible locks and no need to run
-user code in special goroutines, e.g. as handlers in a proton event loop.
-
-See the package documentation for emerging details.
-
-Currently using a channel to receive messages, a function to send them (channels
-internally) and a channel as a "future" for acknowledgements to senders. This
-may change.
-
-## Design Questions
-
-
-1. Error reporting and handling, esp. async. errors:
-
-What are common patterns for handling errors across channels?  I.e. the thing at
-one end of the channel blows up, how do you tell the other end?
-
-readers: you can close the channel, but there's no error info. You could pass a
-struct { data, error } or use a second channel. Pros & cons?
-
-writers: you can't close without a panic so you need a second channel.  Is this
-a normal pattern:
-
-    select {
-        data -> sendChan: sentit()
-        err := <- errChan: oops(err)
-    }
-
-2. Use of channels:
-
-I recently saw an interesting Go tip: "Make your API synchronous because in Go
-it is simple to make a sync call async by putting it in a goroutine."
-
-What are the tradeoffs of exposing channels directly in the API vs. hiding them
-behind methods? Exposing lets users select directly, less overhead than starting
-a goroutine, creating MORE channels and selecting those. Hiding lets us wrap
-patterns like the 'select {data, err}' pattern above, which is easier and less
-error prone than asking users to do it themselves.
-
-The standard net.Conn uses blocking methods, not channels. I did as the tip says
-and wrapped them in goroutines and channels. The library does expose *read*
-channels e.g. time.After. Are there any *write* channels in the standard
-library? I note that time.After has no errors, and suspect that may be a key
-factor in the descison.
-
-3. The "future" pattern for acknowledgements: super easy in Go but depends on 1. and 2. above.
-
-## Why a separate API for Go?
-
-Go is a concurrent language and encourages applications to be divided into
-concurrent *goroutines*. It provides traditional locking but it encourages the
-use *channels* to communicate between goroutines without explicit locks:
-
-  "Share memory by communicating, don't communicate by sharing memory"
-
-The idea is that a given value is only operated on by one goroutine at a time,
-but values can easily be passed from one goroutine to another. This removes much
-of the need for locking.
-
-Go literature distinguishes between:
-
-- *concurrency*: "keeping track of things that could be done in parallel"
-- *parallelism*: "actually doing things in parallel"
-
-The application expresses concurrency by starting goroutines for potentially
-concurrent tasks. The Go run-times schedule the activity of goroutines onto a
-small number (possibly one) of actual parallel executions.
-
-Even with *no* parallelism, concurrency lets the Go run-times *order* work with
-respect to events like file descriptors being readable/writable, channels having
-data, timers firing etc. Go automatically takes care of switching out goroutines
-that block or sleep so it is normal to write code in terms of blocking calls.
-
-Event-driven API (like poll, epoll, select or the proton event API) also
-channel unpredictably ordered events to actions in one or a small pool of
-execution threads. However this requires a different style of programming:
-"event-driven" or "reactive" programming. Go developers call it "inside-out"
-programming. In an event-driven architecture blocking is a big problem as it
-consumes a scarce thread of execution, so actions that take time to complete
-have to be re-structured in terms of future event delivery.
-
-The promise of Go is that you can express your application in concurrent,
-procedural terms with simple blocking calls and the Go run-times will turn it
-inside-out for you. Write as many goroutines as you want, and let Go interleave
-and schedule them efficiently.
-
-For example: the Go equivalent of listening for connections is a goroutine with
-a simple endless loop that calls a blocking Listen() function and starts a
-goroutine for each new connection. Each connection has its own goroutine that
-deals with just that connection till it closes.
-
-The benefit is that the variables and logic live closer together. Once you're in
-a goroutine, you have everything you need in local variables, and they are
-preserved across blocking calls. There's no need to store details in context
-objects that you have to look up when handling a later event to figure out how
-to continue where you left off.
-
-So a Go-like proton API does not force the users code to run in an event-loop
-goroutine. Instead user goroutines communicate with the event loop(s) via
-channels.  There's no need to funnel connections into one event loop, in fact it
-makes no sense.  Connections can be processed concurrently so they should be
-processed in separate goroutines and left to Go to schedule. User goroutines can
-have simple loops that block channels till messages are available, the user can
-start as many or as few such goroutines as they wish to implement concurrency as
-simple or as complex as they wish. For example blocking request-response
-vs. asynchronous flows of messages and acknowledgments.
-
-
-## Layout
-
-This directory is a [Go work-space](http://golang.org/doc/code.html), it is not
-yet connected to the rest of the proton build.
-
-To experiment, install proton in a standard place or set these environment
-variables: `PATH`, `C_INCLUDE_PATH`, `LIBRARY_PATH` and `LD_LIBRARY_PATH`.
-
-Add this directory to `GOPATH` for the Go tools.
-
-To see the docs as text:
-
-    godoc apache.org/proton
-
-To see them in your browser run this in the background and open
-http://localhost:6060 in your browser:
-
-    godoc -http=:6060 -index=true&
-
-Click "Packages" and "proton" to see the proton docs. It takes a minute or two
-to generate the index so search may not work immediately.
-
-To run the unit tests:
-
-    go test -a apache.org/proton
-
-## New to Go?
-
-If you are new to Go then these are a good place to start:
-
-- [A Tour of Go](http://tour.golang.org)
-- [Effective Go](http://golang.org/doc/effective_go.html)
-
-Then look at the tools and library docs at <http://golang.org> as you need them.
-
+Experimental work on the Go language binding has been moved to the `go` branch
+until it is ready for use. You can `git checkout go` on your git clone, or
+browse at https://github.com/apache/qpid-proton/blob/go/proton-c/bindings/go/README.md

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/WARNING_EXPERIMENTAL
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/WARNING_EXPERIMENTAL b/proton-c/bindings/go/WARNING_EXPERIMENTAL
deleted file mode 100644
index 96dc92f..0000000
--- a/proton-c/bindings/go/WARNING_EXPERIMENTAL
+++ /dev/null
@@ -1 +0,0 @@
-See README.md

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/Makefile
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/Makefile b/proton-c/bindings/go/src/Makefile
deleted file mode 100644
index 98baa4c..0000000
--- a/proton-c/bindings/go/src/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# FIXME aconway 2015-04-09: integrate with cmake
-
-#GOFLAGS=-compiler gccgo -gccgoflags "-g -O0"
-#GOFLAGS=-gcflags "-N -l"
-
-GENERATED=qpid.apache.org/proton/event/wrappers_gen.go
-
-test: $(GENERATED)
-	go test -v $(TESTFLAGS) $(GOFLAGS) qpid.apache.org/proton
-	go test -v $(TESTFLAGS) $(GOFLAGS) qpid.apache.org/proton/event
-	go test -v $(TESTFLAGS) $(GOFLAGS) qpid.apache.org/proton/messaging
-
-$(GENERATED): genwrap.go ../../../include/proton/*.h
-	go run genwrap.go
-
-

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/genwrap.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/genwrap.go b/proton-c/bindings/go/src/genwrap.go
deleted file mode 100644
index e34c045..0000000
--- a/proton-c/bindings/go/src/genwrap.go
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Code generator to generate a think Go wrapper API around the C proton API.
-//
-
-package main
-
-import (
-	"fmt"
-	"io"
-	"io/ioutil"
-	"os"
-	"os/exec"
-	"path"
-	"regexp"
-	"strings"
-	"text/template"
-)
-
-func mixedCase(s string) string {
-	result := ""
-	for _, w := range strings.Split(s, "_") {
-		if w != "" {
-			result = result + strings.ToUpper(w[0:1]) + strings.ToLower(w[1:])
-		}
-	}
-	return result
-}
-
-func mixedCaseTrim(s, prefix string) string {
-	return mixedCase(strings.TrimPrefix(s, prefix))
-}
-
-var templateFuncs = template.FuncMap{"mixedCase": mixedCase, "mixedCaseTrim": mixedCaseTrim}
-
-func doTemplate(out io.Writer, data interface{}, tmpl string) {
-	panicIf(template.Must(template.New("").Funcs(templateFuncs).Parse(tmpl)).Execute(out, data))
-}
-
-type enumType struct {
-	Name   string
-	Values []string
-}
-
-// Find enums in a header file return map of enum name to values.
-func findEnums(header string) (enums []enumType) {
-	for _, enum := range enumDefRe.FindAllStringSubmatch(header, -1) {
-		enums = append(enums, enumType{enum[2], enumValRe.FindAllString(enum[1], -1)})
-	}
-	return enums
-}
-
-func genEnum(out io.Writer, name string, values []string) {
-	doTemplate(out, []interface{}{name, values}, `{{$enumName := index . 0}}{{$values := index . 1}}
-type {{mixedCase $enumName}} C.pn_{{$enumName}}_t
-const ({{range $values}}
-	{{mixedCase .}} {{mixedCase $enumName}} = C.{{.}} {{end}}
-)
-
-func (e {{mixedCase $enumName}}) String() string {
-	switch e {
-{{range $values}}
-	case C.{{.}}: return "{{mixedCaseTrim . "PN_"}}" {{end}}
-	}
-	return "unknown"
-}
-`)
-}
-
-var (
-	reSpace = regexp.MustCompile("\\s+")
-)
-
-func panicIf(err error) {
-	if err != nil {
-		panic(err)
-	}
-}
-
-func readHeader(name string) string {
-	file, err := os.Open(path.Join("..", "..", "..", "include", "proton", name+".h"))
-	panicIf(err)
-	defer file.Close()
-	s, err := ioutil.ReadAll(file)
-	panicIf(err)
-	return string(s)
-}
-
-var copyright string = `/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-//
-// NOTE: This file was generated by genwrap.go, do not edit it by hand.
-//
-`
-
-type eventType struct {
-	// C, function and interface names for the event
-	Name, Cname, Fname, Iname string
-}
-
-func newEventType(cName string) eventType {
-	var etype eventType
-	etype.Cname = cName
-	etype.Name = mixedCaseTrim(cName, "PN_")
-	etype.Fname = "On" + etype.Name
-	etype.Iname = etype.Fname + "Interface"
-	return etype
-}
-
-var (
-	enumDefRe   = regexp.MustCompile("typedef enum {([^}]*)} pn_([a-z_]+)_t;")
-	enumValRe   = regexp.MustCompile("PN_[A-Z_]+")
-	skipEventRe = regexp.MustCompile("EVENT_NONE|REACTOR|SELECTABLE|TIMER")
-	skipFnRe    = regexp.MustCompile("attach|context|class|collect|^recv$|^send$|transport")
-)
-
-// Generate event wrappers.
-func event(out io.Writer) {
-	event_h := readHeader("event")
-
-	// Event is implented by hand in wrappers.go
-
-	// Get all the pn_event_type_t enum values
-	var etypes []eventType
-	enums := findEnums(event_h)
-	for _, e := range enums[0].Values {
-		if skipEventRe.FindStringSubmatch(e) == nil {
-			etypes = append(etypes, newEventType(e))
-		}
-	}
-
-	doTemplate(out, etypes, `
-type EventType int
-const ({{range .}}
-	 E{{.Name}} EventType = C.{{.Cname}}{{end}}
-)
-`)
-
-	doTemplate(out, etypes, `
-func (e EventType) String() string {
-	switch e {
-{{range .}}
-	case C.{{.Cname}}: return "{{.Name}}"{{end}}
-	}
-	return "Unknown"
-}
-`)
-}
-
-type genType struct {
-	Ctype, Gotype string
-	ToGo          func(value string) string
-	ToC           func(value string) string
-	Assign        func(value string) string
-}
-
-func (g genType) printBody(out io.Writer, value string) {
-	if g.Gotype != "" {
-		fmt.Fprintf(out, "return %s", g.ToGo(value))
-	} else {
-		fmt.Fprintf(out, "%s", value)
-	}
-}
-
-func (g genType) goLiteral(value string) string {
-	return fmt.Sprintf("%s{%s}", g.Gotype, value)
-}
-
-func (g genType) goConvert(value string) string {
-	switch g.Gotype {
-	case "string":
-		return fmt.Sprintf("C.GoString(%s)", value)
-	case "Event":
-		return fmt.Sprintf("makeEvent(%s)", value)
-	default:
-		return fmt.Sprintf("%s(%s)", g.Gotype, value)
-	}
-}
-
-var notStruct = map[string]bool{
-	"EventType":        true,
-	"SndSettleMode":    true,
-	"RcvSettleMode":    true,
-	"TerminusType":     true,
-	"State":            true,
-	"Durability":       true,
-	"ExpiryPolicy":     true,
-	"DistributionMode": true,
-}
-
-func mapType(ctype string) (g genType) {
-	g.Ctype = "C." + strings.Trim(ctype, " \n")
-
-	switch g.Ctype {
-	case "C.void":
-		g.Gotype = ""
-	case "C.size_t":
-		g.Gotype = "uint"
-	case "C.int":
-		g.Gotype = "int"
-	case "C.void *":
-		g.Gotype = "unsafe.Pointer"
-		g.Ctype = "unsafe.Pointer"
-	case "C.bool":
-		g.Gotype = "bool"
-	case "C.ssize_t":
-		g.Gotype = "int"
-	case "C.uint64_t":
-		g.Gotype = "uint64"
-	case "C.uint32_t":
-		g.Gotype = "uint16"
-	case "C.uint16_t":
-		g.Gotype = "uint32"
-	case "C.const char *":
-		fallthrough
-	case "C.char *":
-		g.Gotype = "string"
-		g.Ctype = "C.CString"
-		g.ToC = func(v string) string { return fmt.Sprintf("%sC", v) }
-		g.Assign = func(v string) string {
-			return fmt.Sprintf("%sC := C.CString(%s)\n defer C.free(unsafe.Pointer(%sC))\n", v, v, v)
-		}
-	case "C.pn_seconds_t":
-		g.Gotype = "time.Duration"
-		g.ToGo = func(v string) string { return fmt.Sprintf("(time.Duration(%s) * time.Second)", v) }
-	case "C.pn_error_t *":
-		g.Gotype = "error"
-		g.ToGo = func(v string) string { return fmt.Sprintf("internal.PnError(unsafe.Pointer(%s))", v) }
-	default:
-		pnId := regexp.MustCompile(" *pn_([a-z_]+)_t *\\*? *")
-		match := pnId.FindStringSubmatch(g.Ctype)
-		if match == nil {
-			panic(fmt.Errorf("unknown C type %#v", g.Ctype))
-		}
-		g.Gotype = mixedCase(match[1])
-		if !notStruct[g.Gotype] {
-			g.ToGo = g.goLiteral
-			g.ToC = func(v string) string { return v + ".pn" }
-		}
-	}
-	if g.ToGo == nil {
-		g.ToGo = g.goConvert // Use conversion by default.
-	}
-	if g.ToC == nil {
-		g.ToC = func(v string) string { return fmt.Sprintf("%s(%s)", g.Ctype, v) }
-	}
-	return
-}
-
-type genArg struct {
-	Name string
-	genType
-}
-
-var typeNameRe = regexp.MustCompile("^(.*( |\\*))([^ *]+)$")
-
-func splitArgs(argstr string) []genArg {
-	argstr = strings.Trim(argstr, " \n")
-	if argstr == "" {
-		return []genArg{}
-	}
-	args := make([]genArg, 0)
-	for _, item := range strings.Split(argstr, ",") {
-		item = strings.Trim(item, " \n")
-		typeName := typeNameRe.FindStringSubmatch(item)
-		if typeName == nil {
-			panic(fmt.Errorf("Can't split argument type/name %#v", item))
-		}
-		cType := strings.Trim(typeName[1], " \n")
-		name := strings.Trim(typeName[3], " \n")
-		if name == "type" {
-			name = "type_"
-		}
-		args = append(args, genArg{name, mapType(cType)})
-	}
-	return args
-}
-
-func goArgs(args []genArg) string {
-	l := ""
-	for i, arg := range args {
-		if i != 0 {
-			l += ", "
-		}
-		l += arg.Name + " " + arg.Gotype
-	}
-	return l
-}
-
-func cArgs(args []genArg) string {
-	l := ""
-	for _, arg := range args {
-		l += fmt.Sprintf(", %s", arg.ToC(arg.Name))
-	}
-	return l
-}
-
-func cAssigns(args []genArg) string {
-	l := "\n"
-	for _, arg := range args {
-		if arg.Assign != nil {
-			l += fmt.Sprintf("%s\n", arg.Assign(arg.Name))
-		}
-	}
-	return l
-}
-
-// Return the go name of the function or "" to skip the function.
-func goFnName(api, fname string) string {
-	// Skip class, context and attachment functions.
-	if skipFnRe.FindStringSubmatch(fname) != nil {
-		return ""
-	}
-	switch api + "." + fname {
-	case "link.get_drain":
-		return "IsDrain"
-	default:
-		return mixedCaseTrim(fname, "get_")
-	}
-}
-
-func apiWrapFns(api, header string, out io.Writer) {
-	fmt.Fprintf(out, "type %s struct{pn *C.pn_%s_t}\n", mixedCase(api), api)
-	fmt.Fprintf(out, "func (%c %s) IsNil() bool { return %c.pn == nil }\n", api[0], mixedCase(api), api[0])
-	fn := regexp.MustCompile(fmt.Sprintf(`PN_EXTERN ([a-z0-9_ ]+ *\*?) *pn_%s_([a-z_]+)\(pn_%s_t *\*[a-z_]+ *,? *([^)]*)\)`, api, api))
-	for _, m := range fn.FindAllStringSubmatch(header, -1) {
-		rtype, fname, argstr := mapType(m[1]), m[2], m[3]
-		gname := goFnName(api, fname)
-		if gname == "" { // Skip
-			continue
-		}
-		args := splitArgs(argstr)
-		fmt.Fprintf(out, "func (%c %s) %s", api[0], mixedCase(api), gname)
-		fmt.Fprintf(out, "(%s) %s { ", goArgs(args), rtype.Gotype)
-		fmt.Fprint(out, cAssigns(args))
-		rtype.printBody(out, fmt.Sprintf("C.pn_%s_%s(%c.pn%s)", api, fname, api[0], cArgs(args)))
-		fmt.Fprintf(out, "}\n")
-	}
-}
-
-func main() {
-	outpath := path.Join("qpid.apache.org", "proton", "event", "wrappers_gen.go")
-	out, err := os.Create(outpath)
-	panicIf(err)
-	defer out.Close()
-
-	apis := []string{"session", "link", "delivery", "disposition", "condition", "terminus", "connection"}
-	fmt.Fprintln(out, copyright)
-	fmt.Fprint(out, `
-package event
-
-import (
-	"time"
-  "unsafe"
-  "qpid.apache.org/proton/internal"
-)
-
-// #include <proton/types.h>
-// #include <proton/event.h>
-// #include <stdlib.h>
-`)
-	for _, api := range apis {
-		fmt.Fprintf(out, "// #include <proton/%s.h>\n", api)
-	}
-	fmt.Fprintln(out, `import "C"`)
-
-	event(out)
-
-	for _, api := range apis {
-		fmt.Fprintf(out, "// Wrappers for declarations in %s.h\n\n", api)
-		header := readHeader(api)
-		enums := findEnums(header)
-		for _, e := range enums {
-			genEnum(out, e.Name, e.Values)
-		}
-		apiWrapFns(api, header, out)
-	}
-	out.Close()
-
-	// Run gofmt.
-	cmd := exec.Command("gofmt", "-w", outpath)
-	cmd.Stdout = os.Stdout
-	cmd.Stderr = os.Stderr
-	err = cmd.Run()
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "gofmt: %s", err)
-		os.Exit(1)
-	}
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go b/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go
deleted file mode 100644
index 38c2d00..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package proton encodes and decodes AMQP messages and data as Go types.
-
-It follows the standard 'encoding' libraries pattern. The mapping between AMQP
-and Go types is described in the documentation of the Marshal and Unmarshal
-functions.
-
-The sub-packages 'event' and 'messaging' provide two alternative ways to write
-AMQP clients and servers. 'messaging' is easier for general purpose use. 'event'
-gives complete low-level control of the underlying proton C engine.
-
-AMQP is an open standard for inter-operable message exchange, see <http://www.amqp.org/>
-*/
-package proton
-
-// #cgo LDFLAGS: -lqpid-proton
-import "C"
-
-// This file is just for the package comment.
-
-// FIXME aconway 2015-04-28: need to re-organize the package, it's not very intuitive.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/event/doc.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/event/doc.go b/proton-c/bindings/go/src/qpid.apache.org/proton/event/doc.go
deleted file mode 100644
index a0d45d7..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/event/doc.go
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package event provides a low-level API to the proton AMQP engine.
-
-For most tasks, consider instead package qpid.apache.org/proton/messaging.
-It provides a higher-level, concurrent API that is easier to use.
-
-The API is event based. There are two alternative styles of handler. EventHandler
-provides the core proton events. MessagingHandler provides a slighly simplified
-view of the event stream and automates some common tasks.
-
-See type Pump documentation for more details of the interaction between proton
-events and goroutines.
-*/
-package event
-
-// #cgo LDFLAGS: -lqpid-proton
-import "C"
-
-// This file is just for the package comment.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/event/handlers.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/event/handlers.go b/proton-c/bindings/go/src/qpid.apache.org/proton/event/handlers.go
deleted file mode 100644
index 5fc679a..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/event/handlers.go
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package event
-
-// #include <proton/reactor.h>
-// #include <proton/handlers.h>
-import "C"
-
-import (
-	"qpid.apache.org/proton/internal"
-)
-
-// EventHandler handles core proton events.
-type EventHandler interface {
-	// HandleEvent is called with an event.
-	// Typically HandleEvent() is implemented as a switch on e.Type()
-	HandleEvent(e Event) error
-}
-
-// cHandler wraps a C pn_handler_t
-type cHandler struct {
-	pn *C.pn_handler_t
-}
-
-func (h cHandler) HandleEvent(e Event) error {
-	C.pn_handler_dispatch(h.pn, e.pn, C.pn_event_type(e.pn))
-	return nil // FIXME aconway 2015-03-31: error handling
-}
-
-// MessagingHandler provides an alternative interface to EventHandler.
-// it is easier to use for most applications that send and receive messages.
-//
-// Implement this interface and then wrap your value with a MessagingHandlerDelegator.
-// MessagingHandlerDelegator implements EventHandler and can be registered with a Pump.
-//
-type MessagingHandler interface {
-	HandleMessagingEvent(MessagingEventType, Event) error
-}
-
-// MessagingEventType provides a set of events that are easier to work with than the
-// core events defined by EventType
-//
-// There are 3 types of "endpoint": Connection, Session and Link.
-// For each endpoint there are 5 event types: Opening, Opened, Closing, Closed and Error.
-// The meaning of these events is as follows:
-//
-// Opening: The remote end opened, the local end will open automatically.
-//
-// Opened: Both ends are open, regardless of which end opened first.
-//
-// Closing: The remote end closed without error, the local end will close automatically.
-//
-// Error: The remote end closed with an error, the local end will close automatically.
-//
-// Closed: Both ends are closed, regardless of which end closed first or if there was an error.
-//
-type MessagingEventType int
-
-const (
-	// The event loop starts.
-	MStart MessagingEventType = iota
-	// The peer closes the connection with an error condition.
-	MConnectionError
-	// The peer closes the session with an error condition.
-	MSessionError
-	// The peer closes the link with an error condition.
-	MLinkError
-	// The peer Initiates the opening of the connection.
-	MConnectionOpening
-	// The peer initiates the opening of the session.
-	MSessionOpening
-	// The peer initiates the opening of the link.
-	MLinkOpening
-	// The connection is opened.
-	MConnectionOpened
-	// The session is opened.
-	MSessionOpened
-	// The link is opened.
-	MLinkOpened
-	// The peer initiates the closing of the connection.
-	MConnectionClosing
-	// The peer initiates the closing of the session.
-	MSessionClosing
-	// The peer initiates the closing of the link.
-	MLinkClosing
-	// Both ends of the connection are closed.
-	MConnectionClosed
-	// Both ends of the session are closed.
-	MSessionClosed
-	// Both ends of the link are closed.
-	MLinkClosed
-	// The connection is disconnected.
-	MConnectionDisconnected
-	// The session's connection was disconnected
-	MSessionDisconnected
-	// The session's connection was disconnected
-	MLinkDisconnected
-	// The sender link has credit and messages can
-	// therefore be transferred.
-	MSendable
-	// The remote peer accepts an outgoing message.
-	MAccepted
-	// The remote peer rejects an outgoing message.
-	MRejected
-	// The peer releases an outgoing message. Note that this may be in response to
-	// either the RELEASE or MODIFIED state as defined by the AMQP specification.
-	MReleased
-	// The peer has settled the outgoing message. This is the point at which it
-	// shouod never be retransmitted.
-	MSettled
-	// A message is received. Call proton.EventMessage(Event) to get the message.
-	// To manage the outcome of this messages (e.g. to accept or reject the message)
-	// use Event.Delivery().
-	MMessage
-	// The event loop terminates, there are no more events to process.
-	MFinal
-)
-
-func (t MessagingEventType) String() string {
-	switch t {
-	case MStart:
-		return "Start"
-	case MConnectionError:
-		return "ConnectionError"
-	case MSessionError:
-		return "SessionError"
-	case MLinkError:
-		return "LinkError"
-	case MConnectionOpening:
-		return "ConnectionOpening"
-	case MSessionOpening:
-		return "SessionOpening"
-	case MLinkOpening:
-		return "LinkOpening"
-	case MConnectionOpened:
-		return "ConnectionOpened"
-	case MSessionOpened:
-		return "SessionOpened"
-	case MLinkOpened:
-		return "LinkOpened"
-	case MConnectionClosing:
-		return "ConnectionClosing"
-	case MSessionClosing:
-		return "SessionClosing"
-	case MLinkClosing:
-		return "LinkClosing"
-	case MConnectionClosed:
-		return "ConnectionClosed"
-	case MSessionClosed:
-		return "SessionClosed"
-	case MLinkClosed:
-		return "LinkClosed"
-	case MConnectionDisconnected:
-		return "ConnectionDisconnected"
-	case MSessionDisconnected:
-		return "MSessionDisconnected"
-	case MLinkDisconnected:
-		return "MLinkDisconnected"
-	case MSendable:
-		return "Sendable"
-	case MAccepted:
-		return "Accepted"
-	case MRejected:
-		return "Rejected"
-	case MReleased:
-		return "Released"
-	case MSettled:
-		return "Settled"
-	case MMessage:
-		return "Message"
-	default:
-		return "Unknown"
-	}
-}
-
-// ResourceHandler provides a simple way to track the creation and deletion of
-// various proton objects.
-// endpointDelegator captures common patterns for endpoints opening/closing
-type endpointDelegator struct {
-	remoteOpen, remoteClose, localOpen, localClose EventType
-	opening, opened, closing, closed, error        MessagingEventType
-	endpoint                                       func(Event) Endpoint
-	delegate                                       MessagingHandler
-}
-
-// HandleEvent handles an open/close event for an endpoint in a generic way.
-func (d endpointDelegator) HandleEvent(e Event) (err error) {
-	endpoint := d.endpoint(e)
-	state := endpoint.State()
-
-	switch e.Type() {
-
-	case d.localOpen:
-		if state.Is(SRemoteActive) {
-			err = d.delegate.HandleMessagingEvent(d.opened, e)
-		}
-
-	case d.remoteOpen:
-		switch {
-		case state.Is(SLocalActive):
-			err = d.delegate.HandleMessagingEvent(d.opened, e)
-		case state.Is(SLocalUninit):
-			err = d.delegate.HandleMessagingEvent(d.opening, e)
-			if err == nil {
-				endpoint.Open()
-			}
-		}
-
-	case d.remoteClose:
-		var err1 error
-		if endpoint.RemoteCondition().IsSet() { // Closed with error
-			err1 = d.delegate.HandleMessagingEvent(d.error, e)
-			if err1 == nil { // Don't overwrite an application error.
-				err1 = endpoint.RemoteCondition().Error()
-			}
-		} else {
-			err1 = d.delegate.HandleMessagingEvent(d.closing, e)
-		}
-		if state.Is(SLocalClosed) {
-			err = d.delegate.HandleMessagingEvent(d.closed, e)
-		} else if state.Is(SLocalActive) {
-			endpoint.Close()
-		}
-		if err1 != nil { // Keep the first error.
-			err = err1
-		}
-
-	case d.localClose:
-		if state.Is(SRemoteClosed) {
-			err = d.delegate.HandleMessagingEvent(d.closed, e)
-		}
-
-	default:
-		// We shouldn't be called with any other event type.
-		panic(internal.Errorf("internal error, not an open/close event: %s", e))
-	}
-
-	return err
-}
-
-// MessagingDelegator implments a EventHandler and delegates to a MessagingHandler.
-// You can modify the exported fields before you pass the MessagingDelegator to
-// a Pump.
-type MessagingDelegator struct {
-	delegate                   MessagingHandler
-	connection, session, link  endpointDelegator
-	handshaker, flowcontroller EventHandler
-
-	// AutoSettle (default true) automatically pre-settle outgoing messages.
-	AutoSettle bool
-	// AutoAccept (default true) automatically accept and settle incoming messages
-	// if they are not settled by the delegate.
-	AutoAccept bool
-	// Prefetch (default 10) initial credit to issue for incoming links.
-	Prefetch int
-	// PeerCloseIsError (default false) if true a close by the peer will be treated as an error.
-	PeerCloseError bool
-}
-
-func NewMessagingDelegator(h MessagingHandler) EventHandler {
-	return &MessagingDelegator{
-		delegate: h,
-		connection: endpointDelegator{
-			EConnectionRemoteOpen, EConnectionRemoteClose, EConnectionLocalOpen, EConnectionLocalClose,
-			MConnectionOpening, MConnectionOpened, MConnectionClosing, MConnectionClosed,
-			MConnectionError,
-			func(e Event) Endpoint { return e.Connection() },
-			h,
-		},
-		session: endpointDelegator{
-			ESessionRemoteOpen, ESessionRemoteClose, ESessionLocalOpen, ESessionLocalClose,
-			MSessionOpening, MSessionOpened, MSessionClosing, MSessionClosed,
-			MSessionError,
-			func(e Event) Endpoint { return e.Session() },
-			h,
-		},
-		link: endpointDelegator{
-			ELinkRemoteOpen, ELinkRemoteClose, ELinkLocalOpen, ELinkLocalClose,
-			MLinkOpening, MLinkOpened, MLinkClosing, MLinkClosed,
-			MLinkError,
-			func(e Event) Endpoint { return e.Link() },
-			h,
-		},
-		flowcontroller: nil,
-		AutoSettle:     true,
-		AutoAccept:     true,
-		Prefetch:       10,
-		PeerCloseError: false,
-	}
-}
-
-func handleIf(h EventHandler, e Event) error {
-	if h != nil {
-		return h.HandleEvent(e)
-	}
-	return nil
-}
-
-// Handle a proton event by passing the corresponding MessagingEvent(s) to
-// the MessagingHandler.
-func (d *MessagingDelegator) HandleEvent(e Event) error {
-	handleIf(d.flowcontroller, e) // FIXME aconway 2015-03-31: error handling.
-
-	switch e.Type() {
-
-	case EConnectionInit:
-		d.flowcontroller = cHandler{C.pn_flowcontroller(C.int(d.Prefetch))}
-		d.delegate.HandleMessagingEvent(MStart, e)
-
-	case EConnectionRemoteOpen, EConnectionRemoteClose, EConnectionLocalOpen, EConnectionLocalClose:
-		return d.connection.HandleEvent(e)
-
-	case ESessionRemoteOpen, ESessionRemoteClose, ESessionLocalOpen, ESessionLocalClose:
-		return d.session.HandleEvent(e)
-
-	case ELinkRemoteOpen, ELinkRemoteClose, ELinkLocalOpen, ELinkLocalClose:
-		return d.link.HandleEvent(e)
-
-	case ELinkFlow:
-		if e.Link().IsSender() && e.Link().Credit() > 0 {
-			return d.delegate.HandleMessagingEvent(MSendable, e)
-		}
-
-	case EDelivery:
-		if e.Delivery().Link().IsReceiver() {
-			d.incoming(e)
-		} else {
-			d.outgoing(e)
-		}
-
-	case ETransportTailClosed:
-		c := e.Connection()
-		for l := c.LinkHead(SRemoteActive); !l.IsNil(); l = l.Next(SRemoteActive) {
-			e2 := e
-			e2.link = l
-			e2.session = l.Session()
-			d.delegate.HandleMessagingEvent(MLinkDisconnected, e2)
-		}
-		for s := c.SessionHead(SRemoteActive); !s.IsNil(); s = s.Next(SRemoteActive) {
-			e2 := e
-			e2.session = s
-			d.delegate.HandleMessagingEvent(MSessionDisconnected, e2)
-		}
-		d.delegate.HandleMessagingEvent(MConnectionDisconnected, e)
-		d.delegate.HandleMessagingEvent(MFinal, e)
-	}
-	return nil
-}
-
-func (d *MessagingDelegator) incoming(e Event) (err error) {
-	delivery := e.Delivery()
-	if delivery.Readable() && !delivery.Partial() {
-		if e.Link().State().Is(SLocalClosed) {
-			e.Link().Advance()
-			if d.AutoAccept {
-				delivery.Release(false)
-			}
-		} else {
-			err = d.delegate.HandleMessagingEvent(MMessage, e)
-			e.Link().Advance()
-			if d.AutoAccept && !delivery.Settled() {
-				if err == nil {
-					delivery.Accept()
-				} else {
-					delivery.Reject()
-				}
-			}
-		}
-	} else if delivery.Updated() && delivery.Settled() {
-		err = d.delegate.HandleMessagingEvent(MSettled, e)
-	}
-	return
-}
-
-func (d *MessagingDelegator) outgoing(e Event) (err error) {
-	delivery := e.Delivery()
-	if delivery.Updated() {
-		switch delivery.Remote().Type() {
-		case Accepted:
-			err = d.delegate.HandleMessagingEvent(MAccepted, e)
-		case Rejected:
-			err = d.delegate.HandleMessagingEvent(MRejected, e)
-		case Released, Modified:
-			err = d.delegate.HandleMessagingEvent(MReleased, e)
-		}
-		if err == nil && delivery.Settled() {
-			err = d.delegate.HandleMessagingEvent(MSettled, e)
-		}
-		if err == nil && d.AutoSettle {
-			delivery.Settle()
-		}
-	}
-	return
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/event/message.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/event/message.go b/proton-c/bindings/go/src/qpid.apache.org/proton/event/message.go
deleted file mode 100644
index bd7dddd..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/event/message.go
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package event
-
-// #include <proton/types.h>
-// #include <proton/message.h>
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"qpid.apache.org/proton"
-	"qpid.apache.org/proton/internal"
-)
-
-// DecodeMessage decodes the message containined in a delivery event.
-func DecodeMessage(e Event) (m proton.Message, err error) {
-	defer internal.DoRecover(&err)
-	delivery := e.Delivery()
-	if !delivery.Readable() || delivery.Partial() {
-		return nil, internal.Errorf("attempting to get incomplete message")
-	}
-	data := make([]byte, delivery.Pending())
-	result := delivery.Link().Recv(data)
-	if result != len(data) {
-		return nil, internal.Errorf("cannot receive message: %s", internal.PnErrorCode(result))
-	}
-	return proton.DecodeMessage(data)
-}
-
-// FIXME aconway 2015-04-08: proper handling of delivery tags. Tag counter per link.
-var tags proton.UidCounter
-
-// Send sends a proton.Message over a Link.
-// Returns a Delivery that can be use to determine the outcome of the message.
-func (link Link) Send(m proton.Message) (Delivery, error) {
-	if !link.IsSender() {
-		return Delivery{}, internal.Errorf("attempt to send message on receiving link")
-	}
-	// FIXME aconway 2015-04-08: buffering, error handling
-	delivery := link.Delivery(tags.Next())
-	bytes, err := m.Encode(nil)
-	if err != nil {
-		return Delivery{}, internal.Errorf("cannot send mesage %s", err)
-	}
-	result := link.SendBytes(bytes)
-	link.Advance()
-	if result != len(bytes) {
-		if result < 0 {
-			return delivery, internal.Errorf("send failed %v", internal.PnErrorCode(result))
-		} else {
-			return delivery, internal.Errorf("send incomplete %v of %v", result, len(bytes))
-		}
-	}
-	if link.RemoteSndSettleMode() == PnSndSettled { // FIXME aconway 2015-04-08: enum names
-		delivery.Settle()
-	}
-	return delivery, nil
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/event/pump.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/event/pump.go b/proton-c/bindings/go/src/qpid.apache.org/proton/event/pump.go
deleted file mode 100644
index c9c5ca3..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/event/pump.go
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package event
-
-// #include <proton/connection.h>
-// #include <proton/transport.h>
-// #include <proton/event.h>
-// #include <proton/reactor.h>
-// #include <proton/handlers.h>
-// #include <proton/transport.h>
-// #include <proton/session.h>
-// #include <memory.h>
-// #include <stdlib.h>
-//
-// PN_HANDLE(REMOTE_ADDR)
-import "C"
-
-import (
-	"fmt"
-	"io"
-	"net"
-	"qpid.apache.org/proton/internal"
-	"sync"
-	"unsafe"
-)
-
-// bufferChan manages a pair of ping-pong buffers to pass bytes through a channel.
-type bufferChan struct {
-	buffers    chan []byte
-	buf1, buf2 []byte
-}
-
-func newBufferChan(size int) *bufferChan {
-	return &bufferChan{make(chan []byte), make([]byte, size), make([]byte, size)}
-}
-
-func (b *bufferChan) buffer() []byte {
-	b.buf1, b.buf2 = b.buf2, b.buf1 // Alternate buffers.
-	return b.buf1[:cap(b.buf1)]
-}
-
-// FIXME aconway 2015-05-04: direct sending to Inject may block user goroutines if
-// the pum stops. Make this a function that selects on running.
-
-// FIXME aconway 2015-05-05: for consistency should Pump be called Driver?
-
-/*
-Pump reads from a net.Conn, decodes AMQP events and calls the appropriate
-Handler functions. Actions taken by Handler functions (such as sending messages)
-are encoded and written to the net.Conn.
-
-The proton protocol engine is single threaded (per connection). The Pump runs
-proton in the goroutine that calls Pump.Run() and creates goroutines to feed
-data to/from a net.Conn. You can create multiple Pumps to handle multiple
-connections concurrently.
-
-Methods in this package can only be called in the goroutine that executes the
-corresponding Pump.Run(). You implement the EventHandler or MessagingHandler
-interfaces and provide those values to NewPump(). Their HandleEvent method will be
-called in the Pump goroutine, in typical event-driven style.
-
-Handlers can pass values from an event (Connections, Links, Deliveries etc.) to
-other goroutines, store them, or use them as map indexes. Effectively they are
-just C pointers.  Other goroutines cannot call their methods directly but they
-can can create function closures that call their methods and send those closures
-to the Pump.Inject channel. They will execute safely in the pump
-goroutine. Injected functions, or your handlers, can set up channels to get
-results back to other goroutines.
-
-You are responsible for ensuring you don't use an event value after the C object
-has been deleted. The handler methods will tell you when a value is no longer
-valid. For example after a MethodHandler handles a LinkClosed event, that link
-is no longer valid. If you do Link.Close() yourself (in a handler or injected
-function) the link remains valid until the corresponing LinkClosed event is
-received by the handler.
-
-Pump.Close() will take care of cleaning up any remaining values and types when
-you are done with the Pump. All values associated with a pump become invalid
-when you call Pump.Close()
-
-The qpid.apache.org/proton/messaging package will do all this for you, so unless
-you are doing something fairly low-level it is probably a better choice.
-
-*/
-type Pump struct {
-	// Error is set on exit from Run() if there was an error.
-	Error error
-	// Channel to inject functions to be executed in the Pump's proton event loop.
-	Inject chan func()
-
-	conn       net.Conn
-	transport  *C.pn_transport_t
-	connection *C.pn_connection_t
-	collector  *C.pn_collector_t
-	read       *bufferChan    // Read buffers channel.
-	write      *bufferChan    // Write buffers channel.
-	handlers   []EventHandler // Handlers for proton events.
-	running    chan struct{}  // This channel will be closed when the goroutines are done.
-}
-
-const bufferSize = 4096
-
-var pumps map[*C.pn_connection_t]*Pump
-
-func init() {
-	pumps = make(map[*C.pn_connection_t]*Pump)
-}
-
-// NewPump initializes a pump with a connection and handlers. To start it running:
-//    p := NewPump(...)
-//    go run p.Run()
-// The goroutine will exit when the pump is closed or disconnected.
-// You can check for errors on Pump.Error.
-//
-func NewPump(conn net.Conn, handlers ...EventHandler) (*Pump, error) {
-	// Save the connection ID for Connection.String()
-	p := &Pump{
-		Inject:     make(chan func(), 100), // FIXME aconway 2015-05-04: blocking hack
-		conn:       conn,
-		transport:  C.pn_transport(),
-		connection: C.pn_connection(),
-		collector:  C.pn_collector(),
-		handlers:   handlers,
-		read:       newBufferChan(bufferSize),
-		write:      newBufferChan(bufferSize),
-		running:    make(chan struct{}),
-	}
-	if p.transport == nil || p.connection == nil || p.collector == nil {
-		return nil, internal.Errorf("failed to allocate pump")
-	}
-	pnErr := int(C.pn_transport_bind(p.transport, p.connection))
-	if pnErr != 0 {
-		return nil, internal.Errorf("cannot setup pump: %s", internal.PnErrorCode(pnErr))
-	}
-	C.pn_connection_collect(p.connection, p.collector)
-	C.pn_connection_open(p.connection)
-	pumps[p.connection] = p
-	return p, nil
-}
-
-func (p *Pump) String() string {
-	return fmt.Sprintf("(%s-%s)", p.conn.LocalAddr(), p.conn.RemoteAddr())
-}
-
-func (p *Pump) Id() string {
-	return fmt.Sprintf("%p", &p)
-}
-
-// setError sets error only if not already set
-func (p *Pump) setError(e error) {
-	if p.Error == nil {
-		p.Error = e
-	}
-}
-
-// Server puts the Pump in server mode, meaning it will auto-detect security settings on
-// the incoming connnection such as use of SASL and SSL.
-// Must be called before Run()
-//
-func (p *Pump) Server() {
-	C.pn_transport_set_server(p.transport)
-}
-
-func (p *Pump) free() {
-	if p.connection != nil {
-		C.pn_connection_free(p.connection)
-	}
-	if p.transport != nil {
-		C.pn_transport_free(p.transport)
-	}
-	if p.collector != nil {
-		C.pn_collector_free(p.collector)
-	}
-	for _, h := range p.handlers {
-		switch h := h.(type) {
-		case cHandler:
-			C.pn_handler_free(h.pn)
-		}
-	}
-}
-
-// Close closes the AMQP connection, the net.Conn, and stops associated goroutines.
-// It will cause Run() to return. Run() may return earlier if the network disconnects
-// but you must still call Close() to clean everything up.
-//
-// Methods on values associated with the pump (Connections, Sessions, Links) will panic
-// if called after Close()
-//
-func (p *Pump) Close() error {
-	// If the pump is still running, inject a close. Either way wait for it to finish.
-	select {
-	case p.Inject <- func() { C.pn_connection_close(p.connection) }:
-		<-p.running // Wait to finish
-	case <-p.running: // Wait for goroutines to finish
-	}
-	delete(pumps, p.connection)
-	p.free()
-	return p.Error
-}
-
-// Run the pump. Normally called in a goroutine as: go pump.Run()
-// An error dunring Run is stored on p.Error.
-//
-func (p *Pump) Run() {
-	// Signal errors from the read/write goroutines. Don't block if we don't
-	// read all the errors, we only care about the first.
-	error := make(chan error, 2)
-	// FIXME aconway 2015-05-04: 	stop := make(chan struct{}) // Closed to signal that read/write should stop.
-
-	wait := sync.WaitGroup{}
-	wait.Add(2)
-
-	go func() { // Read goroutine
-		defer wait.Done()
-		for {
-			rbuf := p.read.buffer()
-			n, err := p.conn.Read(rbuf)
-			if n > 0 {
-				p.read.buffers <- rbuf[:n]
-			} else if err != nil {
-				close(p.read.buffers)
-				error <- err
-				return
-			}
-		}
-	}()
-
-	go func() { // Write goroutine
-		defer wait.Done()
-		for {
-			wbuf, ok := <-p.write.buffers
-			if !ok {
-				return
-			}
-			_, err := p.conn.Write(wbuf)
-			if err != nil {
-				error <- err
-				return
-			}
-		}
-	}()
-
-	wbuf := p.write.buffer()[:0]
-loop:
-	for {
-		if len(wbuf) == 0 {
-			p.pop(&wbuf)
-		}
-		// Don't set wchan unless there is something to write.
-		var wchan chan []byte
-		if len(wbuf) > 0 {
-			wchan = p.write.buffers
-		}
-
-		select {
-		case buf := <-p.read.buffers: // Read a buffer
-			p.push(buf)
-		case wchan <- wbuf: // Write a buffer
-			wbuf = p.write.buffer()[:0]
-		case f := <-p.Inject: // Function injected from another goroutine
-			f()
-		case err := <-error: // Read or write error
-			p.setError(err)
-			C.pn_transport_close_tail(p.transport)
-			C.pn_transport_close_head(p.transport)
-		}
-		if err := p.process(); err != nil {
-			p.setError(err)
-			break loop
-		}
-	}
-	close(p.write.buffers)
-	p.conn.Close()
-	wait.Wait()
-	close(p.running) // Signal goroutines have exited and Error is set.
-}
-
-func minInt(a, b int) int {
-	if a < b {
-		return a
-	} else {
-		return b
-	}
-}
-
-func (p *Pump) pop(buf *[]byte) {
-	pending := int(C.pn_transport_pending(p.transport))
-	switch {
-	case pending == int(C.PN_EOS):
-		*buf = (*buf)[:]
-		return
-	case pending < 0:
-		panic(internal.Errorf("%s", internal.PnErrorCode(pending)))
-	}
-	size := minInt(pending, cap(*buf))
-	*buf = (*buf)[:size]
-	if size == 0 {
-		return
-	}
-	C.memcpy(unsafe.Pointer(&(*buf)[0]), unsafe.Pointer(C.pn_transport_head(p.transport)), C.size_t(size))
-	C.pn_transport_pop(p.transport, C.size_t(size))
-}
-
-func (p *Pump) push(buf []byte) {
-	buf2 := buf
-	for len(buf2) > 0 {
-		n := int(C.pn_transport_push(p.transport, (*C.char)(unsafe.Pointer((&buf2[0]))), C.size_t(len(buf2))))
-		if n <= 0 {
-			panic(internal.Errorf("error in transport: %s", internal.PnErrorCode(n)))
-		}
-		buf2 = buf2[n:]
-	}
-}
-
-func (p *Pump) handle(e Event) error {
-	for _, h := range p.handlers {
-		if err := h.HandleEvent(e); err != nil {
-			return err
-		}
-	}
-	if e.Type() == ETransportClosed {
-		return io.EOF
-	}
-	return nil
-}
-
-func (p *Pump) process() error {
-	// FIXME aconway 2015-05-04: if a Handler returns error we should stop the pump
-	for ce := C.pn_collector_peek(p.collector); ce != nil; ce = C.pn_collector_peek(p.collector) {
-		e := makeEvent(ce)
-		if err := p.handle(e); err != nil {
-			return err
-		}
-		C.pn_collector_pop(p.collector)
-	}
-	return nil
-}
-
-// Connectoin gets the Pump's connection value.
-func (p *Pump) Connection() Connection { return Connection{p.connection} }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers.go b/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers.go
deleted file mode 100644
index d2c4e43..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers.go
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package event
-
-//#include <proton/codec.h>
-//#include <proton/connection.h>
-//#include <proton/session.h>
-//#include <proton/session.h>
-//#include <proton/delivery.h>
-//#include <proton/link.h>
-//#include <proton/event.h>
-//#include <proton/transport.h>
-//#include <proton/link.h>
-//#include <stdlib.h>
-import "C"
-
-import (
-	"fmt"
-	"qpid.apache.org/proton/internal"
-	"unsafe"
-)
-
-// FIXME aconway 2015-05-05: Documentation for generated types.
-
-// Event is an AMQP protocol event.
-type Event struct {
-	pn         *C.pn_event_t
-	eventType  EventType
-	connection Connection
-	session    Session
-	link       Link
-	delivery   Delivery
-}
-
-func makeEvent(pn *C.pn_event_t) Event {
-	return Event{
-		pn:         pn,
-		eventType:  EventType(C.pn_event_type(pn)),
-		connection: Connection{C.pn_event_connection(pn)},
-		session:    Session{C.pn_event_session(pn)},
-		link:       Link{C.pn_event_link(pn)},
-		delivery:   Delivery{C.pn_event_delivery(pn)},
-	}
-}
-func (e Event) IsNil() bool            { return e.eventType == EventType(0) }
-func (e Event) Type() EventType        { return e.eventType }
-func (e Event) Connection() Connection { return e.connection }
-func (e Event) Session() Session       { return e.session }
-func (e Event) Link() Link             { return e.link }
-func (e Event) Delivery() Delivery     { return e.delivery }
-func (e Event) String() string         { return e.Type().String() }
-
-// Data holds a pointer to decoded AMQP data.
-// Use proton.marshal/unmarshal to access it as Go data types.
-//
-type Data struct{ pn *C.pn_data_t }
-
-func NewData(p unsafe.Pointer) Data { return Data{(*C.pn_data_t)(p)} }
-
-func (d Data) Free()                   { C.pn_data_free(d.pn) }
-func (d Data) Pointer() unsafe.Pointer { return unsafe.Pointer(d.pn) }
-func (d Data) Clear()                  { C.pn_data_clear(d.pn) }
-func (d Data) Rewind()                 { C.pn_data_rewind(d.pn) }
-func (d Data) Error() error {
-	return internal.PnError(unsafe.Pointer(C.pn_data_error(d.pn)))
-}
-
-// State holds the state flags for an AMQP endpoint.
-type State byte
-
-const (
-	SLocalUninit  State = C.PN_LOCAL_UNINIT
-	SLocalActive        = C.PN_LOCAL_ACTIVE
-	SLocalClosed        = C.PN_LOCAL_CLOSED
-	SRemoteUninit       = C.PN_REMOTE_UNINIT
-	SRemoteActive       = C.PN_REMOTE_ACTIVE
-	SRemoteClosed       = C.PN_REMOTE_CLOSED
-)
-
-// Is is True if bits & state is non 0.
-func (s State) Is(bits State) bool { return s&bits != 0 }
-
-// Return a State containig just the local flags
-func (s State) Local() State { return State(s & C.PN_LOCAL_MASK) }
-
-// Return a State containig just the remote flags
-func (s State) Remote() State { return State(s & C.PN_REMOTE_MASK) }
-
-// Endpoint is the common interface for Connection, Link and Session.
-type Endpoint interface {
-	// State is the open/closed state.
-	State() State
-	// Open an endpoint.
-	Open()
-	// Close an endpoint.
-	Close()
-	// Condition holds a local error condition.
-	Condition() Condition
-	// RemoteCondition holds a remote error condition.
-	RemoteCondition() Condition
-}
-
-const (
-	Received uint64 = C.PN_RECEIVED
-	Accepted        = C.PN_ACCEPTED
-	Rejected        = C.PN_REJECTED
-	Released        = C.PN_RELEASED
-	Modified        = C.PN_MODIFIED
-)
-
-// SettleAs is equivalent to d.Update(disposition); d.Settle()
-// It is a no-op if e does not have a delivery.
-func (d Delivery) SettleAs(disposition uint64) {
-	d.Update(disposition)
-	d.Settle()
-}
-
-// Accept accepts and settles a delivery.
-func (d Delivery) Accept() { d.SettleAs(Accepted) }
-
-// Reject rejects and settles a delivery
-func (d Delivery) Reject() { d.SettleAs(Rejected) }
-
-// Release releases and settles a delivery
-// If delivered is true the delivery count for the message will be increased.
-func (d Delivery) Release(delivered bool) {
-	if delivered {
-		d.SettleAs(Modified)
-	} else {
-		d.SettleAs(Released)
-	}
-}
-
-// FIXME aconway 2015-05-05: don't expose DeliveryTag as a C pointer, just as a String?
-
-type DeliveryTag struct{ pn C.pn_delivery_tag_t }
-
-func (t DeliveryTag) String() string { return C.GoStringN(t.pn.start, C.int(t.pn.size)) }
-
-func (l Link) Recv(buf []byte) int {
-	if len(buf) == 0 {
-		return 0
-	}
-	return int(C.pn_link_recv(l.pn, (*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
-}
-
-func (l Link) SendBytes(bytes []byte) int {
-	return int(C.pn_link_send(l.pn, cPtr(bytes), cLen(bytes)))
-}
-
-func pnTag(tag string) C.pn_delivery_tag_t {
-	bytes := []byte(tag)
-	return C.pn_dtag(cPtr(bytes), cLen(bytes))
-}
-
-func (l Link) Delivery(tag string) Delivery {
-	return Delivery{C.pn_delivery(l.pn, pnTag(tag))}
-}
-
-func cPtr(b []byte) *C.char {
-	if len(b) == 0 {
-		return nil
-	}
-	return (*C.char)(unsafe.Pointer(&b[0]))
-}
-
-func cLen(b []byte) C.size_t {
-	return C.size_t(len(b))
-}
-
-func (s Session) Sender(name string) Link {
-	cname := C.CString(name)
-	defer C.free(unsafe.Pointer(cname))
-	return Link{C.pn_sender(s.pn, cname)}
-}
-
-func (s Session) Receiver(name string) Link {
-	cname := C.CString(name)
-	defer C.free(unsafe.Pointer(cname))
-	return Link{C.pn_receiver(s.pn, cname)}
-}
-
-func joinId(a, b interface{}) string {
-	return fmt.Sprintf("%s/%s", a, b)
-}
-
-// Pump associated with this connection.
-func (c Connection) Pump() *Pump { return pumps[c.pn] }
-
-// Unique (per process) string identifier for a connection, useful for debugging.
-func (c Connection) String() string { return pumps[c.pn].String() }
-
-// Head functions don't follow the normal naming conventions so missed by the generator.
-
-func (c Connection) LinkHead(s State) Link {
-	return Link{C.pn_link_head(c.pn, C.pn_state_t(s))}
-}
-
-func (c Connection) SessionHead(s State) Session {
-	return Session{C.pn_session_head(c.pn, C.pn_state_t(s))}
-}
-
-// Unique (per process) string identifier for a session, including connection identifier.
-func (s Session) String() string {
-	return joinId(s.Connection(), fmt.Sprintf("%p", s.pn))
-}
-
-// Unique (per process) string identifier for a link, inlcuding session identifier.
-func (l Link) String() string {
-	return joinId(l.Session(), l.Name())
-}
-
-// Error returns an error interface corresponding to Condition.
-func (c Condition) Error() error {
-	if c.IsNil() {
-		return nil
-	} else {
-		return fmt.Errorf("%s: %s", c.Name(), c.Description())
-	}
-}
-
-// SetIfUnset sets name and description on a condition if it is not already set.
-func (c Condition) SetIfUnset(name, description string) {
-	if !c.IsSet() {
-		c.SetName(name)
-		c.SetDescription(description)
-	}
-}
-
-func (c Connection) Session() (Session, error) {
-	s := Session{C.pn_session(c.pn)}
-	if s.IsNil() {
-		return s, Connection(c).Error()
-	}
-	return s, nil
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers_gen.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers_gen.go b/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers_gen.go
deleted file mode 100644
index f53e8bb..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/event/wrappers_gen.go
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-//
-// NOTE: This file was generated by genwrap.go, do not edit it by hand.
-//
-
-package event
-
-import (
-	"qpid.apache.org/proton/internal"
-	"time"
-	"unsafe"
-)
-
-// #include <proton/types.h>
-// #include <proton/event.h>
-// #include <stdlib.h>
-// #include <proton/session.h>
-// #include <proton/link.h>
-// #include <proton/delivery.h>
-// #include <proton/disposition.h>
-// #include <proton/condition.h>
-// #include <proton/terminus.h>
-// #include <proton/connection.h>
-import "C"
-
-type EventType int
-
-const (
-	EConnectionInit         EventType = C.PN_CONNECTION_INIT
-	EConnectionBound        EventType = C.PN_CONNECTION_BOUND
-	EConnectionUnbound      EventType = C.PN_CONNECTION_UNBOUND
-	EConnectionLocalOpen    EventType = C.PN_CONNECTION_LOCAL_OPEN
-	EConnectionRemoteOpen   EventType = C.PN_CONNECTION_REMOTE_OPEN
-	EConnectionLocalClose   EventType = C.PN_CONNECTION_LOCAL_CLOSE
-	EConnectionRemoteClose  EventType = C.PN_CONNECTION_REMOTE_CLOSE
-	EConnectionFinal        EventType = C.PN_CONNECTION_FINAL
-	ESessionInit            EventType = C.PN_SESSION_INIT
-	ESessionLocalOpen       EventType = C.PN_SESSION_LOCAL_OPEN
-	ESessionRemoteOpen      EventType = C.PN_SESSION_REMOTE_OPEN
-	ESessionLocalClose      EventType = C.PN_SESSION_LOCAL_CLOSE
-	ESessionRemoteClose     EventType = C.PN_SESSION_REMOTE_CLOSE
-	ESessionFinal           EventType = C.PN_SESSION_FINAL
-	ELinkInit               EventType = C.PN_LINK_INIT
-	ELinkLocalOpen          EventType = C.PN_LINK_LOCAL_OPEN
-	ELinkRemoteOpen         EventType = C.PN_LINK_REMOTE_OPEN
-	ELinkLocalClose         EventType = C.PN_LINK_LOCAL_CLOSE
-	ELinkRemoteClose        EventType = C.PN_LINK_REMOTE_CLOSE
-	ELinkLocalDetach        EventType = C.PN_LINK_LOCAL_DETACH
-	ELinkRemoteDetach       EventType = C.PN_LINK_REMOTE_DETACH
-	ELinkFlow               EventType = C.PN_LINK_FLOW
-	ELinkFinal              EventType = C.PN_LINK_FINAL
-	EDelivery               EventType = C.PN_DELIVERY
-	ETransport              EventType = C.PN_TRANSPORT
-	ETransportAuthenticated EventType = C.PN_TRANSPORT_AUTHENTICATED
-	ETransportError         EventType = C.PN_TRANSPORT_ERROR
-	ETransportHeadClosed    EventType = C.PN_TRANSPORT_HEAD_CLOSED
-	ETransportTailClosed    EventType = C.PN_TRANSPORT_TAIL_CLOSED
-	ETransportClosed        EventType = C.PN_TRANSPORT_CLOSED
-)
-
-func (e EventType) String() string {
-	switch e {
-
-	case C.PN_CONNECTION_INIT:
-		return "ConnectionInit"
-	case C.PN_CONNECTION_BOUND:
-		return "ConnectionBound"
-	case C.PN_CONNECTION_UNBOUND:
-		return "ConnectionUnbound"
-	case C.PN_CONNECTION_LOCAL_OPEN:
-		return "ConnectionLocalOpen"
-	case C.PN_CONNECTION_REMOTE_OPEN:
-		return "ConnectionRemoteOpen"
-	case C.PN_CONNECTION_LOCAL_CLOSE:
-		return "ConnectionLocalClose"
-	case C.PN_CONNECTION_REMOTE_CLOSE:
-		return "ConnectionRemoteClose"
-	case C.PN_CONNECTION_FINAL:
-		return "ConnectionFinal"
-	case C.PN_SESSION_INIT:
-		return "SessionInit"
-	case C.PN_SESSION_LOCAL_OPEN:
-		return "SessionLocalOpen"
-	case C.PN_SESSION_REMOTE_OPEN:
-		return "SessionRemoteOpen"
-	case C.PN_SESSION_LOCAL_CLOSE:
-		return "SessionLocalClose"
-	case C.PN_SESSION_REMOTE_CLOSE:
-		return "SessionRemoteClose"
-	case C.PN_SESSION_FINAL:
-		return "SessionFinal"
-	case C.PN_LINK_INIT:
-		return "LinkInit"
-	case C.PN_LINK_LOCAL_OPEN:
-		return "LinkLocalOpen"
-	case C.PN_LINK_REMOTE_OPEN:
-		return "LinkRemoteOpen"
-	case C.PN_LINK_LOCAL_CLOSE:
-		return "LinkLocalClose"
-	case C.PN_LINK_REMOTE_CLOSE:
-		return "LinkRemoteClose"
-	case C.PN_LINK_LOCAL_DETACH:
-		return "LinkLocalDetach"
-	case C.PN_LINK_REMOTE_DETACH:
-		return "LinkRemoteDetach"
-	case C.PN_LINK_FLOW:
-		return "LinkFlow"
-	case C.PN_LINK_FINAL:
-		return "LinkFinal"
-	case C.PN_DELIVERY:
-		return "Delivery"
-	case C.PN_TRANSPORT:
-		return "Transport"
-	case C.PN_TRANSPORT_AUTHENTICATED:
-		return "TransportAuthenticated"
-	case C.PN_TRANSPORT_ERROR:
-		return "TransportError"
-	case C.PN_TRANSPORT_HEAD_CLOSED:
-		return "TransportHeadClosed"
-	case C.PN_TRANSPORT_TAIL_CLOSED:
-		return "TransportTailClosed"
-	case C.PN_TRANSPORT_CLOSED:
-		return "TransportClosed"
-	}
-	return "Unknown"
-}
-
-// Wrappers for declarations in session.h
-
-type Session struct{ pn *C.pn_session_t }
-
-func (s Session) IsNil() bool { return s.pn == nil }
-func (s Session) Free() {
-	C.pn_session_free(s.pn)
-}
-func (s Session) State() State {
-	return State(C.pn_session_state(s.pn))
-}
-func (s Session) Error() error {
-	return internal.PnError(unsafe.Pointer(C.pn_session_error(s.pn)))
-}
-func (s Session) Condition() Condition {
-	return Condition{C.pn_session_condition(s.pn)}
-}
-func (s Session) RemoteCondition() Condition {
-	return Condition{C.pn_session_remote_condition(s.pn)}
-}
-func (s Session) Connection() Connection {
-	return Connection{C.pn_session_connection(s.pn)}
-}
-func (s Session) Open() {
-	C.pn_session_open(s.pn)
-}
-func (s Session) Close() {
-	C.pn_session_close(s.pn)
-}
-func (s Session) IncomingCapacity() uint {
-	return uint(C.pn_session_get_incoming_capacity(s.pn))
-}
-func (s Session) SetIncomingCapacity(capacity uint) {
-	C.pn_session_set_incoming_capacity(s.pn, C.size_t(capacity))
-}
-func (s Session) OutgoingBytes() uint {
-	return uint(C.pn_session_outgoing_bytes(s.pn))
-}
-func (s Session) IncomingBytes() uint {
-	return uint(C.pn_session_incoming_bytes(s.pn))
-}
-func (s Session) Next(state State) Session {
-	return Session{C.pn_session_next(s.pn, C.pn_state_t(state))}
-}
-
-// Wrappers for declarations in link.h
-
-type SndSettleMode C.pn_snd_settle_mode_t
-
-const (
-	PnSndUnsettled SndSettleMode = C.PN_SND_UNSETTLED
-	PnSndSettled   SndSettleMode = C.PN_SND_SETTLED
-	PnSndMixed     SndSettleMode = C.PN_SND_MIXED
-)
-
-func (e SndSettleMode) String() string {
-	switch e {
-
-	case C.PN_SND_UNSETTLED:
-		return "SndUnsettled"
-	case C.PN_SND_SETTLED:
-		return "SndSettled"
-	case C.PN_SND_MIXED:
-		return "SndMixed"
-	}
-	return "unknown"
-}
-
-type RcvSettleMode C.pn_rcv_settle_mode_t
-
-const (
-	PnRcvFirst  RcvSettleMode = C.PN_RCV_FIRST
-	PnRcvSecond RcvSettleMode = C.PN_RCV_SECOND
-)
-
-func (e RcvSettleMode) String() string {
-	switch e {
-
-	case C.PN_RCV_FIRST:
-		return "RcvFirst"
-	case C.PN_RCV_SECOND:
-		return "RcvSecond"
-	}
-	return "unknown"
-}
-
-type Link struct{ pn *C.pn_link_t }
-
-func (l Link) IsNil() bool { return l.pn == nil }
-func (l Link) Free() {
-	C.pn_link_free(l.pn)
-}
-func (l Link) Name() string {
-	return C.GoString(C.pn_link_name(l.pn))
-}
-func (l Link) IsSender() bool {
-	return bool(C.pn_link_is_sender(l.pn))
-}
-func (l Link) IsReceiver() bool {
-	return bool(C.pn_link_is_receiver(l.pn))
-}
-func (l Link) State() State {
-	return State(C.pn_link_state(l.pn))
-}
-func (l Link) Error() error {
-	return internal.PnError(unsafe.Pointer(C.pn_link_error(l.pn)))
-}
-func (l Link) Condition() Condition {
-	return Condition{C.pn_link_condition(l.pn)}
-}
-func (l Link) RemoteCondition() Condition {
-	return Condition{C.pn_link_remote_condition(l.pn)}
-}
-func (l Link) Session() Session {
-	return Session{C.pn_link_session(l.pn)}
-}
-func (l Link) Next(state State) Link {
-	return Link{C.pn_link_next(l.pn, C.pn_state_t(state))}
-}
-func (l Link) Open() {
-	C.pn_link_open(l.pn)
-}
-func (l Link) Close() {
-	C.pn_link_close(l.pn)
-}
-func (l Link) Detach() {
-	C.pn_link_detach(l.pn)
-}
-func (l Link) Source() Terminus {
-	return Terminus{C.pn_link_source(l.pn)}
-}
-func (l Link) Target() Terminus {
-	return Terminus{C.pn_link_target(l.pn)}
-}
-func (l Link) RemoteSource() Terminus {
-	return Terminus{C.pn_link_remote_source(l.pn)}
-}
-func (l Link) RemoteTarget() Terminus {
-	return Terminus{C.pn_link_remote_target(l.pn)}
-}
-func (l Link) Current() Delivery {
-	return Delivery{C.pn_link_current(l.pn)}
-}
-func (l Link) Advance() bool {
-	return bool(C.pn_link_advance(l.pn))
-}
-func (l Link) Credit() int {
-	return int(C.pn_link_credit(l.pn))
-}
-func (l Link) Queued() int {
-	return int(C.pn_link_queued(l.pn))
-}
-func (l Link) RemoteCredit() int {
-	return int(C.pn_link_remote_credit(l.pn))
-}
-func (l Link) IsDrain() bool {
-	return bool(C.pn_link_get_drain(l.pn))
-}
-func (l Link) Drained() int {
-	return int(C.pn_link_drained(l.pn))
-}
-func (l Link) Available() int {
-	return int(C.pn_link_available(l.pn))
-}
-func (l Link) SndSettleMode() SndSettleMode {
-	return SndSettleMode(C.pn_link_snd_settle_mode(l.pn))
-}
-func (l Link) RcvSettleMode() RcvSettleMode {
-	return RcvSettleMode(C.pn_link_rcv_settle_mode(l.pn))
-}
-func (l Link) SetSndSettleMode(mode SndSettleMode) {
-	C.pn_link_set_snd_settle_mode(l.pn, C.pn_snd_settle_mode_t(mode))
-}
-func (l Link) SetRcvSettleMode(mode RcvSettleMode) {
-	C.pn_link_set_rcv_settle_mode(l.pn, C.pn_rcv_settle_mode_t(mode))
-}
-func (l Link) RemoteSndSettleMode() SndSettleMode {
-	return SndSettleMode(C.pn_link_remote_snd_settle_mode(l.pn))
-}
-func (l Link) RemoteRcvSettleMode() RcvSettleMode {
-	return RcvSettleMode(C.pn_link_remote_rcv_settle_mode(l.pn))
-}
-func (l Link) Unsettled() int {
-	return int(C.pn_link_unsettled(l.pn))
-}
-func (l Link) Offered(credit int) {
-	C.pn_link_offered(l.pn, C.int(credit))
-}
-func (l Link) Flow(credit int) {
-	C.pn_link_flow(l.pn, C.int(credit))
-}
-func (l Link) Drain(credit int) {
-	C.pn_link_drain(l.pn, C.int(credit))
-}
-func (l Link) SetDrain(drain bool) {
-	C.pn_link_set_drain(l.pn, C.bool(drain))
-}
-func (l Link) Draining() bool {
-	return bool(C.pn_link_draining(l.pn))
-}
-
-// Wrappers for declarations in delivery.h
-
-type Delivery struct{ pn *C.pn_delivery_t }
-
-func (d Delivery) IsNil() bool { return d.pn == nil }
-func (d Delivery) Tag() DeliveryTag {
-	return DeliveryTag{C.pn_delivery_tag(d.pn)}
-}
-func (d Delivery) Link() Link {
-	return Link{C.pn_delivery_link(d.pn)}
-}
-func (d Delivery) Local() Disposition {
-	return Disposition{C.pn_delivery_local(d.pn)}
-}
-func (d Delivery) LocalState() uint64 {
-	return uint64(C.pn_delivery_local_state(d.pn))
-}
-func (d Delivery) Remote() Disposition {
-	return Disposition{C.pn_delivery_remote(d.pn)}
-}
-func (d Delivery) RemoteState() uint64 {
-	return uint64(C.pn_delivery_remote_state(d.pn))
-}
-func (d Delivery) Settled() bool {
-	return bool(C.pn_delivery_settled(d.pn))
-}
-func (d Delivery) Pending() uint {
-	return uint(C.pn_delivery_pending(d.pn))
-}
-func (d Delivery) Partial() bool {
-	return bool(C.pn_delivery_partial(d.pn))
-}
-func (d Delivery) Writable() bool {
-	return bool(C.pn_delivery_writable(d.pn))
-}
-func (d Delivery) Readable() bool {
-	return bool(C.pn_delivery_readable(d.pn))
-}
-func (d Delivery) Updated() bool {
-	return bool(C.pn_delivery_updated(d.pn))
-}
-func (d Delivery) Update(state uint64) {
-	C.pn_delivery_update(d.pn, C.uint64_t(state))
-}
-func (d Delivery) Clear() {
-	C.pn_delivery_clear(d.pn)
-}
-func (d Delivery) Current() bool {
-	return bool(C.pn_delivery_current(d.pn))
-}
-func (d Delivery) Settle() {
-	C.pn_delivery_settle(d.pn)
-}
-func (d Delivery) Dump() {
-	C.pn_delivery_dump(d.pn)
-}
-func (d Delivery) Buffered() bool {
-	return bool(C.pn_delivery_buffered(d.pn))
-}
-
-// Wrappers for declarations in disposition.h
-
-type Disposition struct{ pn *C.pn_disposition_t }
-
-func (d Disposition) IsNil() bool { return d.pn == nil }
-func (d Disposition) Type() uint64 {
-	return uint64(C.pn_disposition_type(d.pn))
-}
-func (d Disposition) Condition() Condition {
-	return Condition{C.pn_disposition_condition(d.pn)}
-}
-func (d Disposition) Data() Data {
-	return Data{C.pn_disposition_data(d.pn)}
-}
-func (d Disposition) SectionNumber() uint16 {
-	return uint16(C.pn_disposition_get_section_number(d.pn))
-}
-func (d Disposition) SetSectionNumber(section_number uint16) {
-	C.pn_disposition_set_section_number(d.pn, C.uint32_t(section_number))
-}
-func (d Disposition) SectionOffset() uint64 {
-	return uint64(C.pn_disposition_get_section_offset(d.pn))
-}
-func (d Disposition) SetSectionOffset(section_offset uint64) {
-	C.pn_disposition_set_section_offset(d.pn, C.uint64_t(section_offset))
-}
-func (d Disposition) IsFailed() bool {
-	return bool(C.pn_disposition_is_failed(d.pn))
-}
-func (d Disposition) SetFailed(failed bool) {
-	C.pn_disposition_set_failed(d.pn, C.bool(failed))
-}
-func (d Disposition) IsUndeliverable() bool {
-	return bool(C.pn_disposition_is_undeliverable(d.pn))
-}
-func (d Disposition) SetUndeliverable(undeliverable bool) {
-	C.pn_disposition_set_undeliverable(d.pn, C.bool(undeliverable))
-}
-func (d Disposition) Annotations() Data {
-	return Data{C.pn_disposition_annotations(d.pn)}
-}
-
-// Wrappers for declarations in condition.h
-
-type Condition struct{ pn *C.pn_condition_t }
-
-func (c Condition) IsNil() bool { return c.pn == nil }
-func (c Condition) IsSet() bool {
-	return bool(C.pn_condition_is_set(c.pn))
-}
-func (c Condition) Clear() {
-	C.pn_condition_clear(c.pn)
-}
-func (c Condition) Name() string {
-	return C.GoString(C.pn_condition_get_name(c.pn))
-}
-func (c Condition) SetName(name string) int {
-	nameC := C.CString(name)
-	defer C.free(unsafe.Pointer(nameC))
-
-	return int(C.pn_condition_set_name(c.pn, nameC))
-}
-func (c Condition) Description() string {
-	return C.GoString(C.pn_condition_get_description(c.pn))
-}
-func (c Condition) SetDescription(description string) int {
-	descriptionC := C.CString(description)
-	defer C.free(unsafe.Pointer(descriptionC))
-
-	return int(C.pn_condition_set_description(c.pn, descriptionC))
-}
-func (c Condition) Info() Data {
-	return Data{C.pn_condition_info(c.pn)}
-}
-func (c Condition) IsRedirect() bool {
-	return bool(C.pn_condition_is_redirect(c.pn))
-}
-func (c Condition) RedirectHost() string {
-	return C.GoString(C.pn_condition_redirect_host(c.pn))
-}
-func (c Condition) RedirectPort() int {
-	return int(C.pn_condition_redirect_port(c.pn))
-}
-
-// Wrappers for declarations in terminus.h
-
-type TerminusType C.pn_terminus_type_t
-
-const (
-	PnUnspecified TerminusType = C.PN_UNSPECIFIED
-	PnSource      TerminusType = C.PN_SOURCE
-	PnTarget      TerminusType = C.PN_TARGET
-	PnCoordinator TerminusType = C.PN_COORDINATOR
-)
-
-func (e TerminusType) String() string {
-	switch e {
-
-	case C.PN_UNSPECIFIED:
-		return "Unspecified"
-	case C.PN_SOURCE:
-		return "Source"
-	case C.PN_TARGET:
-		return "Target"
-	case C.PN_COORDINATOR:
-		return "Coordinator"
-	}
-	return "unknown"
-}
-
-type Durability C.pn_durability_t
-
-const (
-	PnNondurable    Durability = C.PN_NONDURABLE
-	PnConfiguration Durability = C.PN_CONFIGURATION
-	PnDeliveries    Durability = C.PN_DELIVERIES
-)
-
-func (e Durability) String() string {
-	switch e {
-
-	case C.PN_NONDURABLE:
-		return "Nondurable"
-	case C.PN_CONFIGURATION:
-		return "Configuration"
-	case C.PN_DELIVERIES:
-		return "Deliveries"
-	}
-	return "unknown"
-}
-
-type ExpiryPolicy C.pn_expiry_policy_t
-
-const (
-	PnExpireWithLink       ExpiryPolicy = C.PN_EXPIRE_WITH_LINK
-	PnExpireWithSession    ExpiryPolicy = C.PN_EXPIRE_WITH_SESSION
-	PnExpireWithConnection ExpiryPolicy = C.PN_EXPIRE_WITH_CONNECTION
-	PnExpireNever          ExpiryPolicy = C.PN_EXPIRE_NEVER
-)
-
-func (e ExpiryPolicy) String() string {
-	switch e {
-
-	case C.PN_EXPIRE_WITH_LINK:
-		return "ExpireWithLink"
-	case C.PN_EXPIRE_WITH_SESSION:
-		return "ExpireWithSession"
-	case C.PN_EXPIRE_WITH_CONNECTION:
-		return "ExpireWithConnection"
-	case C.PN_EXPIRE_NEVER:
-		return "ExpireNever"
-	}
-	return "unknown"
-}
-
-type DistributionMode C.pn_distribution_mode_t
-
-const (
-	PnDistModeUnspecified DistributionMode = C.PN_DIST_MODE_UNSPECIFIED
-	PnDistModeCopy        DistributionMode = C.PN_DIST_MODE_COPY
-	PnDistModeMove        DistributionMode = C.PN_DIST_MODE_MOVE
-)
-
-func (e DistributionMode) String() string {
-	switch e {
-
-	case C.PN_DIST_MODE_UNSPECIFIED:
-		return "DistModeUnspecified"
-	case C.PN_DIST_MODE_COPY:
-		return "DistModeCopy"
-	case C.PN_DIST_MODE_MOVE:
-		return "DistModeMove"
-	}
-	return "unknown"
-}
-
-type Terminus struct{ pn *C.pn_terminus_t }
-
-func (t Terminus) IsNil() bool { return t.pn == nil }
-func (t Terminus) Type() TerminusType {
-	return TerminusType(C.pn_terminus_get_type(t.pn))
-}
-func (t Terminus) SetType(type_ TerminusType) int {
-	return int(C.pn_terminus_set_type(t.pn, C.pn_terminus_type_t(type_)))
-}
-func (t Terminus) Address() string {
-	return C.GoString(C.pn_terminus_get_address(t.pn))
-}
-func (t Terminus) SetAddress(address string) int {
-	addressC := C.CString(address)
-	defer C.free(unsafe.Pointer(addressC))
-
-	return int(C.pn_terminus_set_address(t.pn, addressC))
-}
-func (t Terminus) SetDistributionMode(mode DistributionMode) int {
-	return int(C.pn_terminus_set_distribution_mode(t.pn, C.pn_distribution_mode_t(mode)))
-}
-func (t Terminus) Durability() Durability {
-	return Durability(C.pn_terminus_get_durability(t.pn))
-}
-func (t Terminus) SetDurability(durability Durability) int {
-	return int(C.pn_terminus_set_durability(t.pn, C.pn_durability_t(durability)))
-}
-func (t Terminus) ExpiryPolicy() ExpiryPolicy {
-	return ExpiryPolicy(C.pn_terminus_get_expiry_policy(t.pn))
-}
-func (t Terminus) SetExpiryPolicy(policy ExpiryPolicy) int {
-	return int(C.pn_terminus_set_expiry_policy(t.pn, C.pn_expiry_policy_t(policy)))
-}
-func (t Terminus) Timeout() time.Duration {
-	return (time.Duration(C.pn_terminus_get_timeout(t.pn)) * time.Second)
-}
-func (t Terminus) SetTimeout(timeout time.Duration) int {
-	return int(C.pn_terminus_set_timeout(t.pn, C.pn_seconds_t(timeout)))
-}
-func (t Terminus) IsDynamic() bool {
-	return bool(C.pn_terminus_is_dynamic(t.pn))
-}
-func (t Terminus) SetDynamic(dynamic bool) int {
-	return int(C.pn_terminus_set_dynamic(t.pn, C.bool(dynamic)))
-}
-func (t Terminus) Properties() Data {
-	return Data{C.pn_terminus_properties(t.pn)}
-}
-func (t Terminus) Capabilities() Data {
-	return Data{C.pn_terminus_capabilities(t.pn)}
-}
-func (t Terminus) Outcomes() Data {
-	return Data{C.pn_terminus_outcomes(t.pn)}
-}
-func (t Terminus) Filter() Data {
-	return Data{C.pn_terminus_filter(t.pn)}
-}
-func (t Terminus) Copy(src Terminus) int {
-	return int(C.pn_terminus_copy(t.pn, src.pn))
-}
-
-// Wrappers for declarations in connection.h
-
-type Connection struct{ pn *C.pn_connection_t }
-
-func (c Connection) IsNil() bool { return c.pn == nil }
-func (c Connection) Free() {
-	C.pn_connection_free(c.pn)
-}
-func (c Connection) Release() {
-	C.pn_connection_release(c.pn)
-}
-func (c Connection) Error() error {
-	return internal.PnError(unsafe.Pointer(C.pn_connection_error(c.pn)))
-}
-func (c Connection) State() State {
-	return State(C.pn_connection_state(c.pn))
-}
-func (c Connection) Open() {
-	C.pn_connection_open(c.pn)
-}
-func (c Connection) Close() {
-	C.pn_connection_close(c.pn)
-}
-func (c Connection) Reset() {
-	C.pn_connection_reset(c.pn)
-}
-func (c Connection) Condition() Condition {
-	return Condition{C.pn_connection_condition(c.pn)}
-}
-func (c Connection) RemoteCondition() Condition {
-	return Condition{C.pn_connection_remote_condition(c.pn)}
-}
-func (c Connection) Container() string {
-	return C.GoString(C.pn_connection_get_container(c.pn))
-}
-func (c Connection) SetContainer(container string) {
-	containerC := C.CString(container)
-	defer C.free(unsafe.Pointer(containerC))
-
-	C.pn_connection_set_container(c.pn, containerC)
-}
-func (c Connection) SetUser(user string) {
-	userC := C.CString(user)
-	defer C.free(unsafe.Pointer(userC))
-
-	C.pn_connection_set_user(c.pn, userC)
-}
-func (c Connection) SetPassword(password string) {
-	passwordC := C.CString(password)
-	defer C.free(unsafe.Pointer(passwordC))
-
-	C.pn_connection_set_password(c.pn, passwordC)
-}
-func (c Connection) User() string {
-	return C.GoString(C.pn_connection_get_user(c.pn))
-}
-func (c Connection) Hostname() string {
-	return C.GoString(C.pn_connection_get_hostname(c.pn))
-}
-func (c Connection) SetHostname(hostname string) {
-	hostnameC := C.CString(hostname)
-	defer C.free(unsafe.Pointer(hostnameC))
-
-	C.pn_connection_set_hostname(c.pn, hostnameC)
-}
-func (c Connection) RemoteContainer() string {
-	return C.GoString(C.pn_connection_remote_container(c.pn))
-}
-func (c Connection) RemoteHostname() string {
-	return C.GoString(C.pn_connection_remote_hostname(c.pn))
-}
-func (c Connection) OfferedCapabilities() Data {
-	return Data{C.pn_connection_offered_capabilities(c.pn)}
-}
-func (c Connection) DesiredCapabilities() Data {
-	return Data{C.pn_connection_desired_capabilities(c.pn)}
-}
-func (c Connection) Properties() Data {
-	return Data{C.pn_connection_properties(c.pn)}
-}
-func (c Connection) RemoteOfferedCapabilities() Data {
-	return Data{C.pn_connection_remote_offered_capabilities(c.pn)}
-}
-func (c Connection) RemoteDesiredCapabilities() Data {
-	return Data{C.pn_connection_remote_desired_capabilities(c.pn)}
-}
-func (c Connection) RemoteProperties() Data {
-	return Data{C.pn_connection_remote_properties(c.pn)}
-}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/132820cb/proton-c/bindings/go/src/qpid.apache.org/proton/internal/error.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/internal/error.go b/proton-c/bindings/go/src/qpid.apache.org/proton/internal/error.go
deleted file mode 100644
index 01ba890..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/internal/error.go
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Internal implementation details - ignore.
-package internal
-
-// #cgo LDFLAGS: -lqpid-proton
-// #include <proton/error.h>
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"fmt"
-	"runtime"
-	"sync"
-	"sync/atomic"
-	"unsafe"
-)
-
-// Error type for all proton errors.
-type Error string
-
-// Error prefixes error message with proton:
-func (e Error) Error() string {
-	return "proton: " + string(e)
-}
-
-// Errorf creates an Error with a formatted message
-func Errorf(format string, a ...interface{}) Error {
-	return Error(fmt.Sprintf(format, a...))
-}
-
-type PnErrorCode int
-
-func (e PnErrorCode) String() string {
-	switch e {
-	case C.PN_EOS:
-		return "end-of-data"
-	case C.PN_ERR:
-		return "error"
-	case C.PN_OVERFLOW:
-		return "overflow"
-	case C.PN_UNDERFLOW:
-		return "underflow"
-	case C.PN_STATE_ERR:
-		return "bad-state"
-	case C.PN_ARG_ERR:
-		return "invalid-argument"
-	case C.PN_TIMEOUT:
-		return "timeout"
-	case C.PN_INTR:
-		return "interrupted"
-	case C.PN_INPROGRESS:
-		return "in-progress"
-	default:
-		return fmt.Sprintf("unknown-error(%d)", e)
-	}
-}
-
-func PnError(p unsafe.Pointer) error {
-	e := (*C.pn_error_t)(p)
-	if e == nil || C.pn_error_code(e) == 0 {
-		return nil
-	}
-	return Errorf("%s: %s", PnErrorCode(C.pn_error_code(e)), C.GoString(C.pn_error_text(e)))
-}
-
-// DoRecover is called to recover from internal panics
-func DoRecover(err *error) {
-	r := recover()
-	switch r := r.(type) {
-	case nil: // We are not recovering
-		return
-	case runtime.Error: // Don't catch runtime.Error
-		panic(r)
-	case error:
-		*err = r
-	default:
-		panic(r)
-	}
-}
-
-// panicIf panics if condition is true, the panic value is Errorf(fmt, args...)
-func panicIf(condition bool, fmt string, args ...interface{}) {
-	if condition {
-		panic(Errorf(fmt, args...))
-	}
-}
-
-// FirstError is a goroutine-safe error holder that keeps the first error that is set.
-type FirstError struct {
-	err  atomic.Value
-	once sync.Once
-}
-
-// Set the error if not allread set.
-func (e *FirstError) Set(err error) {
-	e.once.Do(func() { e.err.Store(err) })
-}
-
-// Get the error.
-func (e *FirstError) Get() error {
-	v := e.err.Load()
-	if v != nil {
-		return v.(error)
-	} else {
-		return nil
-	}
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[20/24] qpid-proton git commit: Merge pull request #1 from kgiusti/PROTON-885-flaper87

Posted by ac...@apache.org.
Merge pull request #1 from kgiusti/PROTON-885-flaper87

PROTON-885: update the top-level license file

Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/786ba2ad
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/786ba2ad
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/786ba2ad

Branch: refs/heads/go1
Commit: 786ba2ad36d9e88eb1ca68d84d2b0634fd23d54f
Parents: 2e2ba9c 59afc55
Author: Flavio Percoco Premoli <fl...@gmail.com>
Authored: Tue May 19 22:09:06 2015 +0200
Committer: Flavio Percoco Premoli <fl...@gmail.com>
Committed: Tue May 19 22:09:06 2015 +0200

----------------------------------------------------------------------
 LICENSE | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org