nuwaplt

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PHttp             = "http"
	LGO               = "go"
	DefaultDepartment = "default"

	// key
	KContext    = "context"
	KListenAddr = "listen-addr"
	KProtocol   = "protocol"
	KLanguage   = "language"
	KDepartment = "department"
	KLogPath    = "logpath"
	KServerType = "server-type"
)

Variables

View Source
var Host2Module = map[string]string{}
View Source
var Module2Host = map[string]string{}
View Source
var ModuleNames = make([]Name, 0)
View Source
var ModuleNamesUniq = map[string]int{}

Functions

func GetNoise

func GetNoise(project, uri string) (noises map[string]NoiseInfo)

func GetValueByKey

func GetValueByKey(project, dKey, dValDefault string) string

func GetValueWithProject

func GetValueWithProject(sProject, sKey, dValDefault string) string

func Reload

func Reload()

func ResetModuleInfo

func ResetModuleInfo()

ResetModuleInfo 清空原有数据,否则模块信息变更需要重启sharingan,影响用户体验

func Update

func Update()

Types

type Maps

type Maps struct {
	M []map[string]string
}

func (*Maps) UnmarshalJSON

func (r *Maps) UnmarshalJSON(data []byte) error

type Module

type Module struct {
	Name string            `json:"name"`
	Data Maps              `json:"data"`
	KVs  map[string]string `json:"-"`
}

func GetModules

func GetModules() []*Module

func (*Module) Fulfill

func (m *Module) Fulfill()

type Modules

type Modules struct {
	sync.RWMutex `json:"-"`

	Data []*Module `json:"data"`
}
var AllModules Modules

func (*Modules) Update

func (m *Modules) Update()

type Name

type Name struct {
	Name string `json:"name"`
}

type NoiseInfo

type NoiseInfo struct {
	Id      int    `json:"id"`
	Uri     string `json:"uri"`
	Noise   string `json:"noise"`
	Project string `json:"project"`
	User    string `json:"user"`
	AddTime string `json:"addTime"`
}

type ReportResult

type ReportResult struct {
	Errno  int    `json:"errno"`
	Errmsg string `json:"errmsg"`
}

func DelNoise

func DelNoise(id, project, uri, noise string) (result *ReportResult)

func ReportNoise

func ReportNoise(project, uri, noise, user string) (result *ReportResult)

Jump to

Keyboard shortcuts

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