Add docs for common config fields & sessions

Now that the common configuration objects and session objects are part
of a public API, they need to be documented in a way that can be read
with godoc. This commit should lead to easier development with FRP as a
library.
This commit is contained in:
Tyler Compton
2019-08-24 15:20:34 -07:00
parent bc4df74b5e
commit 4dfd851c46
3 changed files with 196 additions and 52 deletions

View File

@ -34,6 +34,7 @@ import (
fmux "github.com/hashicorp/yamux"
)
// Service is a client service.
type Service struct {
// uniq id got from frps, attach it in loginMsg
runId string
@ -58,6 +59,7 @@ type Service struct {
closedCh chan int
}
// NewService creates a new client service with the given configuration.
func NewService(cfg config.ClientCommonConf, pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.VisitorConf, cfgFile string) (svr *Service, err error) {
svr = &Service{
cfg: cfg,