handle.go 503 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3 4 5 6
package discovery

import (
	"net/http"
)

Y
Your Name 已提交
7
//Handle 处理器
E
eoLinker API Management 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
func Handle(prefix string) http.Handler {

	serveMux := http.NewServeMux()
	serveMux.HandleFunc("/drivers", getDrivices)

	serveMux.HandleFunc("/add", add)
	serveMux.HandleFunc("/delete", delete)
	serveMux.HandleFunc("/save", edit)
	serveMux.HandleFunc("/info", getInfo)

	serveMux.HandleFunc("/simple", simple)
	serveMux.HandleFunc("/list", list)

	serveMux.HandleFunc("/default", setDefault)

	return http.StripPrefix(prefix, serveMux)

}