From 4c7b62018d9b80ffa42296d10ae8b0291f18a465 Mon Sep 17 00:00:00 2001 From: Eric Zhao Date: Thu, 26 Nov 2020 15:06:55 +0800 Subject: [PATCH] Update go docs of fundamental packages Signed-off-by: Eric Zhao --- core/config/config.go | 1 + core/config/doc.go | 2 ++ core/hotspot/doc.go | 2 ++ core/isolation/doc.go | 3 +-- core/isolation/slot.go | 2 +- core/stat/base/doc.go | 2 ++ core/system/doc.go | 2 ++ ext/datasource/doc.go | 2 ++ 8 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 core/config/doc.go create mode 100644 core/hotspot/doc.go create mode 100644 core/stat/base/doc.go create mode 100644 core/system/doc.go create mode 100644 ext/datasource/doc.go diff --git a/core/config/config.go b/core/config/config.go index 8fc6aaa3..a9cccf03 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -22,6 +22,7 @@ func ResetGlobalConfig(config *Entity) { globalCfg = config } +// InitConfigWithYaml loads general configuration from the YAML file under provided path. func InitConfigWithYaml(filePath string) (err error) { // Initialize general config and logging module. if err = applyYamlConfigFile(filePath); err != nil { diff --git a/core/config/doc.go b/core/config/doc.go new file mode 100644 index 00000000..e8b671e6 --- /dev/null +++ b/core/config/doc.go @@ -0,0 +1,2 @@ +// Package config provides general configuration mechanism. +package config diff --git a/core/hotspot/doc.go b/core/hotspot/doc.go new file mode 100644 index 00000000..b5da1dfe --- /dev/null +++ b/core/hotspot/doc.go @@ -0,0 +1,2 @@ +// Package hotspot provides implementation of "hot-spot" (frequent) parameter flow control. +package hotspot diff --git a/core/isolation/doc.go b/core/isolation/doc.go index bb706260..d4ef5836 100644 --- a/core/isolation/doc.go +++ b/core/isolation/doc.go @@ -1,3 +1,2 @@ -// Package isolation implements the concurrency traffic control. - +// Package isolation provides implementation of concurrency limiting (semaphore isolation). package isolation diff --git a/core/isolation/slot.go b/core/isolation/slot.go index d02940e7..0f4e7d6e 100644 --- a/core/isolation/slot.go +++ b/core/isolation/slot.go @@ -33,7 +33,7 @@ func (s *Slot) Check(ctx *base.EntryContext) *base.TokenResult { return result } if passed, rule, snapshot := checkPass(ctx); !passed { - msg := "isolation check blocked" + msg := "concurrency exceeds threshold" if result == nil { result = base.NewTokenResultBlockedWithCause(base.BlockTypeIsolation, msg, rule, snapshot) } else { diff --git a/core/stat/base/doc.go b/core/stat/base/doc.go new file mode 100644 index 00000000..a6dc7a88 --- /dev/null +++ b/core/stat/base/doc.go @@ -0,0 +1,2 @@ +// Package stat/base provides fundamental data structures of statistics. +package base diff --git a/core/system/doc.go b/core/system/doc.go new file mode 100644 index 00000000..a49b881b --- /dev/null +++ b/core/system/doc.go @@ -0,0 +1,2 @@ +// Package system provides implementation of adaptive system protection. +package system diff --git a/ext/datasource/doc.go b/ext/datasource/doc.go new file mode 100644 index 00000000..6bebeaef --- /dev/null +++ b/ext/datasource/doc.go @@ -0,0 +1,2 @@ +// Package ext/datasource provides interfaces and helper classes of dynamic data-source. +package datasource