Skip to content

usage as a library #544

@ripienaar

Description

@ripienaar

Describe the feature:

I would like to be able to use goss as a package from within other go applications, there are various infra automation scenarios where its desirable to deliver the system as a single binary.

I'd like to do an integration into choria.io and some other things

Describe the solution you'd like

At least I would like to be able to do a validate, a few of the functions in validate.go, store.go, template.go and a few others do os.Exit() and require a number of unexported functions.

Would you be open to adjusting things a bit so a external package can use goss as a package for at least doing Validate?

Similar to #112

I'd roughly keep things are, even accepting a cli context in validate but I'd add a few helpers to let me do:

err = goss.ValidateWithOptions(goss.GossFile(...), goss.VarsFile(...), goss.OutputFormat(goss.JSON))

additional options for pkg type, output format and options, color, duration, retry duration and max concurrency

Describe alternatives you've considered

I tried to write this from the outside - alas, the os.Exit() etc is a pain

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions