Rename NewInstance to New

This commit is contained in:
2025-10-18 00:34:18 +02:00
parent 113b51eda2
commit 3f834004a8
5 changed files with 19 additions and 19 deletions

View File

@@ -27,7 +27,7 @@ type Instance struct {
// Global configuration (read-only, no lock needed)
globalInstanceSettings *config.InstancesConfig
globalBackendSettings *config.BackendConfig
localNodeName string `json:"-"` // Name of the local node for remote detection
localNodeName string `json:"-"` // Name of the local node for remote detection
// Components (can be nil for remote instances or when stopped)
logger *logger `json:"-"` // nil for remote instances
@@ -47,8 +47,8 @@ type Instance struct {
monitorDone chan struct{} `json:"-"` // Channel to signal monitor goroutine completion
}
// NewInstance creates a new instance with the given name, log path, and options
func NewInstance(name string, globalBackendSettings *config.BackendConfig, globalInstanceSettings *config.InstancesConfig, opts *Options, localNodeName string, onStatusChange func(oldStatus, newStatus Status)) *Instance {
// New creates a new instance with the given name, log path, and options
func New(name string, globalBackendSettings *config.BackendConfig, globalInstanceSettings *config.InstancesConfig, opts *Options, localNodeName string, onStatusChange func(oldStatus, newStatus Status)) *Instance {
// Validate and copy options
opts.ValidateAndApplyDefaults(name, globalInstanceSettings)