meta

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(object interface{}) map[string]string

func InitMeta

func InitMeta(object interface{}) error

Types

type FileUploadMeta added in v0.1.6

type FileUploadMeta struct {
	FileName    string                `json:"fileName"`    // 文件名
	Size        int64                 `json:"size"`        // 文件大小
	ContentType string                `json:"contentType"` // 文件类型
	FileHeader  *multipart.FileHeader `json:"-"`           // 文件头信息(不输出到JSON)
}

FileUploadMeta 文件上传元数据结构

func (*FileUploadMeta) CopyTo added in v0.1.6

func (f *FileUploadMeta) CopyTo(writer io.Writer) error

CopyTo 复制文件到目标 writer

func (*FileUploadMeta) DetectContentType added in v0.1.6

func (f *FileUploadMeta) DetectContentType() error

DetectContentType 检测文件的实际MIME类型

func (*FileUploadMeta) GetFile added in v0.1.6

func (f *FileUploadMeta) GetFile() (multipart.File, error)

GetFile 获取上传的文件内容

type Meta

type Meta struct {
	Path          string
	Method        string
	Summary       string
	Description   string
	Tags          string
	ExtraMetadata map[string]string
}

Meta 用于API定义的元数据

Jump to

Keyboard shortcuts

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