Pick a blog/news site to catch up on so you don't feel like you need to read everything on the internet
CGO_ENABLED=0 go build -ldflags="-X 'main.Version=`cat VERSION.txt`' -X 'main.Commit=`git rev-parse HEAD`'" -o ./app cmd/server/main.go
- Implement Postgres store for UserStorer
- Implement Postgres store for MediumSourceStorer
- Implement MediumSourcePicker
- On schedule get all the sites concurrently
- Log the failures
- Log the success and hash the body of the site
- Update the hashes of the sites
- Order by Hit desc
- Find the n number of records that were recently changed (based on modified date)
- Display the n records that are chosen
- Update the n records Hit count
Method | Endpoint | Query | Request Body | Reponse Body | Success Code | Failures | Description |
---|---|---|---|---|---|---|---|
POST | /v1/user | - | {"username": string} | {"userId": "string"} | 201 | 400 409 | Create account |
PUT | /v1/user/login | - | {"username": string} | {"userId": "string"} | 200 | 400 404 | Login |
POST | /v1/user/{userID}/medium | - | {"source": string} | - | 204 | 404 409 | Add a new medium source |
GET | /v1/user/{userID}/medium | p=int | - | [{"source": string, "Id": string, "nextPage": int}] | 200 | 400 | Get all the sources (paginated) |
DELETE | /v1/user/{userID}/medium/{Id} | - | - | - | 204 | 404 | Delete a medium source |
GET | /v1/user/{userID}/medium/pick | c=int | - | [{"url": "string", "Id": string}] | 200 | 400 404 | Get c medium urls to read |
Name | Type | Description |
---|---|---|
URL | string | The URL to the site. It's the primary key |
ID | string | A UUID |
Hash | string | The hash of the webpage |
Multiplier | float | Increase the chance of it being picked |
CreatedDate | date | When the record was created |
ModifiedDate | date | When the record was modified |
Hit | int | Number of times this record was picked |
UserId | string | The user token this is associated with |
Name | Type | Description |
---|---|---|
string | The user's email address | |
UserId | string | A UUID. It's the primary key |
CreatedDate | date | When the record was created |
ModifiedDate | date | When the record was updated |