Files
llgo/rust/sled/sled.go
2024-07-09 09:30:10 +08:00

71 lines
2.4 KiB
Go

package sled
import "github.com/goplus/llgo/c"
// Write the .pc file for the dylib generated by the Rust library and copy it to pkg-config for proper location.
const (
LLGoPackage = "link: $(pkg-config --libs sled); -lsled"
)
type SledConfig struct {
Unused [8]byte
}
type SledDb struct {
Unused [8]byte
}
// Create a new configuration
// llgo:link CreateConfig C.sled_create_config
func CreateConfig() *SledConfig { return nil }
// Free a configuration
// llgo:link (*SledConfig).FreeConfig C.sled_free_config
func (conf *SledConfig) FreeConfig() {}
// Set the configured file path
// llgo:link (*SledConfig).SetPath C.sled_config_set_path
func (conf *SledConfig) SetPath(path *c.Char) *SledConfig { return nil }
// Set the configured cache capacity in bytes
// llgo:link (*SledConfig).SetCacheCapacity C.sled_config_set_cache_capacity
func (conf *SledConfig) SetCacheCapacity(capacity c.Ulong) *SledConfig { return nil }
// Configure the use of the zstd compression library
// llgo:link (*SledConfig).UseCompression C.sled_config_use_compression
func (conf *SledConfig) UseCompression(use_compression c.Char) *SledConfig { return nil }
// Set the configured IO buffer flush interval in milliseconds
// llgo:link (*SledConfig).SetFlushEveryMs C.sled_config_flush_every_ms
func (conf *SledConfig) SetFlushEveryMs(flush_every c.Int) *SledConfig { return nil }
// Open a sled lock-free log-structured tree
// llgo:link (*SledConfig).OpenDb C.sled_open_db
func (conf *SledConfig) OpenDb() *SledDb { return nil }
// Close a sled lock-free log-structured tree
// llgo:link (*SledDb).Close C.sled_close
func (db *SledDb) Close() {}
// Free a buffer originally allocated by sled
// llgo:link FreeBuf C.sled_free_buf
func FreeBuf(buf *c.Char, sz c.Ulong) {}
// Set a key to a value
// llgo:link (*SledDb).Set C.sled_set
func (db *SledDb) Set(key *c.Char, keylen c.Ulong, val *c.Char, vallen c.Ulong) {}
// Get the value of a key
// llgo:link (*SledDb).Get C.sled_get
func (db *SledDb) Get(key *c.Char, keylen c.Ulong, vallen *c.Ulong) *c.Char { return nil }
// Delete the value of a key
// llgo:link (*SledDb).Del C.sled_del
func (db *SledDb) Del(key *c.Char, keylen c.Ulong) {}
// Compare and swap
// llgo:link (*SledDb).CompareAndSwap C.sled_compare_and_swap
func (db *SledDb) CompareAndSwap(key *c.Char, keylen c.Ulong, old_val *c.Char, old_vallen c.Ulong, new_val *c.Char, new_vallen c.Ulong, actual_val **c.Char, actual_vallen *c.Ulong) c.Char {
return 0
}