madon.go
changeset 138 23d3a518d0ad
parent 131 68ef6504637e
child 145 d7ccfe67fa9e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/madon.go	Wed Apr 19 10:43:38 2017 +0200
@@ -0,0 +1,36 @@
+/*
+Copyright 2017 Ollivier Robert
+Copyright 2017 Mikael Berthe
+
+Licensed under the MIT license.  Please see the LICENSE file is this directory.
+*/
+
+package madon
+
+import (
+	"errors"
+)
+
+// 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 = "0.2"
+
+	// API version implemented in this library
+	apiVersion     = "v1"
+	currentAPIPath = "/api/" + apiVersion
+
+	// 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")
+)