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" LLGoPackage = "link: $(pkg-config --libs sled); -lsled"
) )
type SledConfig struct { type Config struct {
Unused [8]byte Unused [8]byte
} }
type SledDb struct { type DB struct {
Unused [8]byte Unused [8]byte
} }
// Create a new configuration // Create a new configuration
// llgo:link CreateConfig C.sled_create_config // llgo:link CreateConfig C.sled_create_config
func CreateConfig() *SledConfig { return nil } func CreateConfig() *Config { return nil }
// Free a configuration // Free a configuration
// llgo:link (*SledConfig).FreeConfig C.sled_free_config // llgo:link (*Config).FreeConfig C.sled_free_config
func (conf *SledConfig) FreeConfig() {} func (conf *Config) FreeConfig() {}
// Set the configured file path // Set the configured file path
// llgo:link (*SledConfig).SetPath C.sled_config_set_path // llgo:link (*Config).SetPath C.sled_config_set_path
func (conf *SledConfig) SetPath(path *c.Char) *SledConfig { return nil } func (conf *Config) SetPath(path *c.Char) *Config { return nil }
// Set the configured cache capacity in bytes // Set the configured cache capacity in bytes
// llgo:link (*SledConfig).SetCacheCapacity C.sled_config_set_cache_capacity // llgo:link (*Config).SetCacheCapacity C.sled_config_set_cache_capacity
func (conf *SledConfig) SetCacheCapacity(capacity c.Ulong) *SledConfig { return nil } func (conf *Config) SetCacheCapacity(capacity c.Ulong) *Config { return nil }
// Configure the use of the zstd compression library // Configure the use of the zstd compression library
// llgo:link (*SledConfig).UseCompression C.sled_config_use_compression // llgo:link (*Config).UseCompression C.sled_config_use_compression
func (conf *SledConfig) UseCompression(use_compression c.Char) *SledConfig { return nil } func (conf *Config) UseCompression(use_compression c.Char) *Config { return nil }
// Set the configured IO buffer flush interval in milliseconds // Set the configured IO buffer flush interval in milliseconds
// llgo:link (*SledConfig).SetFlushEveryMs C.sled_config_flush_every_ms // llgo:link (*Config).SetFlushEveryMs C.sled_config_flush_every_ms
func (conf *SledConfig) SetFlushEveryMs(flush_every c.Int) *SledConfig { return nil } func (conf *Config) SetFlushEveryMs(flush_every c.Int) *Config { return nil }
// Open a sled lock-free log-structured tree // Open a sled lock-free log-structured tree
// llgo:link (*SledConfig).OpenDb C.sled_open_db // llgo:link (*Config).OpenDb C.sled_open_db
func (conf *SledConfig) OpenDb() *SledDb { return nil } func (conf *Config) OpenDb() *DB { return nil }
// Close a sled lock-free log-structured tree // Close a sled lock-free log-structured tree
// llgo:link (*SledDb).Close C.sled_close // llgo:link (*DB).Close C.sled_close
func (db *SledDb) Close() {} func (db *DB) Close() {}
// Free a buffer originally allocated by sled // Free a buffer originally allocated by sled
// llgo:link FreeBuf C.sled_free_buf // llgo:link FreeBuf C.sled_free_buf
func FreeBuf(buf *c.Char, sz c.Ulong) {} func FreeBuf(buf *c.Char, sz c.Ulong) {}
// Set a key to a value // Set a key to a value
// llgo:link (*SledDb).Set C.sled_set // llgo:link (*DB).Set C.sled_set
func (db *SledDb) Set(key *c.Char, keylen c.Ulong, val *c.Char, vallen c.Ulong) {} func (db *DB) Set(key *c.Char, keylen c.Ulong, val *c.Char, vallen c.Ulong) {}
// Get the value of a key // Get the value of a key
// llgo:link (*SledDb).Get C.sled_get // llgo:link (*DB).Get C.sled_get
func (db *SledDb) Get(key *c.Char, keylen c.Ulong, vallen *c.Ulong) *c.Char { return nil } func (db *DB) Get(key *c.Char, keylen c.Ulong, vallen *c.Ulong) *c.Char { return nil }
// Delete the value of a key // Delete the value of a key
// llgo:link (*SledDb).Del C.sled_del // llgo:link (*DB).Del C.sled_del
func (db *SledDb) Del(key *c.Char, keylen c.Ulong) {} func (db *DB) Del(key *c.Char, keylen c.Ulong) {}
// Compare and swap // Compare and swap
// llgo:link (*SledDb).CompareAndSwap C.sled_compare_and_swap // llgo:link (*DB).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 { 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 return 0
} }