You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/10/16 09:40:50 UTC

[skywalking-satellite] branch main updated: Fix some typos and comment style (#76)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git


The following commit(s) were added to refs/heads/main by this push:
     new 725cbc2  Fix some typos and comment style (#76)
725cbc2 is described below

commit 725cbc21dfd9119bcdfac181acd3b58a54622922
Author: Hoshea Jiang <fg...@gmail.com>
AuthorDate: Sat Oct 16 17:40:45 2021 +0800

    Fix some typos and comment style (#76)
---
 cmd/main.go                                                        | 2 +-
 docs/en/concepts-and-designs/module_design.md                      | 6 +++---
 docs/en/concepts-and-designs/plugin_mechanism.md                   | 2 +-
 docs/en/setup/plugins/client_kafka-client.md                       | 2 +-
 docs/en/setup/plugins/forwarder_nativemanagement-grpc-forwarder.md | 2 +-
 internal/pkg/config/common_config.go                               | 4 ++--
 internal/pkg/log/log.go                                            | 2 +-
 internal/pkg/plugin/definition.go                                  | 2 +-
 internal/satellite/config/loader.go                                | 2 +-
 internal/satellite/config/satellite_config.go                      | 2 +-
 internal/satellite/module/buffer/buffer.go                         | 2 +-
 internal/satellite/module/gatherer/api/gatherer.go                 | 2 +-
 internal/satellite/telemetry/telemetry.go                          | 2 +-
 internal/satellite/tools/catalog.go                                | 6 +++---
 plugins/client/api/client.go                                       | 4 ++--
 plugins/client/kafka/client.go                                     | 2 +-
 plugins/fallbacker/api/fallbacker.go                               | 4 ++--
 plugins/fallbacker/timer/timer_fallbacker_test.go                  | 4 ++--
 plugins/fetcher/api/fetcher.go                                     | 4 ++--
 plugins/fetcher/prometheus/fetcher_test.go                         | 2 +-
 plugins/queue/mmap/queue_operation.go                              | 2 +-
 plugins/receiver/api/receiver.go                                   | 2 +-
 plugins/receiver/grpc/common_test_help.go                          | 2 +-
 plugins/server/api/server.go                                       | 2 +-
 24 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/cmd/main.go b/cmd/main.go
index f8288f7..af7337b 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -27,7 +27,7 @@ import (
 )
 
 // version will be initialized when building
-var version string = "lastest"
+var version = "latest"
 
 func main() {
 	app := cli.NewApp()
diff --git a/docs/en/concepts-and-designs/module_design.md b/docs/en/concepts-and-designs/module_design.md
index f378d28..51200cb 100644
--- a/docs/en/concepts-and-designs/module_design.md
+++ b/docs/en/concepts-and-designs/module_design.md
@@ -43,7 +43,7 @@ LifeCycle
 
 ## Plugins
 
-Plugin is the minimal components in the module. Sateliite has 2 plugin catalogs, which are sharing plugins and normal plugins.
+Plugin is the minimal components in the module. Satellite has 2 plugin catalogs, which are sharing plugins and normal plugins.
 
 - a sharing plugin instance could be sharing with multiple modules in the different pipes.
 - a normal plugin instance is only be used in a fixed module of the fixed pipes.
@@ -102,7 +102,7 @@ There are 7 kinds of normal plugins in Satellite, which are Receiver, Fetcher, Q
                                             | | A |     | I |    |Segment Forwarder|   |
                                             | | T |     | S |    |    (Fallbacker) |   |
                                             | | C |     | P |     -----------------    |
-                                            | | H |  => | A |                          | ===> Kakfa/OAP
+                                            | | H |  => | A |                          | ===> Kafka/OAP
                                             | | B |     | T | =>        ......         |
                                             | | U |     | C |                          |
                                             | | F |     | H |     -----------------    |
@@ -133,4 +133,4 @@ There are 7 kinds of normal plugins in Satellite, which are Receiver, Fetcher, Q
     forwarders send success or process success in Fallbacker, the dispatcher would also ack the
     batch is a success.
  ============================================================================================
-```
\ No newline at end of file
+```
diff --git a/docs/en/concepts-and-designs/plugin_mechanism.md b/docs/en/concepts-and-designs/plugin_mechanism.md
index 3c5f460..a4b6136 100644
--- a/docs/en/concepts-and-designs/plugin_mechanism.md
+++ b/docs/en/concepts-and-designs/plugin_mechanism.md
@@ -1,5 +1,5 @@
 # plugin structure
-`Plugin is a common concept for Satellite, which is in all externsion plugins.`
+`Plugin is a common concept for Satellite, which is in all extension plugins.`
 
 ## Registration mechanism
 
diff --git a/docs/en/setup/plugins/client_kafka-client.md b/docs/en/setup/plugins/client_kafka-client.md
index 1a4b50f..27f8f5d 100755
--- a/docs/en/setup/plugins/client_kafka-client.md
+++ b/docs/en/setup/plugins/client_kafka-client.md
@@ -6,7 +6,7 @@ The Kafka client is a sharing plugin to keep connection with the Kafka brokers a
 # The Kafka broker addresses (default localhost:9092). Multiple values are separated by commas.
 brokers: localhost:9092
 
-# The Kakfa version should follow this pattern, which is major_minor_veryMinor_patch (default 1.0.0.0).
+# The Kafka version should follow this pattern, which is major_minor_veryMinor_patch (default 1.0.0.0).
 version: 1.0.0.0
 
 # The TLS switch (default false).
diff --git a/docs/en/setup/plugins/forwarder_nativemanagement-grpc-forwarder.md b/docs/en/setup/plugins/forwarder_nativemanagement-grpc-forwarder.md
index a01c653..80367b8 100755
--- a/docs/en/setup/plugins/forwarder_nativemanagement-grpc-forwarder.md
+++ b/docs/en/setup/plugins/forwarder_nativemanagement-grpc-forwarder.md
@@ -1,6 +1,6 @@
 # Forwarder/nativemanagement-grpc-forwarder
 ## Description
-This is a synchronization grpc forwarder with the SkyWalking native mangement protocol.
+This is a synchronization grpc forwarder with the SkyWalking native management protocol.
 ## DefaultConfig
 ```yaml```
 ## Configuration
diff --git a/internal/pkg/config/common_config.go b/internal/pkg/config/common_config.go
index b87ee80..2f3cc44 100644
--- a/internal/pkg/config/common_config.go
+++ b/internal/pkg/config/common_config.go
@@ -22,8 +22,8 @@ const (
 	TagName          = "mapstructure"
 )
 
-// CommonFields defines some common filed for every modules or plugins.
+// CommonFields defines some common fields for every module or plugin.
 type CommonFields struct {
-	// PipeName indicates which pipe belongs to.
+	// PipeName indicates which pipe it belongs to.
 	PipeName string `mapstructure:"pipe_name"`
 }
diff --git a/internal/pkg/log/log.go b/internal/pkg/log/log.go
index 2ea41f3..86af3f1 100644
--- a/internal/pkg/log/log.go
+++ b/internal/pkg/log/log.go
@@ -42,7 +42,7 @@ type LoggerConfig struct {
 // FormatOption is a function to set formatter config.
 type FormatOption func(f *formatter)
 
-// FormatOption is a function to set logger config.
+// ConfigOption is a function to set logger config.
 type ConfigOption func(l *logrus.Logger)
 
 type formatter struct {
diff --git a/internal/pkg/plugin/definition.go b/internal/pkg/plugin/definition.go
index 2ef26ea..fd7c278 100644
--- a/internal/pkg/plugin/definition.go
+++ b/internal/pkg/plugin/definition.go
@@ -26,7 +26,7 @@ type Plugin interface {
 	Name() string
 	// Description returns the description of the specific plugin.
 	Description() string
-	// Config returns the default config, that is a YAML pattern.
+	// DefaultConfig returns the default config, that is a YAML pattern.
 	DefaultConfig() string
 }
 
diff --git a/internal/satellite/config/loader.go b/internal/satellite/config/loader.go
index 44f13f9..459a9d9 100644
--- a/internal/satellite/config/loader.go
+++ b/internal/satellite/config/loader.go
@@ -77,7 +77,7 @@ func load(configPath string) (*SatelliteConfig, error) {
 	return cfg, nil
 }
 
-// propagate the common fields to every modules and the dependency plugins.
+// propagateCommonFieldsInPipes propagates the common fields to every module and the dependency plugin.
 func propagateCommonFieldsInPipes(pipes []*PipeConfig) {
 	for _, pipe := range pipes {
 		pipe.Gatherer.CommonFields = pipe.PipeCommonConfig
diff --git a/internal/satellite/config/satellite_config.go b/internal/satellite/config/satellite_config.go
index d5ed032..8e84990 100644
--- a/internal/satellite/config/satellite_config.go
+++ b/internal/satellite/config/satellite_config.go
@@ -50,7 +50,7 @@ type PipeConfig struct {
 	Sender           *sender.SenderConfig       `mapstructure:"sender"`
 }
 
-// Create a satellite config with default value.
+// NewDefaultSatelliteConfig creates a satellite config with default value.
 func NewDefaultSatelliteConfig() *SatelliteConfig {
 	return &SatelliteConfig{
 		Logger: &log.LoggerConfig{
diff --git a/internal/satellite/module/buffer/buffer.go b/internal/satellite/module/buffer/buffer.go
index ecbdac2..6fc1569 100644
--- a/internal/satellite/module/buffer/buffer.go
+++ b/internal/satellite/module/buffer/buffer.go
@@ -31,7 +31,7 @@ type BatchBuffer struct {
 	cap   int                         // the max capacity
 }
 
-// NewBuffer crate a new BatchBuffer according to the capacity param.
+// NewBatchBuffer creates a new BatchBuffer according to the capacity param.
 func NewBatchBuffer(capacity int) *BatchBuffer {
 	return &BatchBuffer{
 		buf:   make([]*event.OutputEventContext, capacity),
diff --git a/internal/satellite/module/gatherer/api/gatherer.go b/internal/satellite/module/gatherer/api/gatherer.go
index 3dd8742..af4fb7b 100644
--- a/internal/satellite/module/gatherer/api/gatherer.go
+++ b/internal/satellite/module/gatherer/api/gatherer.go
@@ -26,7 +26,7 @@ import (
 // Gatherer is the APM data collection module in Satellite.
 type Gatherer interface {
 	api.Module
-	// DataChannel is a blocking channel to transfer the apm data to the upstream processor module.
+	// OutputDataChannel is a blocking channel to transfer the apm data to the upstream processor module.
 	OutputDataChannel() <-chan *queue.SequenceEvent
 	// Ack the sent offset.
 	Ack(lastOffset event.Offset)
diff --git a/internal/satellite/telemetry/telemetry.go b/internal/satellite/telemetry/telemetry.go
index eaeb2fb..96a43a5 100644
--- a/internal/satellite/telemetry/telemetry.go
+++ b/internal/satellite/telemetry/telemetry.go
@@ -34,7 +34,7 @@ var (
 	lock               sync.Mutex
 )
 
-// register the metric meta to the registerer.
+// Register registers the metric meta to the registerer.
 func Register(meta ...SelfTelemetryMetaFunc) {
 	for _, telemetryMeta := range meta {
 		name, collector := telemetryMeta()
diff --git a/internal/satellite/tools/catalog.go b/internal/satellite/tools/catalog.go
index 95808b5..53f20bf 100644
--- a/internal/satellite/tools/catalog.go
+++ b/internal/satellite/tools/catalog.go
@@ -52,11 +52,11 @@ func (c *Catalog) Find(namePaths ...string) *Catalog {
 		return nil
 	}
 
-	childrens := c.Catalog
+	children := c.Catalog
 	finded := c
 	for _, name := range namePaths {
 		finded = nil
-		for _, cc := range childrens {
+		for _, cc := range children {
 			if cc.Name == name {
 				finded = cc
 				break
@@ -65,7 +65,7 @@ func (c *Catalog) Find(namePaths ...string) *Catalog {
 		if finded == nil {
 			return nil
 		}
-		childrens = finded.Catalog
+		children = finded.Catalog
 	}
 	return finded
 }
diff --git a/plugins/client/api/client.go b/plugins/client/api/client.go
index f5a3317..5837f77 100644
--- a/plugins/client/api/client.go
+++ b/plugins/client/api/client.go
@@ -37,13 +37,13 @@ type ClientStatus int8
 type Client interface {
 	plugin.SharingPlugin
 
-	// GetConnection returns the connected client to publish events.
+	// GetConnectedClient returns the connected client to publish events.
 	GetConnectedClient() interface{}
 	// RegisterListener register a listener to listen the client status.
 	RegisterListener(chan<- ClientStatus)
 }
 
-// Get an initialized client plugin.
+// GetClient gets an initialized client plugin.
 func GetClient(config plugin.Config) Client {
 	return plugin.Get(reflect.TypeOf((*Client)(nil)).Elem(), config).(Client)
 }
diff --git a/plugins/client/kafka/client.go b/plugins/client/kafka/client.go
index 827192a..7574555 100644
--- a/plugins/client/kafka/client.go
+++ b/plugins/client/kafka/client.go
@@ -71,7 +71,7 @@ func (c *Client) DefaultConfig() string {
 # The Kafka broker addresses (default localhost:9092). Multiple values are separated by commas.
 brokers: localhost:9092
 
-# The Kakfa version should follow this pattern, which is major_minor_veryMinor_patch (default 1.0.0.0).
+# The Kafka version should follow this pattern, which is major_minor_veryMinor_patch (default 1.0.0.0).
 version: 1.0.0.0
 
 # The TLS switch (default false).
diff --git a/plugins/fallbacker/api/fallbacker.go b/plugins/fallbacker/api/fallbacker.go
index 676ef2f..1976da5 100644
--- a/plugins/fallbacker/api/fallbacker.go
+++ b/plugins/fallbacker/api/fallbacker.go
@@ -28,11 +28,11 @@ import (
 // Fallbacker is a plugin interface, that defines some fallback strategies.
 type Fallbacker interface {
 	plugin.Plugin
-	//  FallBack returns nil when finishing a successful process and returns a new Fallbacker when failure.
+	// FallBack returns nil when finishing a successful process and returns a new Fallbacker when failure.
 	FallBack(batch event.BatchEvents, forward api.ForwardFunc) bool
 }
 
-// Get an initialized client plugin.
+// GetFallbacker gets an initialized client plugin.
 func GetFallbacker(config plugin.Config) Fallbacker {
 	return plugin.Get(reflect.TypeOf((*Fallbacker)(nil)).Elem(), config).(Fallbacker)
 }
diff --git a/plugins/fallbacker/timer/timer_fallbacker_test.go b/plugins/fallbacker/timer/timer_fallbacker_test.go
index 6c33f88..32f8a35 100644
--- a/plugins/fallbacker/timer/timer_fallbacker_test.go
+++ b/plugins/fallbacker/timer/timer_fallbacker_test.go
@@ -63,7 +63,7 @@ func TestFallbacker_FallBack1(t1 *testing.T) {
 			wantCount: 2,
 		},
 		{
-			name: "test-recach-max_attempts",
+			name: "test-reach-max_attempts",
 			args: plugin.Config{
 				"max_attempts":        5,
 				"exponential_backoff": 200,
@@ -73,7 +73,7 @@ func TestFallbacker_FallBack1(t1 *testing.T) {
 			wantCount: 4,
 		},
 		{
-			name: "test-unrecach-max_attempts",
+			name: "test-unreach-max_attempts",
 			args: plugin.Config{
 				"max_attempts":        10,
 				"exponential_backoff": 20,
diff --git a/plugins/fetcher/api/fetcher.go b/plugins/fetcher/api/fetcher.go
index cbfef53..6938310 100644
--- a/plugins/fetcher/api/fetcher.go
+++ b/plugins/fetcher/api/fetcher.go
@@ -36,13 +36,13 @@ type Fetcher interface {
 	Fetch(ctx context.Context)
 	// Channel would be put a data when the receiver receives an APM data.
 	Channel() <-chan *v1.SniffData
-	// Shutdown shutdown the fetcher
+	// Shutdown shutdowns the fetcher
 	Shutdown(context.Context) error
 	// SupportForwarders should provider all forwarder support current receiver
 	SupportForwarders() []forwarder.Forwarder
 }
 
-// Get an initialized fetcher plugin.
+// GetFetcher gets an initialized fetcher plugin.
 func GetFetcher(config plugin.Config) Fetcher {
 	return plugin.Get(reflect.TypeOf((*Fetcher)(nil)).Elem(), config).(Fetcher)
 }
diff --git a/plugins/fetcher/prometheus/fetcher_test.go b/plugins/fetcher/prometheus/fetcher_test.go
index eacca28..cd6d6df 100644
--- a/plugins/fetcher/prometheus/fetcher_test.go
+++ b/plugins/fetcher/prometheus/fetcher_test.go
@@ -235,7 +235,7 @@ func testEndToEnd(ctx context.Context, t *testing.T, targets []*testData) {
 	outputChannel := make(chan *v1.SniffData)
 	// 1. setup mock server
 	mp, cfg, err := setupMockPrometheus(targets...)
-	require.Nilf(t, err, "Failed to create Promtheus config: %v", err)
+	require.Nilf(t, err, "Failed to create Prometheus config: %v", err)
 	defer mp.Close()
 	t.Log(cfg)
 	fetch(ctx, cfg.ScrapeConfigs, outputChannel)
diff --git a/plugins/queue/mmap/queue_operation.go b/plugins/queue/mmap/queue_operation.go
index d00df14..830399b 100644
--- a/plugins/queue/mmap/queue_operation.go
+++ b/plugins/queue/mmap/queue_operation.go
@@ -32,7 +32,7 @@ import (
 // bigqueue(https://github.com/grandecola/bigqueue), the queue operation file retains
 // the original author license.
 //
-// The reason why we references the source codes of bigqueue rather than using the lib
+// The reason why we reference the source codes of bigqueue rather than using the lib
 // is the file queue in Satellite is like following.
 // 1. Only one consumer and publisher in the Satellite queue.
 // 2. Reusing files strategy is required to reduce the creation times in the Satellite queue.
diff --git a/plugins/receiver/api/receiver.go b/plugins/receiver/api/receiver.go
index c05531e..221e4c4 100644
--- a/plugins/receiver/api/receiver.go
+++ b/plugins/receiver/api/receiver.go
@@ -44,7 +44,7 @@ type Receiver interface {
 	SupportForwarders() []forwarder.Forwarder
 }
 
-// Get an initialized receiver plugin.
+// GetReceiver gets an initialized receiver plugin.
 func GetReceiver(config plugin.Config) Receiver {
 	return plugin.Get(reflect.TypeOf((*Receiver)(nil)).Elem(), config).(Receiver)
 }
diff --git a/plugins/receiver/grpc/common_test_help.go b/plugins/receiver/grpc/common_test_help.go
index cd8d2ea..3b3ac8c 100644
--- a/plugins/receiver/grpc/common_test_help.go
+++ b/plugins/receiver/grpc/common_test_help.go
@@ -87,7 +87,7 @@ func TestReceiverWithConfig(rec receiver.Receiver, recConf map[string]string,
 	}
 }
 
-// TestReceiver help to testing grpc receiver
+// TestReceiverWithSync help to testing grpc receiver
 func TestReceiverWithSync(rec receiver.Receiver,
 	dataGenerator func(t *testing.T, sequence int, conn *grpc.ClientConn, sendData *string, ctx context.Context),
 	snifferConvertor func(data *v1.SniffData) string, mockResp *v1.SniffData, t *testing.T) {
diff --git a/plugins/server/api/server.go b/plugins/server/api/server.go
index a5d3101..76e565c 100644
--- a/plugins/server/api/server.go
+++ b/plugins/server/api/server.go
@@ -30,7 +30,7 @@ type Server interface {
 	GetServer() interface{}
 }
 
-// Get an initialized server plugin.
+// GetServer gets an initialized server plugin.
 func GetServer(config plugin.Config) Server {
 	return plugin.Get(reflect.TypeOf((*Server)(nil)).Elem(), config).(Server)
 }