Go語言反射實現Http Url與Method映射

      最近使用Go語言,使用http server,做了一個簡單Url到StructName/MethodName的簡單映射。主要思路是將Url能夠StructName/MethodName做個映射,只需在Struct中添加方法就可以添加了實現,比如localhost:9000\struct\a和localhost:9000\struct\b,若是struct需要添加可以定義新的Struct
相關文章
相關標籤/搜索