utils

package
v1.13.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 11 Imported by: 0

Documentation

Overview

Package utils contains some common functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalMd5

func CalMd5(content string) string

CalMd5 计算md5值

func CheckContentLength

func CheckContentLength(content string) error

CheckContentLength 校验文件内容长度

func CheckFileName

func CheckFileName(name *wrappers.StringValue) error

CheckFileName 校验文件名

func CheckResourceName

func CheckResourceName(name *wrappers.StringValue) error

CheckResourceName 检查资源名称

func FromTagJson

func FromTagJson(tagStr string) []*api.ConfigFileTag

FromTagJson 从 Tags Json 字符串里反序列化出 Tags

func GenConfigFileResponse

func GenConfigFileResponse(namespace, group, fileName, content, md5str string, version uint64) *api.ConfigClientResponse

GenConfigFileResponse 为客户端生成响应对象

func GenReleaseName

func GenReleaseName(oldReleaseName, fileName string) string

GenReleaseName 生成发布名称,规则是 filename-${三位自增长序列}

func ToTagJsonStr

func ToTagJsonStr(tags []*api.ConfigFileTag) string

ToTagJsonStr 把 Tags 转化成 Json 字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL