roger peppe
unread,Aug 22, 2012, 4:59:06 AM8/22/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Joel Reymont, golang-nuts
I always like to see more API interfaces, even if I won't use 'em!
My first impression is that there's a lot of stuff there and
no information as to how I might use it. For instance there are
quite a few types with no reference beyond their definition
(for example BondContractData).
I presume that quite a few of these are messages that
are sent or received from an Engine but there's no way
to tell that. References to the original API documentation
might be useful here, not to mention doc comments on everything.
The Engine type looks central. I would suggest that a channel-based
interface is not very usual. It would be more conventional
to have some methods on the Engine and use the channels internally
if need be (it looks like they're probably not necessary though).
For example:
func (e *Engine) WriteRequest(req Request) error
func (e *Engine) ReadReply() (Reply, error)
As a way to show what types are requests and replies,
you could define Request and Reply interfaces
which are satisfied by request and reply types respectively.
See the go/ast package for an example of this kind of thing.
cheers,
rog.