Skip to content

RhysBushnell/reststrategy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rest Strategy

Rest Strategy is a collection of packages to enable idempotent seeding of data against REST endpoints.

This module uses workspaces and is made up of following submodules/components.

  • seeder modules which can be used as a library (used by the controller) or a CLI.

  • controller k8s controller code.

  • apis holds the types for the controller.

See the individual componenets for a lower level overview.

When interacting with the modules use the top level Makefile tasks.

After any change or before any push to remote

  • make build
  • make test

To run tests against the controller or the CLI use the test/crd-test.yml.

Examples

To see some examples...

Test pre-requisites

Ensure you have the required containers running

mock app

Using pocketbase.io to mock a real world app or SaaS system that will need configuring in a certain way to fit within your existing systems/flows.

docker run --name=pb-app --detach -p 8090:8090 dnitsch/reststrategy-sample:latest

Then navigate to this page

enter any username/password combo this is only for local testing test@example.com/P4s$w0rd123!

mock oauth server

Containerised version of this

docker run --name=oauth-mock --detach -p 8080:8080 dnitsch/reststrategy-oauth-mock:latest

See test/*-test.yaml for an integration style test locally.

Notes

This is a bit of experiment with controller structures and workspaces to see if some re-usable patterns can be gleamed and used in some code generation scaffolding.

At the very least a copy and paste into a new workspace of existing structure and Make tasks -> deleting following seeder, controller/pkg/rstservice, removing k8sutils should leave you with a fairly re-useable controller pkg which can be exchanged with other top level types coming from custom/new apis module.

About

Config based Idempotent REST caller based on strategy pattern specified

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 88.7%
  • Shell 5.9%
  • Makefile 4.5%
  • Dockerfile 0.9%