kucing is an indonesian word for cat
an attempt to recreate kochengs with better understanding in concurrency;
in short -- an 'attempt on learning' go-concurrency and channels.
per kochengs, is still;
Will generate cat image, based from thiscatdoesnotexist
or more actually kind of will GET cat image from thiscatdoesnotexist
three modules,
downloadcomparecache
and a helpers,
- will try as many goroutine as needed for
downloadandcompare, both communicating through channels,downloadwill be a simple GET operation, passing the retrieved data to channels towardcomparecomparewill get the first data inside channels, take the parts of data as[]byte, use it asstringand then check it tocachemap[string]bool=>{"SomeKindOfKeyHereFromData": true}- if exist then return
- if nonexist (returning
false) then save tocacheastrue
cachewill be in-memory cache, holding parts of[]bytefrom the retrieved img, using it asstringkey inmap[string]booltype
for logging;
- spin another routine for printing logs from
helpers
!! !! if everything works, make a cli on top of it !! !!
note: these variables are being used as is for now, the part where we can change it when running this app has not yet been implemented.
| key | value | desc |
|---|---|---|
workersAmt |
int | amount of workers being used here. more workers = more cpu used |
jobsAmt |
int | amount of jobs being ordered to the workers. |
severityLevelPrint |
int | not yet implemented, will only print equal or more than inputted. Debug is 0, Info is 2, Fatal is 3 |
fileCodeLength |
int | filename will be kucing[xxxx].jpg, this will decide how long xxxx will be |
fileCodeSeed |
string | characters written here will be used as the base for fileCode in xxxx |