testutil

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestDaemonConfig

func NewTestDaemonConfig(t *testing.T, baseDir string, opts ...DaemonConfigOption) *config.DaemonConfig

func NewTestServiceConfigFile

func NewTestServiceConfigFile(t *testing.T, opts ...ServiceConfigOption) *types.ServiceConfig

func NewTestServiceScriptAtLocation

func NewTestServiceScriptAtLocation(t *testing.T, testServiceScript ServiceScriptSetup)

func SetupTestDB

func SetupTestDB(t *testing.T, migrationsFS embed.FS, migrationsPath string) (*database.DB, *sql.DB, string)

Types

type DaemonConfigOption

type DaemonConfigOption func(*config.DaemonConfig)

func WithFileSizeLimit

func WithFileSizeLimit(fileSizeLimit int64) DaemonConfigOption

func WithLogDir

func WithLogDir(logDir string) DaemonConfigOption

func WithLogFilename

func WithLogFilename(logFilename string) DaemonConfigOption

func WithMaxFiles

func WithMaxFiles(maxFiles int) DaemonConfigOption

func WithPIDFile

func WithPIDFile(pidFile string) DaemonConfigOption

func WithSocketPath

func WithSocketPath(socketPath string) DaemonConfigOption

type ServiceConfigOption

type ServiceConfigOption func(*types.ServiceConfig)

func WithCommand

func WithCommand(command string) ServiceConfigOption

func WithEnvFile

func WithEnvFile(envFile string) ServiceConfigOption

func WithName

func WithName(name string) ServiceConfigOption

func WithPort

func WithPort(port int) ServiceConfigOption

func WithRuntime

func WithRuntime(runtimeType string, path string) ServiceConfigOption

func WithRuntimePath

func WithRuntimePath(path string) ServiceConfigOption

func WithRuntimeType

func WithRuntimeType(runtimeType string) ServiceConfigOption

func WithoutRuntime

func WithoutRuntime() ServiceConfigOption

type ServiceScriptOption

type ServiceScriptOption func(*ServiceScriptSetup)

func WithDirPath

func WithDirPath(dirPath string) ServiceScriptOption

func WithFileName

func WithFileName(fileName string) ServiceScriptOption

func WithScript

func WithScript(script string) ServiceScriptOption

type ServiceScriptSetup

type ServiceScriptSetup struct {
	Script   string `yaml:"script"`
	DirPath  string `json:"dir_path" yaml:"dir_path"`
	FileName string `json:"file_name" yaml:"file_name"`
}

func NewTestServiceScript

func NewTestServiceScript(t *testing.T, opts ...ServiceScriptOption) *ServiceScriptSetup

type TestLogger

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

func NewTestLogger

func NewTestLogger(t *testing.T) *TestLogger

func (*TestLogger) Log

func (l *TestLogger) Log(level logutil.LogLevel, message string)

Jump to

Keyboard shortcuts

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