Skip to content

Commit

Permalink
Document usage as library
Browse files Browse the repository at this point in the history
  • Loading branch information
alenkacz committed Jan 3, 2021
1 parent d0bf417 commit fb9ab89
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,22 @@ You can configure what the CLI does via flags:
--debug 'print out debug logs as well'
```
### As a library
### 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 :-(")
}
```

0 comments on commit fb9ab89

Please sign in to comment.