ensure/main.go

20 lines
665 B
Go

package main
// What we need here is a way to define resources one would like to have.
// Each resource must be checked if it needs to be handled or if it already
// exists.
// The question is, who should do that? Is it the responsibility of the user
// to make sure that resources exist or should it be done "magically"?
type (
// Enforced checks if state is already enforced in the environment. When it
// is, it must return true.
Enforced func() bool
// State represents a wanted state that should be pushed to the environment.
Ensurer interface {
// Ensure will modify the environment so that it represents the wanted
// state.
Ensure() error
}
)