-
Notifications
You must be signed in to change notification settings - Fork 2
Team API: Design Document
Team API is building a high-level API to work with the 'trie' data structure implemented. The purpose of our API is to facilitate transfer data between the client and the server.
Inserting and removing nodes from a given trie
Finding a target node within a given trie
Supporting get/request calls to the Redis server
Given a shell command, retrieve or store data into the data structure on the Redis server via the Hiredis library.
redisContext and tries
At the top level of the API, we have
- an include directory that contains all of the header files,
- trie.h, for working with tries,
- zset.h, for working with sorted sets, and
- common.h, for functions that are used by both tries and sorted sets.
- a lib directory by which we access the Redis server,
- a samples directory with example implementations of the code
- a src directory with implementations of all the header files,
- a tests directory that contains all the tests,
- a gitignore that tells Git which files to exclude from commits,
- a gitmodules file that defines the properties of the API submodule,
- a YAML file,
- an AUTHORS file with the names of the members of the API team,
- a Makefile, and
- a README that contains instructions for installing and using the API.
Spellcheck team calls valid_word(char*, trie*)
API team calls find(redisContext*, "TFIND trie* char*"): bool
Trie team calls TFIND(trie*, char*): bool
Fulltext team calls next_match(match* match): match*
API team calls find(redisContext*, "NEXT_ITEM trie* char"): bool
Trie team calls TRIE_SEARCH(char* word, trie_t* t): int
Trie team returns validated match*
Autocomplete team calls define_new_word(char* pf, trie_t* dict): trie_t*
API team calls find(redisContext, "INSERT trie* char"): bool
Trie team calls insert_string(char* word, trie_t* t): int
Find the UML diagram attached.
Task for the week is to write a wrapper for the hiredis client. Hiredis is a client library for redis that uses a high-level API but has minimal explicit bindings for commands in redis. If we wrap hiredis, we essentially use code to turn the hiredis library into a different interface Hiredis had synchronous, asynchronous and reply parsing API