func (cons *TrailDBConstructor) GetOpt(key int, value int) (int, error) { var opt_value *C.tdb_opt_value err := C.tdb_cons_set_opt(cons.cons, C.tdb_opt_key(key), *opt_value) if err != 0 { return -1, errors.New(errToString(err)) } buf := (*C.uint64_t)(unsafe.Pointer(opt_value)) return int(*buf), nil }
func (cons *TrailDBConstructor) SetOpt(key int, value int) error { var buf []byte binary.BigEndian.PutUint64(buf, uint64(value)) opt_value := *make_tdb_opt_value(buf) err := C.tdb_cons_set_opt(cons.cons, C.tdb_opt_key(key), opt_value) if err != 0 { return errors.New(errToString(err)) } return nil }