Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit a91b0c8

Browse files
committed
perfect document
Signed-off-by: chentanjun <[email protected]>
1 parent 9114104 commit a91b0c8

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type TLSConfig struct {
5353
ManagerWhiteList string `json:"manager-whitelist,omitempty"`
5454
}
5555

56-
// NewAPIClient initializes a new API client for the given host
56+
// NewAPIClient initializes a new API client for the given host.
5757
func NewAPIClient(host string, tls TLSConfig) (CommonAPIClient, error) {
5858
if host == "" {
5959
host = defaultHost
@@ -111,7 +111,7 @@ func generateBaseURL(u *url.URL, tls TLSConfig) string {
111111
return "http://" + u.Host
112112
}
113113

114-
// BaseURL returns the base URL of APIClient
114+
// BaseURL returns the base URL of APIClient.
115115
func (client *APIClient) BaseURL() string {
116116
return client.baseURL
117117
}

client/preheat_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/dragonflyoss/Dragonfly/apis/types"
2323
)
2424

25-
// PreheatInfo get detailed information of a preheat task.
25+
// PreheatInfo gets detailed information of a preheat task.
2626
func (client *APIClient) PreheatInfo(ctx context.Context, id string) (*types.PreheatInfo, error) {
2727
resp, err := client.get(ctx, "/preheats/"+id, nil, nil)
2828
if err != nil {

cmd/dfdaemon/app/gen_doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (g *GenDocCommand) addFlags() {
5858
func (g *GenDocCommand) runGenDoc(args []string) error {
5959
if _, err := os.Stat(g.path); err != nil {
6060
if os.IsNotExist(err) {
61-
return fmt.Errorf("path %s does not exits, please check your gen-doc input flag --path", g.path)
61+
return fmt.Errorf("path %s does not exist, please check your gen-doc input flag --path", g.path)
6262
}
6363
return err
6464
}

cmd/dfdaemon/app/init.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"github.com/sirupsen/logrus"
3838
)
3939

40-
// initDfdaemon sets up running environment for dfdaemon according to the given config
40+
// initDfdaemon sets up running environment for dfdaemon according to the given config.
4141
func initDfdaemon(cfg config.Properties) error {
4242
// if Options.MaxProcs <= 0, programs run with GOMAXPROCS set to the number of cores available.
4343
if cfg.MaxProcs > 0 {
@@ -70,7 +70,7 @@ func initDfdaemon(cfg config.Properties) error {
7070
return nil
7171
}
7272

73-
// initLogger initialize the global logrus logger
73+
// initLogger initializes the global logrus logger.
7474
func initLogger(cfg config.Properties) error {
7575
current, err := user.Current()
7676
if err != nil {
@@ -91,7 +91,7 @@ func initLogger(cfg config.Properties) error {
9191
return errors.Wrap(dflog.Init(logrus.StandardLogger(), opts...), "init log")
9292
}
9393

94-
// cleanLocalRepo checks the files at local periodically, and delete the file when
94+
// cleanLocalRepo checks the files at local periodically, and deletes the file when
9595
// it comes to a certain age(counted by the last access time).
9696
// TODO: what happens if the disk usage comes to high level?
9797
func cleanLocalRepo(dfpath string) {

cmd/dfdaemon/app/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func init() {
100100
exitOnError(bindRootFlags(viper.GetViper()), "bind root command flags")
101101
}
102102

103-
// bindRootFlags binds flags on rootCmd to the given viper instance
103+
// bindRootFlags binds flags on rootCmd to the given viper instance.
104104
func bindRootFlags(v *viper.Viper) error {
105105
if err := v.BindPFlags(rootCmd.Flags()); err != nil {
106106
return err
@@ -133,7 +133,7 @@ func exitOnError(err error, msg string) {
133133
}
134134
}
135135

136-
// Execute runs dfdaemon
136+
// Execute runs dfdaemon.
137137
func Execute() {
138138
if err := rootCmd.Execute(); err != nil {
139139
logrus.Errorf("dfdaemon failed: %v", err)
@@ -145,7 +145,7 @@ func Execute() {
145145
}
146146
}
147147

148-
// getConfigFromViper returns dfdaemon config from the given viper instance
148+
// getConfigFromViper returns dfdaemon config from the given viper instance.
149149
func getConfigFromViper(v *viper.Viper) (*config.Properties, error) {
150150
var cfg config.Properties
151151
if err := v.Unmarshal(&cfg, func(dc *mapstructure.DecoderConfig) {
@@ -164,7 +164,7 @@ func getConfigFromViper(v *viper.Viper) (*config.Properties, error) {
164164
}
165165

166166
// decodeWithYAML returns a mapstructure.DecodeHookFunc to decode the given
167-
// types by unmarshalling from yaml text
167+
// types by unmarshalling from yaml text.
168168
func decodeWithYAML(types ...reflect.Type) mapstructure.DecodeHookFunc {
169169
return func(f, t reflect.Type, data interface{}) (interface{}, error) {
170170
for _, typ := range types {

cmd/dfget/app/gen_doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (g *GenDocCommand) runGenDoc(args []string) error {
5959
// FIXME: make document path configurable
6060
if _, err := os.Stat(g.path); err != nil {
6161
if os.IsNotExist(err) {
62-
return fmt.Errorf("path %s does not exits, please check your gen-doc input flag --path", g.path)
62+
return fmt.Errorf("path %s does not exist, please check your gen-doc input flag --path", g.path)
6363
}
6464
return err
6565
}

cmd/dfget/app/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func init() {
6262
initFlags()
6363
}
6464

65-
// runDfget do some init operations and start to download.
65+
// runDfget does some init operations and starts to download.
6666
func runDfget() error {
6767
// initialize logger
6868
if err := initClientLog(); err != nil {
@@ -104,7 +104,7 @@ func checkParameters() error {
104104
return nil
105105
}
106106

107-
// load config from property files.
107+
// initProperties loads config from property files.
108108
func initProperties() {
109109
properties := config.NewProperties()
110110
for _, v := range cfg.ConfigFiles {
@@ -151,7 +151,7 @@ func initClientLog() error {
151151
dflog.WithDebug(cfg.Verbose),
152152
}
153153

154-
// once cfg.Console is set, process should also output log to console
154+
// Once cfg.Console is set, process should also output log to console.
155155
if cfg.Console {
156156
opts = append(opts, dflog.WithConsole())
157157
}

cmd/dfget/app/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func initServerLog() error {
8888
dflog.WithDebug(cfg.Verbose),
8989
}
9090

91-
// once cfg.Console is set, process should also output log to console
91+
// Once cfg.Console is set, process should also output log to console.
9292
if cfg.Console {
9393
opts = append(opts, dflog.WithConsole())
9494
}

cmd/supernode/app/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func initLog(logger *logrus.Logger, logPath string) error {
191191
return nil
192192
}
193193

194-
// initConfig load configuration from config file.
194+
// initConfig loads configuration from config file.
195195
// The properties in config file will be covered by the value that comes from
196196
// command line parameters.
197197
func initConfig() error {

0 commit comments

Comments
 (0)