doc

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

func Register

func Register(svc interface{})

Types

type MethodInfo

type MethodInfo struct {
	Name   string
	Input  reflect.Type // 输入参数类型名
	Output reflect.Type // 返回值类型名
}

MethodInfo 表示接口中一个方法的定义

type ServiceInfo

type ServiceInfo struct {
	Name    string
	Package string
	Methods []MethodInfo
}

ServiceInfo 表示接口的信息

func ParseService

func ParseService(ifacePtr interface{}) (*ServiceInfo, error)

ParseService 解析 interface 类型的方法信息 注意:input 必须是一个指向 interface 类型的指针(如 (*MyInterface)(nil)) 或者传入 reflect.Type(更推荐),但为简化 API,这里接受 interface{}

func (*ServiceInfo) String

func (ii *ServiceInfo) String() string

String 实现 InterfaceInfo 的字符串表示(便于打印)

Jump to

Keyboard shortcuts

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