class
Matter::Storage::JsonFileBackend
- Matter::Storage::JsonFileBackend
- Matter::Storage::Base
- Reference
- Object
Overview
A simple JSON file backed storage implementation.
Persists the same context-key model as MemoryBackend to a single JSON file.
This is intended as a low-friction default for devices/examples and as the
foundation for future DB-backed implementations.
Defined in:
matter/storage/json_file_backend.crConstant Summary
-
TYPE_FIELD =
"__type__" -
Root JSON keys used to preserve non-JSON-native types
-
VALUE_FIELD =
"value"
Constructors
Instance Method Summary
-
#clear : Nil
Clears all stored contexts and keys.
- #clear_all(contexts : Array(String)) : Nil
-
#contexts(contexts : Array(String)) : Array(String)
Get list of immediate subcontext names
- #delete(contexts : Array(String), key : String) : Nil
- #get(contexts : Array(String), key : String) : Type
- #initialized? : Bool
- #keys(contexts : Array(String)) : Array(String)
- #path : String
- #set(contexts : Array(String), key : String, value : Type) : Nil
-
#set(contexts : Array(String), values : Hash(String, Type)) : Nil
Set multiple key-value pairs at once
- #start : Nil
- #stop : Nil
-
#values(contexts : Array(String)) : Hash(String, Type)
Get all key-value pairs in a context
Instance methods inherited from class Matter::Storage::Base
clear : Nil
clear,
clear_all(contexts : Array(String)) : Nil
clear_all,
contexts(contexts : Array(String)) : Array(String)
contexts,
delete(contexts : Array(String), key : String) : Nil
delete,
get(contexts : Array(String), key : String) : Type
get,
initialized? : Bool
initialized?,
keys(contexts : Array(String)) : Array(String)
keys,
set(contexts : Array(String), key : String, value : Type) : Nil
set,
start : Nil
start,
stop : Nil
stop,
values(contexts : Array(String)) : Hash(String, Type)
values
Constructor Detail
Instance Method Detail
Set multiple key-value pairs at once
Get all key-value pairs in a context