Adding accounts lookup API endpoint
This commit is contained in:
parent
9faaa4f0dc
commit
39aa7c8e83
2 changed files with 45 additions and 0 deletions
11
accounts.go
11
accounts.go
|
@ -70,6 +70,17 @@ func (c *Client) GetAccountCurrentUser(ctx context.Context) (*Account, error) {
|
|||
return &account, nil
|
||||
}
|
||||
|
||||
func (c *Client) AccountLookup(ctx context.Context, acct string) (*Account, error) {
|
||||
var account Account
|
||||
params := url.Values{}
|
||||
params.Set("acct", acct)
|
||||
err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/lookup", params, &account, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &account, nil
|
||||
}
|
||||
|
||||
// Profile is a struct for updating profiles.
|
||||
type Profile struct {
|
||||
// If it is nil it will not be updated.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue