testutils

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCustomizer added in v0.8.3

func WithCustomizer(reuse bool, name string, memory, cpu int64) testcontainers.ContainerCustomizer

WithCustomizer function option to use the customizer

Types

type Customizer added in v0.8.3

type Customizer struct {
	// contains filtered or unexported fields
}

Customizer type represents a container customizer for transferring state from the options to the container

func (Customizer) Customize added in v0.8.3

func (c Customizer) Customize(req *testcontainers.GenericContainerRequest) error

Customize satisfies the ContainerCustomizer interface

type OpenFGATestFixture

type OpenFGATestFixture struct {
	// contains filtered or unexported fields
}

OpenFGATestFixture configures the openFGA setup for testing

func NewFGATestcontainer

func NewFGATestcontainer(ctx context.Context, opts ...Option) *OpenFGATestFixture

NewFGATestcontainer creates a new test container with the provided context and options

func (*OpenFGATestFixture) NewFgaClient

func (o *OpenFGATestFixture) NewFgaClient(ctx context.Context) (*fgax.Client, error)

NewFgaClient creates a new fga client with the provided test container

func (*OpenFGATestFixture) TeardownFixture

func (o *OpenFGATestFixture) TeardownFixture() error

TeardownFixture terminates the openFGA container

type Option

type Option func(c *OpenFGATestFixture)

Option is a functional configuration option for openFGA client

func WithCPU added in v0.8.3

func WithCPU(cpu int64) Option

WithCPU sets the CPU for the openFGA container

func WithContainerName added in v0.8.3

func WithContainerName(name string) Option

WithContainerName allows the container name to be set when using reusable containers

func WithMemory added in v0.8.3

func WithMemory(memory int64) Option

WithMemory sets the memory for the openFGA container

func WithModelFile

func WithModelFile(modelFile string) Option

WithModelFile sets the model file path for the openFGA client

func WithReuse added in v0.8.3

func WithReuse(reuse bool) Option

WithReuse allows the container to be reused

func WithStoreName

func WithStoreName(storeName string) Option

WithStoreName sets the store name for the openFGA client

func WithVersion

func WithVersion(version string) Option

WithVersion sets the version of the openFGA container to run

Jump to

Keyboard shortcuts

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