Documentation ¶
Index ¶
Constants ¶
const SALTS_BUCKET = "salts_bucket"
const USERS_BUCKET = "users_bucket"
Variables ¶
This section is empty.
Functions ¶
func HandleRequest ¶
func HandleRequest(query []byte, conn *DatabaseConnection)
HandleRequest recieves a plain text string query, and hanles it. In most cases it adds it to the requests queue. Whilst in AUTH requests it validates the credentials and returns an answer.
func StartServer ¶
func StartServer()
StartServer starts the database server - listens at a specific port for any incoming TCP connections.
Types ¶
type AuthRequest ¶
type AuthRequest struct { Conn *DatabaseConnection Username string Password string }
type CreateBucketRequest ¶
type CreateBucketRequest struct { Conn *DatabaseConnection BucketName string }
CreateBucketRequest creates a database file(bucket) in the db folder
type CreateUserRequest ¶
type CreateUserRequest struct { Conn *DatabaseConnection Username string Password string }
type DatabaseConnection ¶
DatabaseConnection is an extension of the net.Conn struct, added additional required properties.
type DeleteRequest ¶
type DeleteRequest struct { Conn *DatabaseConnection ObjectType string Object string }
DeleteRequest describes the DELETE request to the database - when the client wants to delete a bucket or a key
type GetRequest ¶
type GetRequest struct { Conn *DatabaseConnection Key string }
GetRequest describes the GET request to the database - when the client wants to know the value of a certain key
type SetRequest ¶
type SetRequest struct { Conn *DatabaseConnection Key string Value string TTL int Override bool }
SetRequest describes the SET request to the database - when the client wants to set a value to a certain key
type UseRequest ¶
type UseRequest struct { Conn *DatabaseConnection BucketName string }
UseRequest is a request that sets the current bucket that is used