From fb9ab891e6552ee125ca0e5c7169a26eabc3ccf6 Mon Sep 17 00:00:00 2001 From: Alena Varkockova Date: Sun, 3 Jan 2021 17:55:22 +0100 Subject: [PATCH] Document usage as library --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19adff6..37fdf90 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,22 @@ You can configure what the CLI does via flags: --debug 'print out debug logs as well' ``` -### As a library \ No newline at end of file +### As a library + +For a full example see [examples/main.go](examples/main.go) + +``` +import "github.com/alenkacz/cert-manager-verifier/pkg/verify" + +... + +result, err := verify.Verify(ctx, config, &verify.Options{CertManagerNamespace: "cert-manager"}) +if err != nil { + log.Fatal(err) +} +if result.Success { + fmt.Println("Success!!!") +} else { + fmt.Println("Failure :-(") +} +``` \ No newline at end of file