WIP maatma domains interface

This commit is contained in:
nemunaire 2019-03-14 00:05:45 +01:00 committed by Pierre-Olivier Mercier
commit cd848e3ff6
2 changed files with 102 additions and 0 deletions

26
token-validator/domain.go Normal file
View file

@ -0,0 +1,26 @@
package main
import (
"github.com/julienschmidt/httprouter"
)
func init() {
router.GET("/api/ddomains/", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
return student.GetDelegatedDomains()
}))
router.GET("/api/ddomains/:dn", apiAuthHandler(func (student Student, ps httprouter.Params, body []byte) (interface{}, error) {
return student.GetDelegatedDomain(ps.ByName("dn"))
}))
}
type DelegatedDomain struct {
}
func (student Student) GetDelegatedDomain(dn string) (d DelegatedDomain, err error) {
return
}
func (student Student) GetDelegatedDomains() (ds []DelegatedDomain, err error) {
return
}