Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/centny/gwf/routing

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/centny/gwf/routing

  • v0.0.0-20200701021843-f224e9b53117
  • Source
  • Go
  • Socket score

Version published
Created
Source

#Doc

building handler api document in routing.SessionMux

###1.first add document description to handler

  • for func

//adding before routing handler func, //like func Abc(hs *routing.HTTPSession) routing.HResult var _ = Desc{ Title: "List Some", ArgsR: map[string]interface{}{ "type": "the type", }, ArgsO: map[string]interface{}{ "limit": "the list limit", }, Option: map[string]map[string]interface{}{ "type": map[string]interface{}{ "A": "A type", "B": "B type", }, }, ResV: []map[string]interface{}{ map[string]interface{}{ "Type": "A", "Name": "AAA", }, }, }.Api(Abc)

* for handler

	```
//implementation Docable in handler,
//like: func (e *Exm) Doc() *Desc
_ = func() *Desc { // func (e *Exm) Doc() *Desc {
	return &Desc{
		Title: "List Some",
		ArgsR: map[string]interface{}{
			"type": "the type",
		},
		ArgsO: map[string]interface{}{
			"limit": "the list limit",
		},
		Option: map[string]map[string]interface{}{
			"type": map[string]interface{}{
				"A": "A type",
				"B": "B type",
			},
		},
		ResV: []map[string]interface{}{
			map[string]interface{}{
				"Type": "A",
				"Name": "AAA",
			},
		},
	}
}

###2.adding document viewer to routing.SessionMux

  • view hander

mux := routing.NewSessionMux2("") // //adding document viewer handler to Mux. //http://localhost/abc for doc mux.H("/abc.", NewDocViewer()) // //adding document viewer handler(include special handler) to Mux. //http://localhost/abd for doc mux.H("/abd.", NewDocViewerInc(".abccc01.")) // //adding document viewer handler(exclude some handler) to Mux. //http://localhost/abe for doc mux.H("/abe.*", NewDocViewerExc(".abccc01."))

FAQs

Package last updated on 01 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc