mirror of
https://github.com/luckjiawei/podux.git
synced 2026-11-30 00:56:47 +00:00
31 lines
437 B
Go
31 lines
437 B
Go
package version
|
|
|
|
import (
|
|
"runtime/debug"
|
|
|
|
"github.com/pocketbase/pocketbase/core"
|
|
)
|
|
|
|
type Service struct {
|
|
app core.App
|
|
}
|
|
|
|
func NewService(app core.App) *Service {
|
|
return &Service{app: app}
|
|
}
|
|
|
|
func (s *Service) GetFrpVersion() string {
|
|
info, ok := debug.ReadBuildInfo()
|
|
if !ok {
|
|
return "unknown"
|
|
}
|
|
|
|
for _, dep := range info.Deps {
|
|
if dep.Path == "github.com/fatedier/frp" {
|
|
return dep.Version
|
|
}
|
|
}
|
|
|
|
return "unknown"
|
|
}
|