This project provides a clean, modular architecture for creating system services that can run across different platforms. It handles platform-specific service management while maintaining a consistent interface for service operations.
- Clean Architecture: Modular design with platform-agnostic core
- Cross-Platform: Supports Windows, Linux and macOS
- Service Management: Easy installation, status checking and lifecycle management
- Build Automation: TaskFile for consistent build and management commands
go-service/
├── Makefile # Build and installation automation
├── cmd/
│ └── service/
│ └── main.go # Main entry point with CLI flags and command handling
├── internal/
│ ├── service/
│ │ └── service.go # Core service implementation
│ └── platform/ # Platform-specific implementations
│ ├── config.go # Configuration constants
│ ├── service.go # Cross-platform service interface
│ ├── windows.go # Windows-specific service management
│ ├── linux.go # Linux-specific systemd service management
│ └── darwin.go # macOS-specific launchd service management
└── go.mod # Go module definition
For detailed instructions, check the Medium article for a step-by-step guide.If you don’t have a Medium membership, you can also find the article on dev.to.
If you find this content useful, please consider donating to support its development and future improvements.