llgo/rust/sled:rename struct

This commit is contained in:
luoliwoshang
2024-07-09 09:39:44 +08:00
parent a2fd010521
commit 60f8fe6f41

View File

@@ -7,64 +7,64 @@ const (
LLGoPackage = "link: $(pkg-config --libs sled); -lsled"
)
type SledConfig struct {
type Config struct {
Unused [8]byte
}
type SledDb struct {
type DB struct {
Unused [8]byte
}
// Create a new configuration
// llgo:link CreateConfig C.sled_create_config
func CreateConfig() *SledConfig { return nil }
func CreateConfig() *Config { return nil }
// Free a configuration
// llgo:link (*SledConfig).FreeConfig C.sled_free_config
func (conf *SledConfig) FreeConfig() {}
// llgo:link (*Config).FreeConfig C.sled_free_config
func (conf *Config) 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 }
// llgo:link (*Config).SetPath C.sled_config_set_path
func (conf *Config) SetPath(path *c.Char) *Config { 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 }
// llgo:link (*Config).SetCacheCapacity C.sled_config_set_cache_capacity
func (conf *Config) SetCacheCapacity(capacity c.Ulong) *Config { 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 }
// llgo:link (*Config).UseCompression C.sled_config_use_compression
func (conf *Config) UseCompression(use_compression c.Char) *Config { 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 }
// llgo:link (*Config).SetFlushEveryMs C.sled_config_flush_every_ms
func (conf *Config) SetFlushEveryMs(flush_every c.Int) *Config { 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 }
// llgo:link (*Config).OpenDb C.sled_open_db
func (conf *Config) OpenDb() *DB { return nil }
// Close a sled lock-free log-structured tree
// llgo:link (*SledDb).Close C.sled_close
func (db *SledDb) Close() {}
// llgo:link (*DB).Close C.sled_close
func (db *DB) 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) {}
// llgo:link (*DB).Set C.sled_set
func (db *DB) 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 }
// llgo:link (*DB).Get C.sled_get
func (db *DB) 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) {}
// llgo:link (*DB).Del C.sled_del
func (db *DB) 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 {
// llgo:link (*DB).CompareAndSwap C.sled_compare_and_swap
func (db *DB) 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
}