diff --git a/cmd/supernode/app/options.go b/cmd/supernode/app/options.go index 8a43fe775..2a320e03e 100644 --- a/cmd/supernode/app/options.go +++ b/cmd/supernode/app/options.go @@ -27,7 +27,7 @@ func NewOptions() *Options { } } -// Options store the values that comes from command line parameters. +// Options stores the values that comes from command line parameters. type Options struct { *config.BaseProperties } diff --git a/dfdaemon/config/config.go b/dfdaemon/config/config.go index 116f22144..0dc8b757e 100644 --- a/dfdaemon/config/config.go +++ b/dfdaemon/config/config.go @@ -364,7 +364,7 @@ func certPoolFromFiles(files ...string) (*x509.CertPool, error) { return roots, nil } -// Proxy describe a regular expression matching rule for how to proxy a request +// Proxy describes a regular expression matching rule for how to proxy a request type Proxy struct { Regx *Regexp `yaml:"regx" json:"regx"` UseHTTPS bool `yaml:"use_https" json:"use_https"` diff --git a/dfdaemon/constant/constant.go b/dfdaemon/constant/constant.go index df53a8930..94ec17603 100644 --- a/dfdaemon/constant/constant.go +++ b/dfdaemon/constant/constant.go @@ -41,7 +41,7 @@ const ( ) const ( - // DefaultConfigPath the default path of dfdaemon configuration file. + // DefaultConfigPath is the default path of dfdaemon configuration file. DefaultConfigPath = "/etc/dragonfly/dfdaemon.yml" ) diff --git a/dfdaemon/proxy/proxy.go b/dfdaemon/proxy/proxy.go index 334eac81a..0e2536c38 100644 --- a/dfdaemon/proxy/proxy.go +++ b/dfdaemon/proxy/proxy.go @@ -188,7 +188,7 @@ func (proxy *Proxy) mirrorRegistry(w http.ResponseWriter, r *http.Request) { } // remoteConfig returns the tls.Config used to connect to the given remote host. -// If the host should not be hijacked, nil will be returned. +// If the host should not be hijacked, it will return nil. func (proxy *Proxy) remoteConfig(host string) *tls.Config { for _, h := range proxy.httpsHosts { if h.Regx.MatchString(host) { @@ -202,7 +202,7 @@ func (proxy *Proxy) remoteConfig(host string) *tls.Config { return nil } -// SetRules change the rule lists of the proxy to the given rules +// SetRules changes the rule lists of the proxy to the given rules func (proxy *Proxy) SetRules(rules []*config.Proxy) error { proxy.rules = rules return nil diff --git a/dfdaemon/server.go b/dfdaemon/server.go index c41f43179..996f70cf3 100644 --- a/dfdaemon/server.go +++ b/dfdaemon/server.go @@ -41,7 +41,7 @@ type Server struct { // Option is the functional option for creating a server type Option func(s *Server) error -// WithTLSFromFile sets the tls config for the server from the given key pair file +// WithTLSFromFile sets the TLS config for the server from the given key pair file func WithTLSFromFile(certFile, keyFile string) Option { return func(s *Server) error { if s.server.TLSConfig == nil { diff --git a/dfdaemon/transport/transport.go b/dfdaemon/transport/transport.go index 9a9c300f8..94b8e717a 100644 --- a/dfdaemon/transport/transport.go +++ b/dfdaemon/transport/transport.go @@ -47,7 +47,7 @@ type DFRoundTripper struct { Downloader downloader.Interface } -// New return the default DFRoundTripper. +// New returns the default DFRoundTripper. func New(opts ...Option) (*DFRoundTripper, error) { rt := &DFRoundTripper{ Round: defaultHTTPTransport(nil), @@ -71,7 +71,7 @@ func New(opts ...Option) (*DFRoundTripper, error) { // Option is functional config for DFRoundTripper type Option func(rt *DFRoundTripper) error -// WithTLS configures tls config used for http transport +// WithTLS configures TLS config used for http transport func WithTLS(cfg *tls.Config) Option { return func(rt *DFRoundTripper) error { rt.Round = defaultHTTPTransport(cfg)