vendor/github.com/McKael/madon/v2/madon.go
changeset 265 05c40b36d3b2
parent 264 8f478162d991
child 266 80973a656b81
equal deleted inserted replaced
264:8f478162d991 265:05c40b36d3b2
     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 = "2.4.0"
       
    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 )