Documentation
¶
Index ¶
- Constants
- type Component
- type Option
- func WithCSAKeyEncryptionKey(key string) Option
- func WithContainerName(name string) Option
- func WithContainerPort(port string) Option
- func WithDBURL(db string) Option
- func WithImage(image string) Option
- func WithTestInstance(t *testing.T) Option
- func WithVersion(version string) Option
- func WithWSRPCContainerPort(port string) Option
Constants ¶
const ( JDContainerName string = "job-distributor" DEAFULTJDContainerPort string = "42242" DEFAULTCSAKeyEncryptionKey string = "!PASsword000!" DEAFULTWSRPCContainerPort string = "8080" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { test_env.EnvComponent Grpc string Wsrpc string InternalGRPC string InternalWSRPC string // contains filtered or unexported fields }
func New ¶
New creates a new Component instance with a unique container name and specified networks. It allows for optional configuration through functional options and sets default values for various parameters. This function is useful for initializing components in a test environment.
func (*Component) RestartContainer ¶
RestartContainer restarts the container associated with the Component. It ensures that the container is started with the option to reuse resources, making it useful for maintaining service continuity during updates or failures.
func (*Component) StartContainer ¶
StartContainer initializes and starts a container for the component. It ensures the container is ready for use, logging relevant connection details. This function is essential for setting up the environment required for the component's operations.
type Option ¶
type Option = func(j *Component)
func WithCSAKeyEncryptionKey ¶
WithCSAKeyEncryptionKey sets the CSA key encryption key for a Component. This function is useful for configuring secure key management in decentralized applications.
func WithContainerName ¶
WithContainerName sets the container name for a Component. It returns an Option that can be used to configure the Component during initialization.
func WithContainerPort ¶
WithContainerPort sets the container port for a Component. This option allows customization of the network configuration for the container, enabling proper communication with external services.
func WithDBURL ¶
WithDBURL returns an Option that sets the database connection URL for a Component. It allows users to configure the Component with a specific database connection string.
func WithImage ¶
WithImage sets the container image for a Component. This option allows users to specify which image to use, enabling customization of the component's runtime environment.
func WithTestInstance ¶
WithTestInstance sets up a test logger and test context for a Component. It is useful for initializing components in unit tests, ensuring that logs are captured and associated with the provided testing.T instance.
func WithVersion ¶
WithVersion sets the container version for a Component. It allows users to specify the desired version, ensuring the Component runs with the correct configuration.
func WithWSRPCContainerPort ¶
WithWSRPCContainerPort sets the WebSocket RPC port for the Component. This option allows users to configure the port for WebSocket communication, enabling flexibility in service deployment and integration.