Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theherk/mai
https://github.com/theherk/mai
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/theherk/mai
- Owner: theherk
- License: mit
- Created: 2020-04-19T08:30:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T08:31:49.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T06:22:10.009Z (8 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mai
===Given a MAC address, return company name.
Installation
------------go get -u github.com/theherk/mai
# Or clone.
git clone https://github.com/theherk/mai.git
cd mai && go installTesting
-------If testing or contributing best to clone outside GOPATH.
make test
Usage
-----export MAI_APIKEY=[api key]
mai [mac]...
# Or using the docker image built with `make image`.
docker run -ti -e MAI_APIKEY=$MAI_APIKEY mai 44:38:39:ff:ef:57Notes
------ Library coverage is 87.5%; only lines not covered are std lib calls.
- Provides binary `mai` and docker implementation.
- Makefile for some handy shortcuts.Of course many optimizations could be made. In addition to documentation notes in the code, here are some things that come to mind.
- API key as an environment variable may be insufficient in some contexts. There are many options.
- The container could be smaller. Build stage container and alpine would do that.
- Unpacking the full json response into types would be better, but only the name was requested.
- Coverage could be better, but it would be superfluous in the current state.
- This is a lot of foundation for a popsicle stick house.
- A few lines could yield the same result.
- But this seems like an appropriate start to something that could expand without being over-engineered.