Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( ContainerRepoEnvVar = "CERBOS_TEST_CONTAINER_REPO" ContainerTagEnvVar = "CERBOS_TEST_CONTAINER_TAG" DebugEnvVar = "CERBOS_TEST_DEBUG" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CerbosServerInstance ¶
type CerbosServerInstance struct { Stop func() error Host string GRPCPort string HTTPPort string // contains filtered or unexported fields }
func LaunchCerbosServer ¶
func LaunchCerbosServer(ctx context.Context, launchConf LaunchConf) (*CerbosServerInstance, error)
LaunchCerbosServer is a utility method to start a Cerbos server and wait for it be ready.
func (*CerbosServerInstance) GRPCAddr ¶
func (csi *CerbosServerInstance) GRPCAddr() string
func (*CerbosServerInstance) HTTPAddr ¶
func (csi *CerbosServerInstance) HTTPAddr() string
func (*CerbosServerInstance) IsHealthy ¶
func (csi *CerbosServerInstance) IsHealthy() (bool, error)
func (*CerbosServerInstance) WaitForReady ¶
func (csi *CerbosServerInstance) WaitForReady(ctx context.Context) error
type CerbosServerLauncher ¶
type CerbosServerLauncher struct {
// contains filtered or unexported fields
}
func NewCerbosServerLauncher ¶
func NewCerbosServerLauncher() (*CerbosServerLauncher, error)
NewCerbosServerLauncher creates a launcher for Cerbos containers. By default it launches ghcr.io/cerbos/cerbos:latest. The image and/or tag can be overridden with environment variables. CERBOS_TEST_CONTAINER_REPO overrides the default container image repository. CERBOS_TEST_CONTAINER_TAG overrides the default container tag. CERBOS_TEST_DEBUG if set to true, configures the launcher to output container logs to stdout and stderr.
func NewCerbosServerLauncherFromImage ¶
func NewCerbosServerLauncherFromImage(repo, tag string) (*CerbosServerLauncher, error)
func (*CerbosServerLauncher) Launch ¶
func (csl *CerbosServerLauncher) Launch(conf LaunchConf) (*CerbosServerInstance, error)
Click to show internal directories.
Click to hide internal directories.