loader

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSpecFromBytes

func LoadSpecFromBytes(filename string, data []byte) (map[string]interface{}, error)

LoadSpecFromBytes 从字节流加载 Swagger 规范,根据文件名扩展名自动检测 JSON/YAML 格式 当扩展名无法识别时,依次尝试 JSON 和 YAML 反序列化

func LoadSpecFromFile

func LoadSpecFromFile(filePath string) (map[string]interface{}, error)

LoadSpecFromFile 从文件加载 Swagger 规范(支持 JSON 和 YAML 格式)

func LoadSpecFromPath

func LoadSpecFromPath(path string) (map[string]interface{}, error)

LoadSpecFromPath 从指定路径加载规范文件,根据扩展名自动检测格式 与 LoadSpecFromFile 不同,此方法支持无扩展名时的自动检测回退

func LoadSpecFromURL

func LoadSpecFromURL(client *http.Client, url string) (map[string]interface{}, error)

LoadSpecFromURL 从远程 URL 加载 Swagger 规范 根据 Content-Type 或 URL 扩展名自动判断 JSON/YAML 格式

Types

This section is empty.

Jump to

Keyboard shortcuts

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