call_resource

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

call_resource包提供资源调用和HTTP服务功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResourceHandler

func NewResourceHandler(webEngine *web_engine.WebEngine, frontendFiles embed.FS, iconData embed.FS) backend.CallResourceHandler

NewResourceHandler 创建一个新的资源处理器

func ServeFrontendFiles

func ServeFrontendFiles(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc

ServeFrontendFiles 创建一个用于服务前端文件的中间件

Types

type ServeFileSystem

type ServeFileSystem interface {
	// 继承http.FileSystem接口
	http.FileSystem
	// 检查路径是否存在
	Exists(prefix string, path string) bool
}

ServeFileSystem 定义文件服务的接口

func EmbedFolder

func EmbedFolder(fsEmbed embed.FS, targetPath string) ServeFileSystem

EmbedFolder 将嵌入式文件系统的子目录转换为ServeFileSystem接口

Jump to

Keyboard shortcuts

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