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

Commit 049eea0

Browse files
committed
perfect the document
Signed-off-by: chentanjun <[email protected]>
1 parent 4dffe50 commit 049eea0

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

supernode/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/dragonflyoss/Dragonfly/pkg/fileutils"
2828
)
2929

30-
// NewConfig create an instant with default values.
30+
// NewConfig creates an instant with default values.
3131
func NewConfig() *Config {
3232
return &Config{
3333
BaseProperties: NewBaseProperties(),
@@ -84,7 +84,7 @@ func (c *Config) IsSuperPID(peerID string) bool {
8484
return peerID == c.superNodePID
8585
}
8686

87-
// NewBaseProperties create an instant with default values.
87+
// NewBaseProperties creates an instant with default values.
8888
func NewBaseProperties() *BaseProperties {
8989
home := filepath.Join(string(filepath.Separator), "home", "admin", "supernode")
9090
return &BaseProperties{
@@ -207,7 +207,7 @@ type BaseProperties struct {
207207
// PeerGCDelay is the delay time to execute the GC after the peer has reported the offline.
208208
PeerGCDelay time.Duration `yaml:"peerGCDelay"`
209209

210-
// cIDPrefix s a prefix string used to indicate that the CID is supernode.
210+
// cIDPrefix is a prefix string used to indicate that the CID is supernode.
211211
cIDPrefix string
212212

213213
// superNodePID is the ID of supernode, which is the same as peer ID of dfget.

supernode/daemon/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func New(cfg *config.Config, dfgetLogger *logrus.Logger) (*Daemon, error) {
5959
}, nil
6060
}
6161

62-
// RegisterSuperNode register the supernode as a peer.
62+
// RegisterSuperNode registers the supernode as a peer.
6363
func (d *Daemon) RegisterSuperNode() error {
6464
// construct the PeerCreateRequest for supernode.
6565
// TODO: add supernode version

supernode/daemon/mgr/cdn/cache_detector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (cd *cacheDetector) detectCache(ctx context.Context, task *types.TaskInfo)
5555
checkSameFile(task, metaData) {
5656
breakNum = cd.parseBreakNum(ctx, task, metaData)
5757
}
58-
logrus.Infof("taskID: %s, detect cache breakNum: %d", task.ID, breakNum)
58+
logrus.Infof("taskID: %s, detects cache breakNum: %d", task.ID, breakNum)
5959

6060
if breakNum == 0 {
6161
if metaData, err = cd.resetRepo(ctx, task); err != nil {

supernode/daemon/mgr/cdn/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ func (cm *Manager) GetHTTPPath(ctx context.Context, taskID string) (string, erro
163163
return path.Join("/", raw.Bucket, raw.Key), nil
164164
}
165165

166-
// GetStatus get the status of the file.
166+
// GetStatus gets the status of the file.
167167
func (cm *Manager) GetStatus(ctx context.Context, taskID string) (cdnStatus string, err error) {
168168
return "", nil
169169
}
170170

171-
// Delete the cdn meta with specified taskID.
171+
// Delete deletes the cdn meta with specified taskID.
172172
func (cm *Manager) Delete(ctx context.Context, taskID string, force bool) error {
173173
if !force {
174174
return cm.pieceMD5Manager.removePieceMD5sByTaskID(taskID)

supernode/daemon/mgr/cdn/piece_md5_mgr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (pmm *pieceMD5Mgr) getPieceMD5(taskID string, pieceNum int) (pieceMD5 strin
4444
return pieceMD5s.GetAsString(strconv.Itoa(pieceNum))
4545
}
4646

47-
// setPieceMD5 set the md5 for pieceRange of taskID.
47+
// setPieceMD5 sets the md5 for pieceRange of taskID.
4848
func (pmm *pieceMD5Mgr) setPieceMD5(taskID string, pieceNum int, pieceMD5 string) (err error) {
4949
pieceMD5s, err := pmm.taskPieceMD5s.GetAsMap(taskID)
5050
if err != nil && !errortypes.IsDataNotFound(err) {

supernode/daemon/mgr/dfgettask/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (dtm *Manager) List(ctx context.Context, filter map[string]string) (dfgetTa
186186
return nil, nil
187187
}
188188

189-
// Delete a dfgetTask with clientID and taskID.
189+
// Delete deletes a dfgetTask with clientID and taskID.
190190
func (dtm *Manager) Delete(ctx context.Context, clientID, taskID string) error {
191191
key, err := generateKey(clientID, taskID)
192192
if err != nil {
@@ -204,7 +204,7 @@ func (dtm *Manager) Delete(ctx context.Context, clientID, taskID string) error {
204204
return dtm.dfgetTaskStore.Delete(key)
205205
}
206206

207-
// UpdateStatus update the status of dfgetTask with specified clientID and taskID.
207+
// UpdateStatus updates the status of dfgetTask with specified clientID and taskID.
208208
func (dtm *Manager) UpdateStatus(ctx context.Context, clientID, taskID, status string) error {
209209
dfgetTask, err := dtm.getDfgetTask(clientID, taskID)
210210
if err != nil {

supernode/daemon/util/filter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
"github.com/dragonflyoss/Dragonfly/pkg/errortypes"
2626
"github.com/dragonflyoss/Dragonfly/pkg/stringutils"
27-
2827
"github.com/pkg/errors"
2928
)
3029

0 commit comments

Comments
 (0)