http_get.go 441 字节
Newer Older
Y
yangrui07 已提交
1 2 3 4 5
//-*- coding:utf-8; indent-tabs-mode:nil; -*-
package agent

import (
	"encoding/json"
Y
yangrui07 已提交
6
	"fmt"
Y
yangrui07 已提交
7 8 9 10
)

func initGetHandlers() {
	getHandler = map[string]handlerFunc{
Y
yangrui07 已提交
11
		"/agent/status": GetStatus,
Y
yangrui07 已提交
12 13 14 15
	}
}

func GetStatus(subpath string, m map[string]string, b []byte) (string, string, error) {
Y
yangrui07 已提交
16
	b, err := json.Marshal(BUILTIN_STATUS)
Y
yangrui07 已提交
17 18
	if err != nil {
		return quote(""), "", fmt.Errorf("json marshal failed, %v", err)
Y
yangrui07 已提交
19
	}
Y
yangrui07 已提交
20 21

	return string(b), "", err
Y
yangrui07 已提交
22
}