bkosm / gompose Goto Github PK
View Code? Open in Web Editor NEWUse docker-compose programatically in Go tests. No third-party dependencies.
License: GNU General Public License v3.0
Use docker-compose programatically in Go tests. No third-party dependencies.
License: GNU General Public License v3.0
As an idea, it would make the library even more std lib oriented.
Parameters to the Up
function should accept a struct rather than a required param and varargs.
Turn this:
err = gompose.Up(
gompose.ReadyOnLog("database system is ready to accept connections", 2),
func() { _ = gompose.Down() }, // any action to be taken on system interrupt
)
Into this:
err = gompose.Up(
gompose.UpOpts {
WaitOnChannel: gompose.ReadyOnLog("database system is ready to accept connections", 2),
OnInterrupt: func() { _ = gompose.Down() },
}
)
Write docs that will be nicely visualized on the pkg go site.
See this repo for examples: https://github.com/sebdah/goldie
Write some example functions too.
Another useful command of compose
is stop
which does not remove the containers entirely, allowing for a faster consecutive startup.
A possible flow is:
Up
Stop
Start
Down
Implement wrappers for those two in gompose
.
Make WithWait
accept arbitrary number of channels.
E.g.:
_ := Up(
WithWait(ReadyOnLog(...), ReadyOnLog(...), ReadyOnHttp(...))
)
Due to the fact that there are no ways of specifying test-only packages, the assertion library is pulled with gompose
every time.
To deliver on the promise the library usage should be removed.
Allow for a wait condition that expects a successful HTTP response from the container.
E.g.:
err := Up(
WithWait(
ReadyOnHttp("5432", http.StatusOk),
),
)
An option of a callback on request sounds good too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.