I will use cgo to wrap one c library as go library for the project usage. I read the document, it seems there are lots of rules while using cgo. I don't know whether this is legal or not.
Both LibCtx and Client is a struct in C. Is this a legal way to put C struct into a golang struct?
//DBClientLib.go
type DBClient struct {
Libctx C.LibCtx
LibClient C.Client
}
func (client DBClient) GetEntry(key string) interface{} {
//...
}