Skip to content

Instantly share code, notes, and snippets.

@anandkunal
Created September 17, 2014 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandkunal/eaff392b18a0ad376f0a to your computer and use it in GitHub Desktop.
Save anandkunal/eaff392b18a0ad376f0a to your computer and use it in GitHub Desktop.
type (
Client struct {
connection *rpc.Client
}
)
func NewClient(dsn string, timeout time.Duration) (*Client, error) {
connection, err := net.DialTimeout("tcp", dsn, timeout)
if err != nil {
return nil, err
}
return &Client{connection: rpc.NewClient(connection)}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment