# README
--== 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 + runmake inlinerun
to just run the application inline (no output binary, all in memory)make debug
to rundlv debug
, allowing setting of breakpoints etcmake tidy
to check go files for new imports and add them togo.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.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ApplicationPause pauses a given application by setting its "paused_at" column to "now()".
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ApplicationUnpause resumes a given application by setting its "paused_at" column to "NULL".
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetUntranslatedTenants returns all the tenants from the database that have just an "external_tenant" set up.
No description provided by the author
InternalAuthenticationGet fetches one authentication and returns it with the password exposed.
No description provided by the author
InternalSourceList lists all the sources in a compact format —since the client that will use it, "sources-monitor-go" only requires a small set of fields—.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RhcConnectionSourcesList returns all the sources related to a given connection.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SourcePause pauses a source and all its dependant applications, by setting the former's and the latter's "paused_at" columns to "now()".
SourcesRhcConnectionList returns all the connections related to a source.
No description provided by the author
No description provided by the author
No description provided by the author
SourceUnpause "unpauses" a source and all its dependant applications, by setting the former's and the latter's "paused_at" columns to "null".
TranslateTenants attempts to translate the.