qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject qpid-proton git commit: NO-JIRA: go: minor renaming, fields holding proton.X types named pX not eX
Date Mon, 11 Jan 2016 22:15:17 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 6f189609d -> 576f656be


NO-JIRA: go: minor renaming, fields holding proton.X types named pX not eX


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

Branch: refs/heads/master
Commit: 576f656be743aa9fc155ece0ff7547b55141c5ca
Parents: 6f18960
Author: Alan Conway <aconway@redhat.com>
Authored: Thu Jan 7 17:47:15 2016 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Mon Jan 11 17:14:35 2016 -0500

----------------------------------------------------------------------
 .../src/qpid.apache.org/electron/connection.go  | 18 ++++----
 .../go/src/qpid.apache.org/electron/link.go     | 44 ++++++++++----------
 .../go/src/qpid.apache.org/electron/receiver.go | 28 ++++++-------
 .../go/src/qpid.apache.org/electron/sender.go   | 12 +++---
 .../go/src/qpid.apache.org/electron/session.go  | 14 +++----
 5 files changed, 58 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/576f656b/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go b/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go
index 1f8bd40..96feb1f 100644
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go
+++ b/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go
@@ -104,7 +104,7 @@ type connection struct {
 	incoming    chan Incoming
 	handler     *handler
 	engine      *proton.Engine
-	eConnection proton.Connection
+	pConnection proton.Connection
 
 	defaultSession Session
 }
@@ -121,7 +121,7 @@ func newConnection(conn net.Conn, cont *container, setting ...ConnectionOption)
 		set(c)
 	}
 	c.endpoint.init(c.engine.String())
-	c.eConnection = c.engine.Connection()
+	c.pConnection = c.engine.Connection()
 	go c.run()
 	return c, nil
 }
@@ -150,11 +150,11 @@ func (c *connection) Session(setting ...SessionOption) (Session, error)
{
 		if c.Error() != nil {
 			return c.Error()
 		}
-		eSession, err := c.engine.Connection().Session()
+		pSession, err := c.engine.Connection().Session()
 		if err == nil {
-			eSession.Open()
+			pSession.Open()
 			if err == nil {
-				s = newSession(c, eSession, setting...)
+				s = newSession(c, pSession, setting...)
 			}
 		}
 		return err
@@ -218,21 +218,21 @@ type Incoming interface {
 }
 
 type incoming struct {
-	endpoint proton.Endpoint
+	pep      proton.Endpoint
 	acceptCh chan func() error
 }
 
 func makeIncoming(e proton.Endpoint) incoming {
-	return incoming{endpoint: e, acceptCh: make(chan func() error)}
+	return incoming{pep: e, acceptCh: make(chan func() error)}
 }
 
-func (in *incoming) String() string   { return fmt.Sprintf("%s: %s", in.endpoint.Type(),
in.endpoint) }
+func (in *incoming) String() string   { return fmt.Sprintf("%s: %s", in.pep.Type(), in.pep)
}
 func (in *incoming) Reject(err error) { in.acceptCh <- func() error { return err } }
 
 // Call in proton goroutine, wait for and call the accept function fr
 func (in *incoming) wait() error { return (<-in.acceptCh)() }
 
-func (in *incoming) pEndpoint() proton.Endpoint { return in.endpoint }
+func (in *incoming) pEndpoint() proton.Endpoint { return in.pep }
 
 // Called in app goroutine to send an accept function to proton and return the resulting
endpoint.
 func (in *incoming) accept(f func() Endpoint) Endpoint {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/576f656b/proton-c/bindings/go/src/qpid.apache.org/electron/link.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/link.go b/proton-c/bindings/go/src/qpid.apache.org/electron/link.go
index 80b4d5c..5d78a14 100644
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/link.go
+++ b/proton-c/bindings/go/src/qpid.apache.org/electron/link.go
@@ -131,7 +131,7 @@ type linkSettings struct {
 	capacity  int
 	prefetch  bool
 	session   *session
-	eLink     proton.Link
+	pLink     proton.Link
 }
 
 type link struct {
@@ -167,42 +167,42 @@ func makeLocalLink(sn *session, isSender bool, setting ...LinkOption)
(linkSetti
 		l.linkName = l.session.connection.container.nextLinkName()
 	}
 	if l.IsSender() {
-		l.eLink = l.session.eSession.Sender(l.linkName)
+		l.pLink = l.session.pSession.Sender(l.linkName)
 	} else {
-		l.eLink = l.session.eSession.Receiver(l.linkName)
+		l.pLink = l.session.pSession.Receiver(l.linkName)
 	}
-	if l.eLink.IsNil() {
-		return l, fmt.Errorf("cannot create link %s", l.eLink)
+	if l.pLink.IsNil() {
+		return l, fmt.Errorf("cannot create link %s", l.pLink)
 	}
-	l.eLink.Source().SetAddress(l.source)
-	l.eLink.Target().SetAddress(l.target)
-	l.eLink.SetSndSettleMode(proton.SndSettleMode(l.sndSettle))
-	l.eLink.SetRcvSettleMode(proton.RcvSettleMode(l.rcvSettle))
-	l.eLink.Open()
+	l.pLink.Source().SetAddress(l.source)
+	l.pLink.Target().SetAddress(l.target)
+	l.pLink.SetSndSettleMode(proton.SndSettleMode(l.sndSettle))
+	l.pLink.SetRcvSettleMode(proton.RcvSettleMode(l.rcvSettle))
+	l.pLink.Open()
 	return l, nil
 }
 
 type incomingLink struct {
 	incoming
 	linkSettings
-	eLink proton.Link
+	pLink proton.Link
 	sn    *session
 }
 
 // Set up a link from an incoming proton.Link.
-func makeIncomingLink(sn *session, eLink proton.Link) incomingLink {
+func makeIncomingLink(sn *session, pLink proton.Link) incomingLink {
 	l := incomingLink{
-		incoming: makeIncoming(eLink),
+		incoming: makeIncoming(pLink),
 		linkSettings: linkSettings{
-			isSender:  eLink.IsSender(),
-			source:    eLink.RemoteSource().Address(),
-			target:    eLink.RemoteTarget().Address(),
-			linkName:  eLink.Name(),
-			sndSettle: SndSettleMode(eLink.RemoteSndSettleMode()),
-			rcvSettle: RcvSettleMode(eLink.RemoteRcvSettleMode()),
+			isSender:  pLink.IsSender(),
+			source:    pLink.RemoteSource().Address(),
+			target:    pLink.RemoteTarget().Address(),
+			linkName:  pLink.Name(),
+			sndSettle: SndSettleMode(pLink.RemoteSndSettleMode()),
+			rcvSettle: RcvSettleMode(pLink.RemoteRcvSettleMode()),
 			capacity:  1,
 			prefetch:  false,
-			eLink:     eLink,
+			pLink:     pLink,
 			session:   sn,
 		},
 	}
@@ -215,7 +215,7 @@ func (l *link) Credit() (credit int, err error) {
 		if l.Error() != nil {
 			return l.Error()
 		}
-		credit = l.eLink.Credit()
+		credit = l.pLink.Credit()
 		return nil
 	})
 	return
@@ -227,7 +227,7 @@ func (l *link) Capacity() int { return l.capacity }
 func (l *link) Close(err error) {
 	l.engine().Inject(func() {
 		if l.Error() == nil {
-			localClose(l.eLink, err)
+			localClose(l.pLink, err)
 		}
 	})
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/576f656b/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go b/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go
index f2b7a52..3259eaa 100644
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go
+++ b/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go
@@ -78,13 +78,13 @@ func (r *receiver) Prefetch() bool { return r.prefetch }
 // Call in proton goroutine
 func newReceiver(ls linkSettings) *receiver {
 	r := &receiver{link: link{linkSettings: ls}}
-	r.endpoint.init(r.link.eLink.String())
+	r.endpoint.init(r.link.pLink.String())
 	if r.capacity < 1 {
 		r.capacity = 1
 	}
 	r.buffer = make(chan ReceivedMessage, r.capacity)
-	r.handler().addLink(r.eLink, r)
-	r.link.eLink.Open()
+	r.handler().addLink(r.pLink, r)
+	r.link.pLink.Open()
 	if r.prefetch {
 		r.flow(r.maxFlow())
 	}
@@ -92,11 +92,11 @@ func newReceiver(ls linkSettings) *receiver {
 }
 
 // Call in proton gorotine. Max additional credit we can request.
-func (r *receiver) maxFlow() int { return cap(r.buffer) - len(r.buffer) - r.eLink.Credit()
}
+func (r *receiver) maxFlow() int { return cap(r.buffer) - len(r.buffer) - r.pLink.Credit()
}
 
 func (r *receiver) flow(credit int) {
 	if credit > 0 {
-		r.eLink.Flow(credit)
+		r.pLink.Flow(credit)
 	}
 }
 
@@ -105,7 +105,7 @@ func (r *receiver) flow(credit int) {
 func (r *receiver) caller(inc int) {
 	r.engine().Inject(func() {
 		r.callers += inc
-		need := r.callers - (len(r.buffer) + r.eLink.Credit())
+		need := r.callers - (len(r.buffer) + r.pLink.Credit())
 		max := r.maxFlow()
 		if need > max {
 			need = max
@@ -152,20 +152,20 @@ func (r *receiver) ReceiveTimeout(timeout time.Duration) (ReceivedMessage,
error
 
 // Called in proton goroutine on MMessage event.
 func (r *receiver) message(delivery proton.Delivery) {
-	if r.eLink.State().RemoteClosed() {
-		localClose(r.eLink, r.eLink.RemoteCondition().Error())
+	if r.pLink.State().RemoteClosed() {
+		localClose(r.pLink, r.pLink.RemoteCondition().Error())
 		return
 	}
 	if delivery.HasMessage() {
 		m, err := delivery.Message()
 		if err != nil {
-			localClose(r.eLink, err)
+			localClose(r.pLink, err)
 			return
 		}
 		assert(m != nil)
-		r.eLink.Advance()
-		if r.eLink.Credit() < 0 {
-			localClose(r.eLink, fmt.Errorf("received message in excess of credit limit"))
+		r.pLink.Advance()
+		if r.pLink.Credit() < 0 {
+			localClose(r.pLink, fmt.Errorf("received message in excess of credit limit"))
 		} else {
 			// We never issue more credit than cap(buffer) so this will not block.
 			r.buffer <- ReceivedMessage{m, delivery, r}
@@ -185,7 +185,7 @@ type ReceivedMessage struct {
 	// Message is the received message.
 	Message amqp.Message
 
-	eDelivery proton.Delivery
+	pDelivery proton.Delivery
 	receiver  Receiver
 }
 
@@ -193,7 +193,7 @@ type ReceivedMessage struct {
 func (rm *ReceivedMessage) acknowledge(status uint64) error {
 	return rm.receiver.(*receiver).engine().Inject(func() {
 		// Deliveries are valid as long as the connection is, unless settled.
-		rm.eDelivery.SettleAs(uint64(status))
+		rm.pDelivery.SettleAs(uint64(status))
 	})
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/576f656b/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go b/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go
index 2f0e965..1d0fc60 100644
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go
+++ b/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go
@@ -164,7 +164,7 @@ func (s *sender) SendAsyncTimeout(m amqp.Message, ack chan<- Outcome,
v interfac
 			return
 		}
 
-		delivery, err2 := s.eLink.Send(m)
+		delivery, err2 := s.pLink.Send(m)
 		switch {
 		case err2 != nil:
 			Outcome{Unsent, err2, v}.send(ack)
@@ -176,7 +176,7 @@ func (s *sender) SendAsyncTimeout(m amqp.Message, ack chan<- Outcome,
v interfac
 		default:
 			s.handler().sentMessages[delivery] = sentMessage{ack, v} // Register with handler
 		}
-		if s.eLink.Credit() > 0 { // Signal there is still credit
+		if s.pLink.Credit() > 0 { // Signal there is still credit
 			s.sendable()
 		}
 	})
@@ -244,9 +244,9 @@ func (s *sender) closed(err error) error {
 
 func newSender(ls linkSettings) *sender {
 	s := &sender{link: link{linkSettings: ls}, credit: make(chan struct{}, 1)}
-	s.endpoint.init(s.link.eLink.String())
-	s.handler().addLink(s.eLink, s)
-	s.link.eLink.Open()
+	s.endpoint.init(s.link.pLink.String())
+	s.handler().addLink(s.pLink, s)
+	s.link.pLink.Open()
 	return s
 }
 
@@ -269,6 +269,6 @@ func (in *IncomingSender) Accept() Endpoint {
 
 // Call in injected functions to check if the sender is valid.
 func (s *sender) valid() bool {
-	s2, ok := s.handler().links[s.eLink].(*sender)
+	s2, ok := s.handler().links[s.pLink].(*sender)
 	return ok && s2 == s
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/576f656b/proton-c/bindings/go/src/qpid.apache.org/electron/session.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/session.go b/proton-c/bindings/go/src/qpid.apache.org/electron/session.go
index 1bbc52c..4b663aa 100644
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/session.go
+++ b/proton-c/bindings/go/src/qpid.apache.org/electron/session.go
@@ -36,7 +36,7 @@ type Session interface {
 
 type session struct {
 	endpoint
-	eSession   proton.Session
+	pSession   proton.Session
 	connection *connection
 	capacity   uint
 }
@@ -52,26 +52,26 @@ func IncomingCapacity(cap uint) SessionOption { return func(s *session)
{ s.capa
 func newSession(c *connection, es proton.Session, setting ...SessionOption) *session {
 	s := &session{
 		connection: c,
-		eSession:   es,
+		pSession:   es,
 	}
 	s.endpoint.init(es.String())
 	for _, set := range setting {
 		set(s)
 	}
-	c.handler.sessions[s.eSession] = s
-	s.eSession.SetIncomingCapacity(s.capacity)
-	s.eSession.Open()
+	c.handler.sessions[s.pSession] = s
+	s.pSession.SetIncomingCapacity(s.capacity)
+	s.pSession.Open()
 	return s
 }
 
 func (s *session) Connection() Connection     { return s.connection }
-func (s *session) eEndpoint() proton.Endpoint { return s.eSession }
+func (s *session) pEndpoint() proton.Endpoint { return s.pSession }
 func (s *session) engine() *proton.Engine     { return s.connection.engine }
 
 func (s *session) Close(err error) {
 	s.engine().Inject(func() {
 		if s.Error() == nil {
-			localClose(s.eSession, err)
+			localClose(s.pSession, err)
 		}
 	})
 }


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


Mime
View raw message