2 * Copyright (C) 2016, 2017 "IoT.bzh"
3 * Author: José Bollo <jose.bollo@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 struct afb_binding_interface;
25 * A binding V2 MUST have an exported symbol of name
30 extern const struct afb_binding_v2 afbBindingV2;
33 * Description of one verb of the API provided by the binding
34 * This enumeration is valid for bindings of type version 2
38 const char *verb; /* name of the verb */
39 void (*callback)(struct afb_req req); /* callback function implementing the verb */
40 const char * const *permissions; /* required permissions */
41 enum afb_session_v1 session; /* authorisation and session requirements of the verb */
45 * Description of the bindings of type version 2
49 const char *api; /* api name for the binding */
50 const char *specification; /* textual specification of the binding */
51 const struct afb_verb_v2 *verbs; /* array of descriptions of verbs terminated by a NULL name */
52 int (*init)(const struct afb_binding_interface *interface);
53 int (*start)(const struct afb_binding_interface *interface, struct afb_service service);
54 void (*onevent)(const char *event, struct json_object *object);