Documentation ¶
Overview ¶
包的命名规范:短,简洁,容易记住 go推荐的命名方式为src/encoding/base64 而非src/encoding_base64或者是src/encodingBase64 参考wiki: https://golang.org/doc/effective_go.html
Index ¶
- Variables
- type IServer
- type Server
- func (s *Server) Port() (port int32)
- func (s *Server) Run() (err error)
- func (s *Server) SetPort(port int32) (err error)
- func (s *Server) Start(address string, port int32) (res bool, err error)
- func (s *Server) State() int32
- func (s *Server) UseFor() (err error)
- func (s *Server) UseIf() (err error)
- func (s *Server) UseSwitch(a []int, b []int) (res int)
- func (s *Server) UseSwitchType()
Constants ¶
This section is empty.
Variables ¶
declare err expression
Functions ¶
This section is empty.
Types ¶
type IServer ¶
interface name use methodName with suffix er,for example:
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) SetPort ¶
如果对象有必要使用到getter以及setter方法的时候,需要使用以下方式来命名 setter & getter 定义对象的方法,要传递对象的指针引用,因为使用指针引用需要改变对象的属性值,传递值引用是无法改变对象的属性值
func (*Server) Start ¶
method desc here Server start method with address and port if find comment could be used as follow: go doc -all start | grep -i start
Click to show internal directories.
Click to hide internal directories.