Skip to content

Commit

Permalink
Merge pull request #19 from stapelberg/connection
Browse files Browse the repository at this point in the history
Export the connection interface
  • Loading branch information
d2g authored Jun 2, 2018
2 parents b5d32eb + e338061 commit 30bb0ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ type Client struct {
ignoreServers []net.IP //List of Servers to Ignore requests from.
timeout time.Duration //Time before we timeout.
broadcast bool //Set the Bcast flag in BOOTP Flags
connection connection //The Connection Method to use
connection ConnectionInt //The Connection Method to use
generateXID func([]byte) //Function Used to Generate a XID
}

//Abstracts the type of underlying socket used
type connection interface {
type ConnectionInt interface {
Close() error
Write(packet []byte) error
ReadFrom() ([]byte, net.IP, error)
Expand Down Expand Up @@ -90,7 +90,7 @@ func Broadcast(b bool) func(*Client) error {
}
}

func Connection(conn connection) func(*Client) error {
func Connection(conn ConnectionInt) func(*Client) error {
return func(c *Client) error {
c.connection = conn
return nil
Expand Down

0 comments on commit 30bb0ed

Please sign in to comment.