Skip to content

Commit

Permalink
Export MessageToAddresses
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Feb 3, 2024
1 parent 8c84738 commit 27e217b
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 @@ -463,15 +463,15 @@ func (c *Client) lookupToExchange(ctx context.Context, transport Transport, name
if err != nil {
return nil, err
}
return messageToAddresses(response)
return MessageToAddresses(response)
}

func (c *Client) questionCache(question dns.Question, transport Transport) ([]netip.Addr, error) {
response, _ := c.loadResponse(question, transport)
if response == nil {
return nil, ErrNotCached
}
return messageToAddresses(response)
return MessageToAddresses(response)
}

func (c *Client) loadResponse(question dns.Question, transport Transport) (*dns.Msg, int) {
Expand Down Expand Up @@ -548,7 +548,7 @@ func (c *Client) loadResponse(question dns.Question, transport Transport) (*dns.
}
}

func messageToAddresses(response *dns.Msg) ([]netip.Addr, error) {
func MessageToAddresses(response *dns.Msg) ([]netip.Addr, error) {
if response.Rcode != dns.RcodeSuccess {
return nil, RCodeError(response.Rcode)
}
Expand Down

0 comments on commit 27e217b

Please sign in to comment.