2 * Copyright (C) 2019 "IoT.bzh"
3 * Author Sebastien Douheret <sebastien@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.
22 // AfbRequest Resquest field of a reply
23 type AfbRequest struct {
24 Status string `json:"status"`
25 Info string `json:"info"`
28 // AfbReply Reply structure of XDS Monitoring Daemon
29 type AfbReply struct {
30 JType string `json:"jtype"`
31 Request AfbRequest `json:"request"`
32 Response interface{} `json:"response"`
35 func NewAfbReply() *AfbReply {
39 func (r *AfbReply) Success() bool {
40 return r.Request.Status == "success"
43 func (r *AfbReply) Failure() bool {
47 func (r *AfbReply) GetError() error {
48 return fmt.Errorf(r.Request.Info)
51 func (r *AfbReply) GetInfo() string {