forked from ebhomengo/niki
1
0
Fork 0
niki/vendor/github.com/kavenegar/kavenegar-go/verify_lookup.go

26 lines
594 B
Go
Raw Normal View History

2024-08-29 03:26:59 +00:00
package kavenegar
import (
"net/url"
)
//Lookup ...
func (c *VerifyService) Lookup(receptor string, template string, token string, param *VerifyLookupParam) (Message, error) {
v := structToURLValues(param)
v.Set("receptor", receptor)
v.Set("template", template)
v.Set("token", token)
return c.CreateLookup(v)
}
//CreateLookup ..
func (c *VerifyService) CreateLookup(v url.Values) (Message, error) {
u := c.client.EndPoint("verify", "lookup")
m := new(MessageResult)
err := c.client.Execute(u.String(), v, m)
if m.Entries==nil{
return Message{},err
}
return m.Entries[0], err
}