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