实现websocket基本功能

This commit is contained in:
刘祥超
2020-09-26 19:54:20 +08:00
parent 3d113cf8f5
commit c272658c73
16 changed files with 910 additions and 189 deletions

View File

@@ -1,11 +1,9 @@
package shared
import (
"regexp"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
)
var regexpNamedVariable = regexp.MustCompile("\\${[\\w.-]+}")
// 头部信息定义
type HTTPHeaderConfig struct {
Id int64 `yaml:"id" json:"id"` // ID
@@ -26,7 +24,7 @@ func NewHeaderConfig() *HTTPHeaderConfig {
// 校验
func (this *HTTPHeaderConfig) Init() error {
this.hasVariables = regexpNamedVariable.MatchString(this.Value)
this.hasVariables = configutils.HasVariables(this.Value)
if this.Status != nil {
err := this.Status.Init()