Taru Karttunen
unread,Apr 2, 2013, 2:20:47 AM4/2/13Sign 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 Brad Fitzpatrick, Anthony Martin, golang-dev, golang-nuts
On 01.04 16:24, Brad Fitzpatrick wrote:
> [+golang-dev]
>
> Opinions wanted. See below.
I would like to advocate having dialing with options not marked as
API stable and have it experimental for Go 1.1. Is this possible
from the API perspective? This would give time to find an API
that works for various concerns.
I do advocate a struct if this is not possible.
Additionally with the struct one could do e.g:
package tor
type Dialer struct {
net.Dialer
NoConnectionReuse bool
}
func (d *Dialer)Dial(network string, addr string) (net.Conn, error) {
...
}
Also various defaults can be supported:
var mydialerA = &Dialer{ ... }
var mydialerB = &Dialer{ ... }
tls:
package tls
type Dialer struct {
net.Dialer
Options
}
func (*Dialer)Dial ...
Marshalling & serializing? Of course. Low level options from syscall?
package net
type Dialer struct {
...
Syscall *syscall.NetOptions
}
etc
Marshalling&Unmarshalling? No problem. Extending things? No problem
either. Passing to e.g. net/http? No problem with method expressions.
- Taru Karttunen