Documentation ¶
Index ¶
- func DeleteCache(c *cache.Cache, key string)
- func FlushCache(c *cache.Cache)
- func GetCache(c *cache.Cache, key string) (interface{}, bool)
- func SetCache(c *cache.Cache, key string, value interface{})
- func StartCache(expiration int, purge int) *cache.Cache
- type Driver
- func (driver *Driver) Delete(collection string, data string) error
- func (driver *Driver) DeleteCollection(collection string) error
- func (driver *Driver) ManageMutex(collection string) *sync.Mutex
- func (driver *Driver) Read(collection string, data string, c *cache.Cache, wantCache bool) (string, error)
- func (driver *Driver) ReadAll(collection string, c *cache.Cache, wantCache bool) ([]string, error)
- func (driver *Driver) Search(collection string, searchField string, value string) error
- func (driver *Driver) Update(collection string, data string, v interface{}, ...) error
- func (driver *Driver) UpdateRecord(collection string, data string, v interface{}) error
- func (driver *Driver) Write(collection string, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartCache ¶
This function would cache the data for a specified time provided by the user. Start cache
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) DeleteCollection ¶
Delete any collection (All records in that collection)
func (*Driver) ManageMutex ¶
MANAGE MUTEXES FOR EACH COLLECTION
func (*Driver) Read ¶
func (driver *Driver) Read(collection string, data string, c *cache.Cache, wantCache bool) (string, error)
READ ANY RECORD FROM A GIVEN COLLECTION Only From Primary Key
func (*Driver) ReadAll ¶
READ ALL RECORDS FROM A GIVEN COLLECTION THIS WILL RETURN JSON ARRAY OF ALL THE RECORDS
func (*Driver) Search ¶
TO CHECK IF IT WORKS IN NESTED STRUCTS(JSON) - Add to experimental maybe? ALSO THIS VALUE IS JUST PRINTED NOT RETURNED ( TO FIX) ADD Search by other values except primary key
func (*Driver) Update ¶
func (driver *Driver) Update(collection string, data string, v interface{}, newValues map[string]interface{}) error
Update with only the required fields, TO COMPLETE
func (*Driver) UpdateRecord ¶
Update any record from a given collection Currently we have to enter the entire User struct, UPDATE IT SO THAT WE CAN UPDATE ONLY THE REQUIRED FIELDS(Or Maybe make a new method for that?) Only Primary Key