Release v2.0.5 (#5033)

* add: generic cache random time offset expired.

* bugfix: Csrf token should be Secure and httpOnly, but not now

* fix: expose the Offset property to allow external modifications

* improving the concurrency performance of random value calculation

* add WithOffsetFunc to define private RandomExpireCache.offset field

* fix: add seconds definition

* build(deps): bump github.com/stretchr/testify from 1.7.1 to 1.8.0

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.1...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix 4907: force admin service http only

* Feat: add get all tasks function (#4999)

* feat: add get all tasks function

* Refine Comments : admin/profile.go,bean/mock.go,config/global.go... (#5009)

* Refine Comments

* refine comments for cache.go

* refine comments for log.go

* Update orm.go

* refine comments for orm_log.go,types.go

* Update utils.go

* Update doc.go

* refine comments for for four files (#5011)

* refine comments for cache.go

* refine comments for log.go

* Update orm.go

* refine comments for orm_log.go,types.go

* Update utils.go

* Update doc.go

* Update db.go

* fix pass []any as any in variadic function by asasalint (#5012)

* fix pass []any as any in variadic function

* add change log

* build(deps): bump go.opentelemetry.io/otel/trace from 1.7.0 to 1.8.0 (#5019)

Bumps [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/trace
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refine comments for package core  (#5014)

* Refine Comments

* refine comments for cache.go

* refine comments for log.go

* Update orm.go

* refine comments for orm_log.go,types.go

* Update utils.go

* Update doc.go

* refine comments

* refine comments

* Update db.go

* refine comments for core

* build(deps): bump go.opentelemetry.io/otel/exporters/stdout/stdouttrace (#5018)

Bumps [go.opentelemetry.io/otel/exporters/stdout/stdouttrace](https://github.com/open-telemetry/opentelemetry-go) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/stdout/stdouttrace
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix 5022: Miss assiging ln to graceful Server (#5028)

* prepare for releasing v2.0.5 (#5032)

Co-authored-by: auual <ding@ibyte.me>
Co-authored-by: Leon Ding <deen.job@qq.com>
Co-authored-by: dada0z <zhang.guangda@qq.com>
Co-authored-by: kevinzeng <kevinzeng@zego.im>
Co-authored-by: Kevin Tsang <39397413+ktalg@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 日暮颂歌1991 <448081525@qq.com>
Co-authored-by: Regan Yue <1131625869@qq.com>
Co-authored-by: alingse <alingse@foxmail.com>
This commit is contained in:
Ming Deng
2022-07-30 16:11:51 +08:00
committed by GitHub
parent 0b8b87cf56
commit f81689dfb1
34 changed files with 356 additions and 127 deletions

View File

@@ -144,7 +144,7 @@ func avg(items []time.Duration) time.Duration {
return time.Duration(int64(sum) / int64(len(items)))
}
// format bytes number friendly
// toH format bytes number friendly
func toH(bytes uint64) string {
switch {
case bytes < 1024:

View File

@@ -12,6 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// bean is a basic package
// Package bean is a basic package
// it should not depend on other modules except common module, log module and config module
package bean

View File

@@ -7,7 +7,7 @@ import (
"strings"
)
// the mock object must be pointer of struct
// Mock have a mock object ,it must be pointer of struct
// the element in mock object can be slices, structures, basic data types, pointers and interface
func Mock(v interface{}) (err error) {
pv := reflect.ValueOf(v)

View File

@@ -25,7 +25,7 @@ import (
// code, msg
const errFmt = "ERROR-%d, %s"
// Err returns an error representing c and msg. If c is OK, returns nil.
// Error returns an error representing c and msg. If c is OK, returns nil.
func Error(c Code, msg string) error {
return fmt.Errorf(errFmt, c.Code(), msg)
}

View File

@@ -53,20 +53,20 @@ import (
// Configer defines how to get and set value from configuration raw data.
type Configer interface {
// support section::key type in given key when using ini type.
// Set support section::key type in given key when using ini type.
Set(key, val string) error
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
// String support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
String(key string) (string, error)
// get string slice
// Strings get string slice
Strings(key string) ([]string, error)
Int(key string) (int, error)
Int64(key string) (int64, error)
Bool(key string) (bool, error)
Float(key string) (float64, error)
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
// DefaultString support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
DefaultString(key string, defaultVal string) string
// get string slice
// DefaultStrings get string slice
DefaultStrings(key string, defaultVal []string) []string
DefaultInt(key string, defaultVal int) int
DefaultInt64(key string, defaultVal int64) int64

View File

@@ -28,17 +28,17 @@ func InitGlobalInstance(name string, cfg string) error {
return err
}
// support section::key type in given key when using ini type.
// Set support section::key type in given key when using ini type.
func Set(key, val string) error {
return globalInstance.Set(key, val)
}
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
// String support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
func String(key string) (string, error) {
return globalInstance.String(key)
}
// get string slice
// Strings will get string slice
func Strings(key string) ([]string, error) {
return globalInstance.Strings(key)
}
@@ -59,12 +59,12 @@ func Float(key string) (float64, error) {
return globalInstance.Float(key)
}
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
// DefaultString support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
func DefaultString(key string, defaultVal string) string {
return globalInstance.DefaultString(key, defaultVal)
}
// get string slice
// DefaultStrings will get string slice
func DefaultStrings(key string, defaultVal []string) []string {
return globalInstance.DefaultStrings(key, defaultVal)
}

View File

@@ -19,9 +19,8 @@ import (
"os"
"strings"
"github.com/pelletier/go-toml"
"github.com/beego/beego/v2/core/config"
"github.com/pelletier/go-toml"
)
const keySeparator = "."
@@ -135,7 +134,7 @@ func (c *configContainer) Int64(key string) (int64, error) {
}
}
// bool return bool value
// Bool return bool value
// return error if key not found or value is invalid type
func (c *configContainer) Bool(key string) (bool, error) {
res, err := c.get(key)

View File

@@ -19,7 +19,7 @@ import (
"time"
)
// short string format
// ToShortTimeFormat short string format
func ToShortTimeFormat(d time.Duration) string {
u := uint64(d)
if u < uint64(time.Second) {