opatest

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestBundleName       = `test-bundle`
	TestBundlePathPrefix = `/bundles/`
	BundleServiceKey     = "test-bundle-service"
)

Variables

View Source
var DefaultBundleFS embed.FS
View Source
var DefaultConfigFS embed.FS

Functions

func BundleServerProvider

func BundleServerProvider(bundleFSs ...fs.FS) func(BundleServerDI) (BundleServerOut, error)

func WaitForOPAReady

func WaitForOPAReady(lc fx.Lifecycle, ready opa.EmbeddedOPAReadyCH)

func WithBundles

func WithBundles(bundleFSs ...fs.FS) test.Options

WithBundles is a test.Options that initialize OPA and start a bundle server in test with given bundle FS. All FSs are built into a single bundle and loaded to OPA engine. If no bundle FS provided, DefaultBundleFS is used.

Types

type BundleServerDI

type BundleServerDI struct {
	fx.In
	AppCtx *bootstrap.ApplicationContext
}

type BundleServerOut

type BundleServerOut struct {
	fx.Out
	Server     *sdktest.Server
	Customizer opa.ConfigCustomizer `group:"opa"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL