Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type AuthProvider
- type BuiltQuery
- type Conn
- func (c *Conn) AuthAddUser(ctx context.Context, username string) (string, error)
- func (c *Conn) AuthClaim(ctx context.Context, originKey string) (string, error)
- func (c *Conn) AuthDelUser(ctx context.Context, username string) error
- func (c *Conn) AuthListUser(ctx context.Context) (*protocol.TypedArray, error)
- func (c *Conn) AuthLogin(ctx context.Context, authProvider AuthProvider) error
- func (c *Conn) AuthLogout(ctx context.Context) error
- func (c *Conn) AuthRestore(ctx context.Context, originKey string, username string) (string, error)
- func (c *Conn) AuthWhoAmI(ctx context.Context) (string, error)
- func (c *Conn) BuildAndExecQuery(p *QueryPacket) (*ResponsePacket, error)
- func (c *Conn) BuildQuery(p *QueryPacket) (BuiltQuery, error)
- func (c *Conn) BuildSingleActionPacketRaw(segs []any) (raw string, err error)
- func (c *Conn) Close()
- func (c *Conn) CreateKeyspace(ctx context.Context, name string) error
- func (c *Conn) CreateTable(ctx context.Context, path string, modelDesc any) error
- func (c *Conn) DBSize(ctx context.Context, entity string) (size uint64, err error)
- func (c *Conn) Del(ctx context.Context, keys []string) (deleted uint64, err error)
- func (c *Conn) DropKeyspace(ctx context.Context, name string) error
- func (c *Conn) DropTable(ctx context.Context, path string) error
- func (c *Conn) EnableAutoReconnect()
- func (c *Conn) Err() error
- func (c *Conn) Exec(packet *QueryPacket) ([]response.ResponseEntry, error)
- func (c *Conn) ExecQuery(bq BuiltQuery) (*ResponsePacket, error)
- func (c *Conn) ExecRaw(query string) (*RawResponsePacket, error)
- func (c *Conn) ExecSingleActionPacketRaw(segments ...any) (response.ResponseEntry, error)
- func (c *Conn) Exists(ctx context.Context, keys []string) (existing uint64, err error)
- func (c *Conn) FlushDB(ctx context.Context, entity string) (err error)
- func (c *Conn) Get(ctx context.Context, key string) (response.ResponseEntry, error)
- func (c *Conn) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (c *Conn) GetString(ctx context.Context, key string) (string, error)
- func (c *Conn) Heya(ctx context.Context, echo string) error
- func (c *Conn) InspectKeyspace(ctx context.Context, name string) (*protocol.TypedArray, error)
- func (c *Conn) InspectKeyspaces(ctx context.Context) (*protocol.TypedArray, error)
- func (c *Conn) InspectTable(ctx context.Context, path string) (protocol.ModelDescription, error)
- func (c *Conn) KeyLen(ctx context.Context, key string) (uint64, error)
- func (c *Conn) LGet(ctx context.Context, listName string) (*protocol.TypedArray, error)
- func (c *Conn) LGetFirst(ctx context.Context, listName string) (response.ResponseEntry, error)
- func (c *Conn) LGetLast(ctx context.Context, listName string) (response.ResponseEntry, error)
- func (c *Conn) LGetLen(ctx context.Context, listName string) (uint64, error)
- func (c *Conn) LGetLimit(ctx context.Context, listName string, limit uint64) (*protocol.TypedArray, error)
- func (c *Conn) LGetRange(ctx context.Context, listName string, from uint64, to uint64) (*protocol.TypedArray, error)
- func (c *Conn) LGetValueAt(ctx context.Context, listName string, index uint64) (response.ResponseEntry, error)
- func (c *Conn) LModClear(ctx context.Context, listName string) error
- func (c *Conn) LModInsert(ctx context.Context, listName string, index uint64, element any) error
- func (c *Conn) LModPop(ctx context.Context, listName string) (response.ResponseEntry, error)
- func (c *Conn) LModPopIndex(ctx context.Context, listName string, index uint64) (response.ResponseEntry, error)
- func (c *Conn) LModPush(ctx context.Context, listName string, elements []any) error
- func (c *Conn) LModRemove(ctx context.Context, listName string, index uint64) error
- func (c *Conn) LSKeys(ctx context.Context, entity string, limit uint64) (*protocol.TypedArray, error)
- func (c *Conn) LSet(ctx context.Context, listName string, elements []any) error
- func (c *Conn) MGet(ctx context.Context, keys []string) (*protocol.TypedArray, error)
- func (c *Conn) MKSnap(ctx context.Context, name string) error
- func (c *Conn) MPop(ctx context.Context, keys []string) (*protocol.TypedArray, error)
- func (c *Conn) MSet(ctx context.Context, entries []action.KVPair) (set uint64, err error)
- func (c *Conn) MSetB(ctx context.Context, keys []string, values []any) (set uint64, err error)
- func (c *Conn) MUpdate(ctx context.Context, entries []action.KVPair) (updated uint64, err error)
- func (c Conn) OpenedAt() time.Time
- func (c *Conn) Pop(ctx context.Context, key string) (response.ResponseEntry, error)
- func (c *Conn) PopBytes(ctx context.Context, key string) ([]byte, error)
- func (c *Conn) PopString(ctx context.Context, key string) (string, error)
- func (c *Conn) SDel(ctx context.Context, keys []string) (err error)
- func (c *Conn) SSet(ctx context.Context, entries []action.KVPair) (err error)
- func (c *Conn) SUpdate(ctx context.Context, entries []action.KVPair) (err error)
- func (c *Conn) Set(ctx context.Context, key string, value any) error
- func (c *Conn) SysInfoProtoVer(ctx context.Context) (float32, error)
- func (c *Conn) SysInfoProtocol(ctx context.Context) (string, error)
- func (c *Conn) SysInfoVersion(ctx context.Context) (string, error)
- func (c *Conn) SysMetricHealth(ctx context.Context) (bool, error)
- func (c *Conn) SysMetricStorage(ctx context.Context) (uint64, error)
- func (c *Conn) USet(ctx context.Context, entries ...action.KVPair) (set uint64, err error)
- func (c *Conn) Update(ctx context.Context, key string, value any) error
- func (c *Conn) Use(ctx context.Context, path string) error
- func (c Conn) UsedAt() time.Time
- func (c *Conn) WhereAmI(ctx context.Context) (string, error)
- type ConnPool
- func (c *ConnPool) AuthAddUser(ctx context.Context, username string) (string, error)
- func (c *ConnPool) AuthClaim(ctx context.Context, originKey string) (string, error)
- func (c *ConnPool) AuthDelUser(ctx context.Context, username string) error
- func (c *ConnPool) AuthListUser(ctx context.Context) (*protocol.TypedArray, error)
- func (c *ConnPool) AuthLogin(ctx context.Context, authProvider AuthProvider) error
- func (c *ConnPool) AuthLogout(ctx context.Context) error
- func (c *ConnPool) AuthRestore(ctx context.Context, originKey string, username string) (string, error)
- func (c *ConnPool) AuthWhoAmI(ctx context.Context) (string, error)
- func (c *ConnPool) CreateKeyspace(ctx context.Context, name string) error
- func (c *ConnPool) CreateTable(ctx context.Context, path string, modelDesc any) error
- func (c *ConnPool) DBSize(ctx context.Context, entity string) (uint64, error)
- func (c *ConnPool) Del(ctx context.Context, keys []string) (deleted uint64, err error)
- func (c *ConnPool) DoEachConn(action func(conn *Conn) error) error
- func (c *ConnPool) DropKeyspace(ctx context.Context, name string) error
- func (c *ConnPool) DropTable(ctx context.Context, path string) error
- func (c *ConnPool) Exec(packet *QueryPacket) ([]response.ResponseEntry, error)
- func (c *ConnPool) ExecSingleActionPacketRaw(segments ...any) (response.ResponseEntry, error)
- func (c *ConnPool) Exists(ctx context.Context, keys []string) (existing uint64, err error)
- func (c *ConnPool) FlushDB(ctx context.Context, entity string) error
- func (c *ConnPool) Get(ctx context.Context, key string) (response.ResponseEntry, error)
- func (c *ConnPool) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (c *ConnPool) GetString(ctx context.Context, key string) (string, error)
- func (c *ConnPool) Heya(ctx context.Context, echo string) (err error)
- func (c *ConnPool) InspectKeyspace(ctx context.Context, name string) (*protocol.TypedArray, error)
- func (c *ConnPool) InspectKeyspaces(ctx context.Context) (*protocol.TypedArray, error)
- func (c *ConnPool) InspectTable(ctx context.Context, path string) (protocol.ModelDescription, error)
- func (c *ConnPool) KeyLen(ctx context.Context, key string) (uint64, error)
- func (c *ConnPool) LGet(ctx context.Context, listName string) (*protocol.TypedArray, error)
- func (c *ConnPool) LGetFirst(ctx context.Context, listName string) (response.ResponseEntry, error)
- func (c *ConnPool) LGetLast(ctx context.Context, listName string) (response.ResponseEntry, error)
- func (c *ConnPool) LGetLen(ctx context.Context, listName string) (uint64, error)
- func (c *ConnPool) LGetLimit(ctx context.Context, listName string, limit uint64) (*protocol.TypedArray, error)
- func (c *ConnPool) LGetRange(ctx context.Context, listName string, from uint64, to uint64) (*protocol.TypedArray, error)
- func (c *ConnPool) LGetValueAt(ctx context.Context, listName string, index uint64) (response.ResponseEntry, error)
- func (c *ConnPool) LModClear(ctx context.Context, listName string) error
- func (c *ConnPool) LModInsert(ctx context.Context, listName string, index uint64, element any) error
- func (c *ConnPool) LModPop(ctx context.Context, listName string) (response.ResponseEntry, error)
- func (c *ConnPool) LModPopIndex(ctx context.Context, listName string, index uint64) (response.ResponseEntry, error)
- func (c *ConnPool) LModPush(ctx context.Context, listName string, elements []any) error
- func (c *ConnPool) LModRemove(ctx context.Context, listName string, index uint64) error
- func (c *ConnPool) LSKeys(ctx context.Context, entity string, limit uint64) (*protocol.TypedArray, error)
- func (c *ConnPool) LSet(ctx context.Context, listName string, elements []any) error
- func (c *ConnPool) MGet(ctx context.Context, keys []string) (*protocol.TypedArray, error)
- func (c *ConnPool) MKSnap(ctx context.Context, name string) error
- func (c *ConnPool) MPop(ctx context.Context, keys []string) (*protocol.TypedArray, error)
- func (c *ConnPool) MSet(ctx context.Context, entries []action.KVPair) (set uint64, err error)
- func (c *ConnPool) MSetB(ctx context.Context, keys []string, values []any) (set uint64, err error)
- func (c *ConnPool) MUpdate(ctx context.Context, entries []action.KVPair) (updated uint64, err error)
- func (c *ConnPool) OpenedConns() int64
- func (c *ConnPool) Pop(ctx context.Context, key string) (response.ResponseEntry, error)
- func (c *ConnPool) PopBytes(ctx context.Context, key string) ([]byte, error)
- func (c *ConnPool) PopString(ctx context.Context, key string) (string, error)
- func (c *ConnPool) RentConn(dontOpenNew bool) (conn *Conn, pusher func(), err error)
- func (c *ConnPool) SDel(ctx context.Context, keys []string) (err error)
- func (c *ConnPool) SSet(ctx context.Context, entries []action.KVPair) (err error)
- func (c *ConnPool) SUpdate(ctx context.Context, entries []action.KVPair) (err error)
- func (c *ConnPool) Set(ctx context.Context, key string, value any) error
- func (c *ConnPool) SysInfoProtoVer(ctx context.Context) (float32, error)
- func (c *ConnPool) SysInfoProtocol(ctx context.Context) (string, error)
- func (c *ConnPool) SysInfoVersion(ctx context.Context) (string, error)
- func (c *ConnPool) SysMetricHealth(ctx context.Context) (bool, error)
- func (c *ConnPool) SysMetricStorage(ctx context.Context) (uint64, error)
- func (c *ConnPool) USet(ctx context.Context, entries ...action.KVPair) (set uint64, err error)
- func (c *ConnPool) Update(ctx context.Context, key string, value any) error
- func (c *ConnPool) Use(ctx context.Context, path string) error
- func (c *ConnPool) WhereAmI(ctx context.Context) (string, error)
- type ConnPoolOptions
- type ErrComu
- type ErrInvalidUsage
- type ErrLocal
- type QueryPacket
- type RawResponsePacket
- type ResponsePacket
- type Skytable
- type SkytablePool
Constants ¶
const DEBUG = false
const ProtoVer = "Skyhash-1.1"
Variables ¶
var DefaultConnPoolOptions = ConnPoolOptions{ Cap: int64(runtime.NumCPU()) * 2, }
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type BuiltQuery ¶
type BuiltQuery struct { *QueryPacket // contains filtered or unexported fields }
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func NewConn ¶
Create a new Conn. If auth is enabled on the destination server, use NewConnAuth instead.
After connection established, the driver automatically validate Skyhash protocol version with the server, and return an error in case of mismatch.
func NewConnAuth ¶
func NewConnAuth(remote *net.TCPAddr, authProvider AuthProvider) (*Conn, error)
Create a new Conn and “AUTH LOGIN” with the provided auth info.
After connection established, the driver automatically validate Skyhash protocol version with the server, and return an error in case of mismatch.
func (*Conn) AuthAddUser ¶
func (*Conn) AuthDelUser ¶
func (*Conn) AuthListUser ¶
func (*Conn) AuthLogin ¶
func (c *Conn) AuthLogin(ctx context.Context, authProvider AuthProvider) error
func (*Conn) AuthLogout ¶
func (*Conn) AuthRestore ¶
https://docs.skytable.io/actions/auth#restore
If provided `originKey` is "", it'll be omitted in the sent command
func (*Conn) AuthWhoAmI ¶
func (*Conn) BuildAndExecQuery ¶
func (c *Conn) BuildAndExecQuery(p *QueryPacket) (*ResponsePacket, error)
func (*Conn) BuildQuery ¶
func (c *Conn) BuildQuery(p *QueryPacket) (BuiltQuery, error)
func (*Conn) BuildSingleActionPacketRaw ¶
Allows building a packet easily like:
c.BuildSingleActionPacketRaw("SET", "X", 100)
The arguments accept any type. The arguments are formatted internally with %v so most basic types should be supported.
func (*Conn) CreateKeyspace ¶
func (*Conn) CreateTable ¶
func (*Conn) DropKeyspace ¶
func (*Conn) EnableAutoReconnect ¶
func (c *Conn) EnableAutoReconnect()
A Conn may closes itself when errors occured when reading/writng packets.
While all the errors are being returned and can be handled, enabling auto reconnection will save you the trouble dealing with disconnection ¶
⚠️ This could make you unaware of issues.
func (*Conn) Exec ¶
func (c *Conn) Exec(packet *QueryPacket) ([]response.ResponseEntry, error)
func (*Conn) ExecQuery ¶
func (c *Conn) ExecQuery(bq BuiltQuery) (*ResponsePacket, error)
func (*Conn) ExecSingleActionPacketRaw ¶
func (c *Conn) ExecSingleActionPacketRaw(segments ...any) (response.ResponseEntry, error)
Allows executing a packet easily like:
c.ExecSingleActionPacketRaw("SET", "X", 100)
The arguments accept any type. The arguments are formatted internally with %v so most basic types should be supported.
func (*Conn) FlushDB ¶
https://docs.skytable.io/actions/flushdb
If entity is "", flush the current table
func (*Conn) GetBytes ¶
GetBytes() is a strict version of [Get] that only success if the value is stored as BinaryString in Skytable.
func (*Conn) GetString ¶
GetString() is a strict version of [Get] that only success if the value is stored as String in Skytable.
func (*Conn) Heya ¶
https://docs.skytable.io/actions/heya
The method does not return anything but the error, because the value returned by Skytable will be automatically validated.
func (*Conn) InspectKeyspace ¶
https://docs.skytable.io/ddl/#keyspaces-2
If the supplied name is "", inspect the current keyspace
func (*Conn) InspectKeyspaces ¶
func (*Conn) InspectTable ¶
https://docs.skytable.io/ddl/#tables-2
If path is "", inspect the current table
func (*Conn) LGetLimit ¶
func (*Conn) LGetRange ¶
func (c *Conn) LGetRange(ctx context.Context, listName string, from uint64, to uint64) (*protocol.TypedArray, error)
https://docs.skytable.io/actions/lget#range
If provided `to` is 0, it's omitted in the sent command.
func (*Conn) LGetValueAt ¶
func (*Conn) LModInsert ¶
func (*Conn) LModPopIndex ¶
func (*Conn) LModRemove ¶
func (*Conn) LSKeys ¶
func (*Conn) LSet ¶
https://docs.skytable.io/actions/lset
If `elements` is nil, it's omitted in the sent command.`
func (*Conn) MKSnap ¶
https://docs.skytable.io/actions/mksnap
If name is "", it will only send "MKSNAP"
func (*Conn) MSet ¶
https://docs.skytable.io/actions/mset
This is just an alternative MSet with different signature.
func (*Conn) PopBytes ¶
PopBytes() is a strict version of [Pop] that only success if the value is stored as BinaryString in Skytable.
func (*Conn) PopString ¶
PopString() is a strict version of [Pop] that only success if the value is stored as String in Skytable.
func (*Conn) SysInfoProtoVer ¶
func (*Conn) SysInfoProtocol ¶
func (*Conn) SysInfoVersion ¶
func (*Conn) SysMetricHealth ¶
func (*Conn) SysMetricStorage ¶
func (*Conn) Use ¶
https://docs.skytable.io/ddl/#use
“USE KEYSPACE” and “USE TABLE” are unified into “USE”.
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
ConnPool manage multiple Conns automatically.
A conn will be spawned or taken from a internal queue (channel) to perform the task for most of the methods, and be queued back when done. A slow start should be expected if bursting packets with a new pool or not yet used to send a burst of packets.
Therefore, `prewarming` by spawning a burst of parallel packet-sending goroutines is viable.
func NewConnPool ¶
func NewConnPool(remote *net.TCPAddr, opts ConnPoolOptions) *ConnPool
NewConnPool create a ConnPool that manage Conns automatically. DefaultConnPoolOptions is available for the `opts` argument.
func (*ConnPool) AuthAddUser ¶
func (*ConnPool) AuthDelUser ¶
func (*ConnPool) AuthListUser ¶
func (*ConnPool) AuthLogin ¶
func (c *ConnPool) AuthLogin(ctx context.Context, authProvider AuthProvider) error
*ConnPool.AuthLogin() will take all conns and do Conn.AuthLogin() on each, and overwrite the AuthProvider of the pool.
Noted that if there's an error, it's possible that the iteration is not completed and the connections may be using different users.
func (*ConnPool) AuthLogout ¶
*ConnPool.AuthLogin() will take all conns and do Conn.AuthLogout() on each, and overwrite the AuthProvider of the pool.
Noted that if there's an error, it's possible that the iteration is not completed and the connections may be using different users.
func (*ConnPool) AuthRestore ¶
func (c *ConnPool) AuthRestore(ctx context.Context, originKey string, username string) (string, error)
https://docs.skytable.io/actions/auth#restore
If provided `originKey` is "", it'll be omitted in the sent command
func (*ConnPool) AuthWhoAmI ¶
func (*ConnPool) CreateKeyspace ¶
func (*ConnPool) CreateTable ¶
func (*ConnPool) DoEachConn ¶
DoEachConn execute the supplied func for every conn opened before the call. If an error is returned, the iteration may be incomplete.
func (*ConnPool) DropKeyspace ¶
func (*ConnPool) Exec ¶
func (c *ConnPool) Exec(packet *QueryPacket) ([]response.ResponseEntry, error)
func (*ConnPool) ExecSingleActionPacketRaw ¶
func (c *ConnPool) ExecSingleActionPacketRaw(segments ...any) (response.ResponseEntry, error)
func (*ConnPool) FlushDB ¶
https://docs.skytable.io/actions/flushdb
If entity is "", flush the current table
func (*ConnPool) GetBytes ¶
GetBytes() is a strict version of [Get] that only success if the value is stored as BinaryString in Skytable.
func (*ConnPool) GetString ¶
GetString() is a strict version of [Get] that only success if the value is stored as String in Skytable.
func (*ConnPool) Heya ¶
https://docs.skytable.io/actions/heya
The method does not return anything but the error, because the value returned by Skytable will be automatically validated.
func (*ConnPool) InspectKeyspace ¶
https://docs.skytable.io/ddl/#keyspaces-2
If the supplied name is "", inspect the current keyspace
func (*ConnPool) InspectKeyspaces ¶
func (*ConnPool) InspectTable ¶
func (c *ConnPool) InspectTable(ctx context.Context, path string) (protocol.ModelDescription, error)
https://docs.skytable.io/ddl/#tables-2
If path is "", inspect the current table
func (*ConnPool) LGetLimit ¶
func (*ConnPool) LGetRange ¶
func (c *ConnPool) LGetRange(ctx context.Context, listName string, from uint64, to uint64) (*protocol.TypedArray, error)
https://docs.skytable.io/actions/lget#range
If provided `to` is 0, it's omitted in the sent command.
func (*ConnPool) LGetValueAt ¶
func (*ConnPool) LModInsert ¶
func (*ConnPool) LModPopIndex ¶
func (*ConnPool) LModRemove ¶
func (*ConnPool) LSKeys ¶
func (*ConnPool) LSet ¶
https://docs.skytable.io/actions/lset
If `elements` is nil, it's omitted in the sent command.`
func (*ConnPool) MKSnap ¶
https://docs.skytable.io/actions/mksnap
If name is "", it will only send "MKSNAP"
func (*ConnPool) MUpdate ¶
func (*ConnPool) OpenedConns ¶
func (*ConnPool) PopBytes ¶
PopBytes() is a strict version of [Pop] that only success if the value is stored as BinaryString in Skytable.
func (*ConnPool) PopString ¶
PopString() is a strict version of [Pop] that only success if the value is stored as String in Skytable.
func (*ConnPool) RentConn ¶
Get a conn and return it back. A “pusher” func is returned to push back the conn.
conn, pusher, err := c.RentConn(false) if err != nil { return err } defer pusher ()
func (*ConnPool) SysInfoProtoVer ¶
func (*ConnPool) SysInfoProtocol ¶
func (*ConnPool) SysInfoVersion ¶
func (*ConnPool) SysMetricHealth ¶
https://docs.skytable.io/actions/sys#metric
Returns true if "good", false when "critical"
func (*ConnPool) SysMetricStorage ¶
func (*ConnPool) Use ¶
https://docs.skytable.io/ddl/#use
This method will take all conns and do *Conn.Use() on each, and overwrite the DefaultEntity of the pool.
Noted that if there's an error, it's possible that the iteration is not completed and the connections may be using different containers. So it's suggested to reset them by doing DDLs not likely to go wrong, like Use("default").
type ConnPoolOptions ¶
type ErrComu ¶
type ErrComu struct {
// contains filtered or unexported fields
}
func NewComuError ¶
type ErrInvalidUsage ¶
type ErrInvalidUsage ErrLocal
func NewUsageError ¶
func NewUsageError(msg string, err error) ErrInvalidUsage
func (ErrInvalidUsage) Error ¶
func (err ErrInvalidUsage) Error() string
func (ErrInvalidUsage) Unwrap ¶
func (err ErrInvalidUsage) Unwrap() error
type ErrLocal ¶
type ErrLocal struct {
// contains filtered or unexported fields
}
func NewLocalError ¶
type QueryPacket ¶
type QueryPacket struct {
// contains filtered or unexported fields
}
func NewQueryPacket ¶
func NewQueryPacket(actions []Action) *QueryPacket
func NewQueryPacketContext ¶
func NewQueryPacketContext(ctx context.Context, actions []Action) *QueryPacket
type RawResponsePacket ¶
type RawResponsePacket struct {
// contains filtered or unexported fields
}
type ResponsePacket ¶
type ResponsePacket struct {
// contains filtered or unexported fields
}
func (ResponsePacket) Resps ¶
func (rr ResponsePacket) Resps() []response.ResponseEntry
type Skytable ¶
type Skytable interface { // https://docs.skytable.io/actions/heya Heya(ctx context.Context, echo string) error // https://docs.skytable.io/actions/auth#login AuthLogin(ctx context.Context, authProvider AuthProvider) error // https://docs.skytable.io/actions/auth#logout AuthLogout(ctx context.Context) error // https://docs.skytable.io/actions/auth#claim AuthClaim(ctx context.Context, originKey string) (string, error) // https://docs.skytable.io/actions/auth#adduser AuthAddUser(ctx context.Context, username string) (string, error) // https://docs.skytable.io/actions/auth#deluser AuthDelUser(ctx context.Context, username string) error // https://docs.skytable.io/actions/auth#restore // // If provided `originKey` is "", it'll be omitted in the sent command AuthRestore(ctx context.Context, originKey string, username string) (string, error) // https://docs.skytable.io/actions/auth#listuser AuthListUser(ctx context.Context) (*protocol.TypedArray, error) // https://docs.skytable.io/actions/auth#whoami AuthWhoAmI(ctx context.Context) (string, error) // https://docs.skytable.io/actions/exists Exists(ctx context.Context, keys []string) (existing uint64, err error) // https://docs.skytable.io/actions/del Del(ctx context.Context, keys []string) (deleted uint64, err error) // https://docs.skytable.io/actions/sdel SDel(ctx context.Context, keys []string) error // https://docs.skytable.io/actions/get Get(ctx context.Context, key string) (response.ResponseEntry, error) // a strict version of [Get] that only success if the value is stored as String in Skytable. GetString(ctx context.Context, key string) (string, error) // a strict version of [Get] that only success if the value is stored as BinaryString in Skytable. GetBytes(ctx context.Context, key string) ([]byte, error) // https://docs.skytable.io/actions/mget MGet(ctx context.Context, keys []string) (*protocol.TypedArray, error) // https://docs.skytable.io/actions/pop Pop(ctx context.Context, key string) (response.ResponseEntry, error) // https://docs.skytable.io/actions/mpop MPop(ctx context.Context, keys []string) (*protocol.TypedArray, error) // https://docs.skytable.io/actions/set Set(ctx context.Context, key string, value any) error // https://docs.skytable.io/actions/mset MSetB(ctx context.Context, keys []string, values []any) (set uint64, err error) // https://docs.skytable.io/actions/mset MSet(ctx context.Context, entries []action.KVPair) (set uint64, err error) // https://docs.skytable.io/actions/sset SSet(ctx context.Context, entries []action.KVPair) error USet(ctx context.Context, entries ...action.KVPair) (set uint64, err error) // https://docs.skytable.io/actions/update Update(ctx context.Context, key string, value any) error // https://docs.skytable.io/actions/mupdate MUpdate(ctx context.Context, entries []action.KVPair) (updated uint64, err error) // https://docs.skytable.io/actions/supdate SUpdate(ctx context.Context, entries []action.KVPair) error // https://docs.skytable.io/actions/lget#lget LGet(ctx context.Context, listName string) (*protocol.TypedArray, error) // https://docs.skytable.io/actions/lget#limit LGetLimit(ctx context.Context, listName string, limit uint64) (*protocol.TypedArray, error) // https://docs.skytable.io/actions/lget#len LGetLen(ctx context.Context, listName string) (uint64, error) // https://docs.skytable.io/actions/lget#valueat LGetValueAt(ctx context.Context, listName string, index uint64) (response.ResponseEntry, error) // https://docs.skytable.io/actions/lget#first LGetFirst(ctx context.Context, listName string) (response.ResponseEntry, error) // https://docs.skytable.io/actions/lget#last LGetLast(ctx context.Context, listName string) (response.ResponseEntry, error) // https://docs.skytable.io/actions/lget#range // // If provided `to` is 0, it's omitted in the sent command. LGetRange(ctx context.Context, listName string, from uint64, to uint64) (*protocol.TypedArray, error) // https://docs.skytable.io/actions/lmod#push LModPush(ctx context.Context, listName string, elements []any) error // https://docs.skytable.io/actions/lmod#insert LModInsert(ctx context.Context, listName string, index uint64, element any) error // https://docs.skytable.io/actions/lmod#pop LModPop(ctx context.Context, listName string) (response.ResponseEntry, error) // https://docs.skytable.io/actions/lmod#pop LModPopIndex(ctx context.Context, listName string, index uint64) (response.ResponseEntry, error) // https://docs.skytable.io/actions/lmod#remove LModRemove(ctx context.Context, listName string, index uint64) error // https://docs.skytable.io/actions/lmod#clear LModClear(ctx context.Context, listName string) error // https://docs.skytable.io/actions/lset // // If `elements` is nil, it's omitted in the sent command.` LSet(ctx context.Context, listName string, elements []any) error Exec(packet *QueryPacket) ([]response.ResponseEntry, error) ExecSingleActionPacketRaw(segments ...any) (response.ResponseEntry, error) // https://docs.skytable.io/ddl/#use // // “USE KEYSPACE” and “USE TABLE” are unified into “USE”. Use(ctx context.Context, path string) error // https://docs.skytable.io/ddl/#inspect InspectKeyspaces(ctx context.Context) (*protocol.TypedArray, error) // https://docs.skytable.io/ddl/#keyspaces CreateKeyspace(ctx context.Context, name string) error // https://docs.skytable.io/ddl/#keyspaces-1 DropKeyspace(ctx context.Context, name string) error // https://docs.skytable.io/ddl/#keyspaces-2 // // If name is "", inspect the current keyspace InspectKeyspace(ctx context.Context, name string) (*protocol.TypedArray, error) // https://docs.skytable.io/ddl/#tables CreateTable(ctx context.Context, path string, modelDesc any) error // https://docs.skytable.io/ddl/#tables-1 DropTable(ctx context.Context, path string) error // https://docs.skytable.io/ddl/#tables-2 // // If path is "", inspect the current table InspectTable(ctx context.Context, path string) (protocol.ModelDescription, error) // https://docs.skytable.io/actions/sys#info SysInfoVersion(ctx context.Context) (string, error) // https://docs.skytable.io/actions/sys#info SysInfoProtocol(ctx context.Context) (string, error) // https://docs.skytable.io/actions/sys#info SysInfoProtoVer(ctx context.Context) (float32, error) // https://docs.skytable.io/actions/sys#metric // // Returns true if "good", false when "critical" SysMetricHealth(ctx context.Context) (bool, error) // https://docs.skytable.io/actions/sys#metric SysMetricStorage(ctx context.Context) (uint64, error) // https://docs.skytable.io/actions/mksnap // // If name is "", it will only send "MKSNAP" MKSnap(ctx context.Context, name string) error // https://docs.skytable.io/actions/whereami WhereAmI(ctx context.Context) (string, error) // https://docs.skytable.io/actions/dbsize // // If entity is "", check the current table DBSize(ctx context.Context, entity string) (uint64, error) // https://docs.skytable.io/actions/keylen KeyLen(ctx context.Context, key string) (uint64, error) // https://docs.skytable.io/actions/flushdb // // If entity is "", flush the current table FlushDB(ctx context.Context, entity string) error // https://docs.skytable.io/actions/lskeys LSKeys(ctx context.Context, entity string, limit uint64) (*protocol.TypedArray, error) }