mirror of
https://github.com/cnrancher/kube-explorer.git
synced 2025-07-12 05:58:32 +00:00
- Support embed api-ui resources - The ui-path arg will be applied if provided. Also applied to api-ui resource files
25 lines
477 B
Go
25 lines
477 B
Go
package content
|
|
|
|
import (
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
type fsFunc func(name string) (fs.File, error)
|
|
|
|
func (f fsFunc) Open(name string) (fs.File, error) {
|
|
return f(name)
|
|
}
|
|
|
|
type fsContent interface {
|
|
ToFileServer(basePaths ...string) http.Handler
|
|
Open(name string) (fs.File, error)
|
|
}
|
|
|
|
type Handler interface {
|
|
ServeAssets(middleware func(http.Handler) http.Handler, hext http.Handler) http.Handler
|
|
ServeFaviconDashboard() http.Handler
|
|
GetIndex() ([]byte, error)
|
|
Refresh()
|
|
}
|