Skip to content

RedHatInsights/sources-api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fa24f60 · Oct 25, 2024
Jul 17, 2024
Oct 25, 2024
Mar 12, 2024
Aug 1, 2024
Sep 5, 2022
May 30, 2024
Jun 20, 2024
Jan 25, 2024
Oct 20, 2022
Jan 25, 2024
Sep 6, 2024
Oct 4, 2022
Oct 19, 2022
Apr 22, 2023
Jan 31, 2024
Feb 4, 2022
Aug 3, 2023
Apr 27, 2022
Sep 9, 2022
Oct 23, 2024
Jan 25, 2024
Jul 31, 2024
Jun 3, 2022
Jan 28, 2022
Sep 6, 2024
Jul 17, 2022
Nov 4, 2022
Jul 17, 2022
Jul 26, 2022
Jul 28, 2022
Aug 30, 2022
Oct 13, 2022
Jul 17, 2024
Jul 26, 2022
Nov 8, 2022
Sep 27, 2022
Sep 21, 2021
Sep 27, 2022
Apr 11, 2023
Jul 17, 2024
Sep 7, 2022
Oct 18, 2023
Jul 17, 2024
Jul 17, 2024
Apr 21, 2022
Jul 27, 2022
Apr 12, 2022
Sep 27, 2022
Jul 25, 2022
Sep 16, 2022
Sep 30, 2022
Sep 14, 2022
Sep 7, 2022
Mar 11, 2022
Jun 16, 2022
Mar 29, 2022
Mar 29, 2022
Jul 17, 2024
Mar 15, 2023
Sep 7, 2022
Oct 19, 2022
Nov 8, 2022
Oct 3, 2022
Apr 24, 2023
Mar 15, 2023
Feb 25, 2022
Jun 16, 2022

Repository files navigation

--== Sources API ==--

but in Go

Here lies the source code for the Sources API re-write, based on the original Rails Application

Quick Info

  • Written in Go, using echo to handle HTTP routing layer + middleware
  • using GORM for the DAO layer and interacting with the database
  • clowder enabled

Repo Layout

Folder/File Contents
config/ configuration file reading Clowder cdappconfig.json || ENV vars
middleware/ middleware functions for parsing headers, validating account numbers, etc
model/ structs representing db records + http requests for each model
dao/ structs with the methods for interacting with the database (e.g. list all, get by id, update, etc)
util/ misc for responses, etc
redis/ redis client
*_handlers.go http handlers for the app, usually just parses requests into models, reaches into DAO, then returns response.
routes.go contains ALL THE ROUTES! so it's easy to view the mounted routes + what middleware is being used per route

Development

  • Check out the repository, then run make setup to download the dependencies
  • The Makefile contains various targets for development, e.g.
    • make run to build the binary + run
    • make inlinerun to just run the application inline (no output binary, all in memory)
    • make debug to run dlv debug, allowing setting of breakpoints etc
    • make tidy to check go files for new imports and add them to go.sum
    • make lint to run the same linters as the PR action, and print errors.
  • Tests are currently in the same package adjacent to the source file. ex: source_handlers.go -> source_handlers_test.go, just using the standard library testing library. May change in the future.

License

This project is available as open source under the terms of the Apache License 2.0.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages