engine

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SystemdUnit

func SystemdUnit(t EngineType) string

SystemdUnit returns the systemd unit name for the engine.

Types

type EngineInfo

type EngineInfo struct {
	Type       EngineType
	BinaryPath string
	Port       int
	Label      string // service label (e.g. "com.voicevox.engine")
}

EngineInfo holds discovered engine information.

func DiscoverEngine

func DiscoverEngine(t EngineType) (*EngineInfo, error)

DiscoverEngine searches for the engine binary on the system.

func (*EngineInfo) PortString

func (e *EngineInfo) PortString() string

PortString returns the port as a string.

type EngineType

type EngineType string

EngineType represents a TTS engine type.

const (
	VOICEVOX    EngineType = "voicevox"
	AivisSpeech EngineType = "aivisspeech"
)

func AllEngineTypes

func AllEngineTypes() []EngineType

AllEngineTypes returns all supported engine types.

func ParseEngineType

func ParseEngineType(s string) ([]EngineType, error)

ParseEngineType parses a string into an EngineType. Returns all engine types for "all".

type ServiceManager

type ServiceManager interface {
	// Install deploys the service configuration file and enables the service.
	Install(info *EngineInfo) error
	// Uninstall stops and removes the service configuration.
	Uninstall(engineType EngineType) error
	// Start starts the service.
	Start(engineType EngineType) error
	// Stop stops the service.
	Stop(engineType EngineType) error
	// Status returns the service status.
	Status(engineType EngineType) (*ServiceStatus, error)
}

ServiceManager manages TTS engine background services.

func NewServiceManager

func NewServiceManager() (ServiceManager, error)

NewServiceManager returns the appropriate platform implementation.

type ServiceStatus

type ServiceStatus struct {
	Engine    EngineType
	Installed bool
	Running   bool
	PID       int
	Label     string // launchd label or systemd unit name
}

ServiceStatus represents the status of a managed engine service.

Jump to

Keyboard shortcuts

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