atsign-foundation / at_c

Experimental cross-platform C implementation of the atSDK for SOC & embedded devices
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

at_c: verbbuilders in `packages/atcommons` #165

Open JeremyTubongbanua opened 8 months ago

JeremyTubongbanua commented 8 months ago

Implement VerbBuilders, just like how we have in our at_java and Dart at_client_sdk SDKs.

It is a common pattern to do atProtocol operations like update:<..> and llookup:<..>. seeing that this is a common pattern, current CRUD and notification operations should be refactored and utilize verb builders.

I am justifying this as "P3 - Nice to have" because it isn't core to the SDK's functionality

This should go in packages/atcommons to be utilized as a dependency by atclient and atauth

### Tasks
- [ ] Create verb_builders.h
- [ ] Create verb_builders.c
- [ ] atclient_verb_builders_build_update
- [ ] atclient_verb_builders_build_scan
- [ ] atclient_verb_builders_build_llookup
- [ ] atclient_verb_builders_build_lookup
- [ ] atclient_verb_builders_build_plookup
- [ ] atclient_verb_builders_build_notify
- [ ] atclient_verb_builders_build_monitor
- [ ] atclient_verb_builders_build_from
- [ ] atclient_verb_builders_build_pkam
- [ ] atclient_verb_builders_build_cram
- [ ] atclient_verb_builders_build_delete
- [ ] atclient_verb_builders_build_enroll
- [ ] atclient_verb_builders_build_update unit tests
- [ ] atclient_verb_builders_build_scan unit tests
- [ ] atclient_verb_builders_build_llookup unit tests
- [ ] atclient_verb_builders_build_lookup unit tests
- [ ] atclient_verb_builders_build_plookup unit tests
- [ ] atclient_verb_builders_build_notify unit tests
- [ ] atclient_verb_builders_build_monitor unit tests
- [ ] atclient_verb_builders_build_from unit tests
- [ ] atclient_verb_builders_build_pkam unit tests
- [ ] atclient_verb_builders_build_cram unit tests
- [ ] atclient_verb_builders_build_delete unit tests
- [ ] atclient_verb_builders_build_enroll unit tests

Function signature would look something like this:

int atclient_verb_builders_build_put(char **output, const atclient_atkey *atkey, const char *value);
int atclient_verb_builders_build_scan(char **output, const char *regex, const bool show_hidden);
// ...
JeremyTubongbanua commented 6 months ago

Backlogging since this is unimportant for C Daemon