testutils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 WithModelFile

func WithModelFile(modelFile string) Option

WithModelFile sets the model file path for the openFGA client

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