Files
openlan/pkg/api/version.go
Daniel Ding d8140ddf08
Some checks failed
Coverage CI / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
Ubuntu CI / build (push) Has been cancelled
fix: display expire time.
2025-09-23 19:38:29 +08:00

23 lines
435 B
Go
Executable File

package api
import (
"net/http"
"github.com/gorilla/mux"
"github.com/luscis/openlan/pkg/cache"
"github.com/luscis/openlan/pkg/schema"
)
type Version struct {
}
func (l Version) Router(router *mux.Router) {
router.HandleFunc("/api/version", l.List).Methods("GET")
}
func (l Version) List(w http.ResponseWriter, r *http.Request) {
ver := schema.NewVersionSchema()
ver.Expire = cache.User.ExpireTime()
ResponseJson(w, ver)
}