add api and tool for query mxpassfiles, fixes
This commit is contained in:
parent
41fa795971
commit
8df08611a9
7 changed files with 95 additions and 20 deletions
|
|
@ -170,6 +170,20 @@ func cliv0_serverinfo(url *C.char) *C.char {
|
|||
return C.CString(result)
|
||||
}
|
||||
|
||||
//export cliv0_mxpassitem
|
||||
func cliv0_mxpassitem(mxpassfile_path *C.char, url *C.char, localpart *C.char, domain *C.char) *C.char {
|
||||
item, err := mxutils.GetMXPassItem(C.GoString(mxpassfile_path), C.GoString(url), C.GoString(localpart), C.GoString(domain))
|
||||
if err != nil {
|
||||
return C.CString(fmt.Sprintf("ERR: %v", err))
|
||||
}
|
||||
out, err := json.Marshal(item)
|
||||
if err != nil {
|
||||
return C.CString(fmt.Sprintf("ERR: %v", err))
|
||||
}
|
||||
s := string(out)
|
||||
return C.CString(s)
|
||||
}
|
||||
|
||||
/*
|
||||
high level api, supports multiple clients
|
||||
the same handler can be attached to multiple clients
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue