Переглянути джерело

Add comments for exported functions

tags/0.15^2
9seconds 7 роки тому
джерело
коміт
3aec9657d7
3 змінених файлів з 4 додано та 0 видалено
  1. 1
    0
      stats/channels.go
  2. 1
    0
      stats/init.go
  3. 2
    0
      stats/stats.go

+ 1
- 0
stats/channels.go Переглянути файл

@@ -68,6 +68,7 @@ func EgressTraffic(traffic int) {
68 68
 	}
69 69
 }
70 70
 
71
+// GetStats returns a snapshot of Stats instance.
71 72
 func GetStats() Stats {
72 73
 	rpcChan := make(chan Stats)
73 74
 	statsChan <- rpcChan

+ 1
- 0
stats/init.go Переглянути файл

@@ -6,6 +6,7 @@ import (
6 6
 	"github.com/9seconds/mtg/config"
7 7
 )
8 8
 
9
+// Init initializes stats subsystem.
9 10
 func Init(conf *config.Config) error {
10 11
 	if conf.StatsD.Enabled {
11 12
 		client, err := newStatsd(conf)

+ 2
- 0
stats/stats.go Переглянути файл

@@ -89,6 +89,7 @@ func (s speed) MarshalJSON() ([]byte, error) {
89 89
 	return json.Marshal(value)
90 90
 }
91 91
 
92
+// Stats represents a statistics of the proxy.
92 93
 type Stats struct {
93 94
 	URLs        config.IPURLs `json:"urls"`
94 95
 	Connections connections   `json:"connections"`
@@ -165,6 +166,7 @@ func (s *Stats) handleCrash() {
165 166
 	s.Crashes++
166 167
 }
167 168
 
169
+// NewStats creates a new instance of Stats structure.
168 170
 func NewStats(conf *config.Config) *Stats {
169 171
 	return &Stats{
170 172
 		URLs:   conf.GetURLs(),

Завантаження…
Відмінити
Зберегти