equal
deleted
inserted
replaced
|
1 /* |
|
2 Copyright 2017-2018 Mikael Berthe |
|
3 Copyright 2017 Ollivier Robert |
|
4 |
|
5 Licensed under the MIT license. Please see the LICENSE file is this directory. |
|
6 */ |
|
7 |
|
8 package madon |
|
9 |
|
10 import ( |
|
11 "github.com/pkg/errors" |
|
12 ) |
|
13 |
|
14 // LimitParams contains common limit/paging options for the Mastodon REST API |
|
15 type LimitParams struct { |
|
16 Limit int // Number of items per query |
|
17 SinceID, MaxID int64 // Boundaries |
|
18 All bool // Get as many items as possible |
|
19 } |
|
20 |
|
21 // apiCallParams is a map with the parameters for an API call |
|
22 type apiCallParams map[string]string |
|
23 |
|
24 const ( |
|
25 // MadonVersion contains the version of the Madon library |
|
26 MadonVersion = "3.0.0-dev" |
|
27 |
|
28 currentAPIPath = "/api" |
|
29 |
|
30 // NoRedirect is the URI for no redirection in the App registration |
|
31 NoRedirect = "urn:ietf:wg:oauth:2.0:oob" |
|
32 ) |
|
33 |
|
34 // Error codes |
|
35 var ( |
|
36 ErrUninitializedClient = errors.New("use of uninitialized madon client") |
|
37 ErrAlreadyRegistered = errors.New("app already registered") |
|
38 ErrEntityNotFound = errors.New("entity not found") |
|
39 ErrInvalidParameter = errors.New("incorrect parameter") |
|
40 ErrInvalidID = errors.New("incorrect entity ID") |
|
41 ) |