Documentation ¶
Overview ¶
Internal code for the cyandb server
Index ¶
- Constants
- func GetAsBytes(f *os.File) ([]byte, []byte, error)
- func ReadKeyVal(currKeyLen uint32, err error, f *os.File, currValLen uint32) (error, int64, string, []byte, string, error, int64, bool)
- func Reverse(nums []int64) []int64
- func Uint32ToByteArr(num uint32) []byte
- func VerifyGetQuery(query *Query) ([]byte, bool)
- func VerifySetQuery(query *Query) ([]byte, bool)
- type Query
- type QueryRunner
- type Server
Constants ¶
View Source
const ( // Use this for default db functionality DefaultDBPath = "/data/cyan/" DefaultPort = 8080 )
Variables ¶
This section is empty.
Functions ¶
func GetAsBytes ¶
GetAsBytes gets the key and value as bytes
func ReadKeyVal ¶
func ReadKeyVal(currKeyLen uint32, err error, f *os.File, currValLen uint32) ( error, int64, string, []byte, string, error, int64, bool, )
ReadKeyVal reads the key and value from the current point in the file
func Uint32ToByteArr ¶
Uint32ToByteArr takes a 32 bit integer as input, converts it to a byte slice, and returns the byte slice
func VerifyGetQuery ¶
func VerifySetQuery ¶
Types ¶
type QueryRunner ¶
type QueryRunner struct {
Server *Server
}
func NewQueryRunner ¶
func NewQueryRunner(server *Server) *QueryRunner
type Server ¶
Server is the struct definition for the server I will add more to this once websockets are introduced
func CreateServer ¶
CreateServer creates a server struct
func (*Server) Set ¶
Set adds a key value pair to a database Serialization model:
[4 bytes len(key)][4 bytes len(val)][len(key) bytes key][len(val) bytes val]
func (*Server) SetExisting ¶
func (server *Server) SetExisting(keyAsBytes []byte, valAsBytes []byte, lenKey uint32, lenVal uint32, originalValue string, existingPos int64) error
SetExisting Sets value for an existing key
func (*Server) StartServer ¶
func (server *Server) StartServer()
StartServer starts the websocket server
Source Files ¶
Click to show internal directories.
Click to hide internal directories.