Documentation ¶
Index ¶
- func WithAllowAllCaps() testcontainers.CustomizeRequestOption
- func WithAuthentication() testcontainers.CustomizeRequestOption
- func WithPassword(password string) testcontainers.CustomizeRequestOption
- func WithStrictMode() testcontainers.CustomizeRequestOption
- func WithUsername(username string) testcontainers.CustomizeRequestOption
- type SurrealDBContainer
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAllowAllCaps ¶
func WithAllowAllCaps() testcontainers.CustomizeRequestOption
WithAllowAllCaps enables all caps for the SurrealDB instance
func WithAuthentication ¶
func WithAuthentication() testcontainers.CustomizeRequestOption
WithAuthentication enables authentication for the SurrealDB instance
func WithPassword ¶
func WithPassword(password string) testcontainers.CustomizeRequestOption
WithPassword sets the initial password of the user to be created when the container starts It is used in conjunction with WithUsername to set a username and its password. It will set the superuser password for SurrealDB.
func WithStrictMode ¶
func WithStrictMode() testcontainers.CustomizeRequestOption
WithStrict enables strict mode for the SurrealDB instance
func WithUsername ¶
func WithUsername(username string) testcontainers.CustomizeRequestOption
WithUser sets the initial username to be created when the container starts It is used in conjunction with WithPassword to set a username and its password. It will create the specified user with superuser power.
Types ¶
type SurrealDBContainer ¶
type SurrealDBContainer struct {
testcontainers.Container
}
SurrealDBContainer represents the SurrealDB container type used in the module
func RunContainer ¶
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*SurrealDBContainer, error)
RunContainer creates an instance of the SurrealDB container type
Example ¶
// runSurrealDBContainer { ctx := context.Background() surrealdbContainer, err := surrealdb.RunContainer(ctx, testcontainers.WithImage("surrealdb/surrealdb:v1.1.1")) if err != nil { log.Fatal(err) } // Clean up the container defer func() { if err := surrealdbContainer.Terminate(ctx); err != nil { log.Fatal(err) } }() // } state, err := surrealdbContainer.State(ctx) if err != nil { log.Fatal(err) // nolint:gocritic } fmt.Println(state.Running)
Output: true