Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,21 @@ func DefaultParams(service string) *QueryParam {
}
}

// Query looks up a given service, in a domain, waiting at most
// for a timeout before finishing the query. The results are streamed
// to a channel. Sends will not block, so clients should make sure to
// either read or buffer.
// Query looks up a given service, in a domain, waiting at most for
// a timeout before finishing the query. The results are sent to the
// params.Entries channel. If a result cannot be sent to params.Entries
// immediately, it will be discarded. A large buffer on the channel can
// ensure that no result is lost.
func Query(params *QueryParam) error {
return QueryContext(context.Background(), params)
}

// QueryContext looks up a given service, in a domain, waiting at most
// for a timeout before finishing the query. The results are streamed
// to a channel. Sends will not block, so clients should make sure to
// either read or buffer. QueryContext will attempt to stop the query
// on cancellation.
// for a timeout before finishing the query. The results are sent to the
// params.Entries channel. If a result cannot be sent to params.Entries
// immediately, it will be discarded. A large buffer on the channel can
// ensure that no result is lost. QueryContext will attempt to stop the
// query on cancellation.
func QueryContext(ctx context.Context, params *QueryParam) error {
if params.Logger == nil {
params.Logger = log.Default()
Expand Down