Documentation ¶
Overview ¶
Copyright (C) 2023 wwhai
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func AddRoute(f func(c *gin.Context, ruleEngine typex.RuleX)) func(*gin.Context)
- func AddRouteV2(f func(*gin.Context, typex.RuleX) (any, error)) func(*gin.Context)
- func Authorize() gin.HandlerFunc
- func ContextUrl(path string) string
- func Cros() gin.HandlerFunc
- func DecreaseRateTime()
- func InitApi()
- func LoadNewestDevice(uuid string, ruleEngine typex.RuleX) error
- func LoadNewestInEnd(uuid string, ruleEngine typex.RuleX) error
- func LoadNewestOutEnd(uuid string, ruleEngine typex.RuleX) error
- func RateLimit() gin.HandlerFunc
- func ReInitRateTime()
- func RouteGroup(name string) *gin.RouterGroup
- func StartDeviceSupervisor(ctx context.Context, device *typex.Device, ruleEngine typex.RuleX)
- func StartInSupervisor(ctx context.Context, in *typex.InEnd, ruleEngine typex.RuleX)
- func StartOutSupervisor(ctx context.Context, out *typex.OutEnd, ruleEngine typex.RuleX)
- func StartRateLimiter()
- func StartRulexApiServer(ruleEngine typex.RuleX, port int)
- func WWWRoot(dir string) static.ServeFileSystem
- type RulexApiServer
- func (s *RulexApiServer) AddRoute(f func(c *gin.Context, ruleEngine typex.RuleX)) func(*gin.Context)
- func (s *RulexApiServer) GetGroup(name string) *gin.RouterGroup
- func (s *RulexApiServer) InitializeConfigCtl()
- func (s *RulexApiServer) InitializeEEKITData()
- func (s *RulexApiServer) InitializeGenericOSData()
- func (s *RulexApiServer) InitializeUnixData()
- func (s *RulexApiServer) InitializeWindowsData()
- func (s *RulexApiServer) Route() *gin.Engine
- type WWWFS
Constants ¶
const API_V1_ROOT string = "/api/v1/"
Variables ¶
This section is empty.
Functions ¶
func AddRouteV2 ¶
AddRouteV2: Only for cron,It's redundant API, will refactor in feature
func Authorize ¶
func Authorize() gin.HandlerFunc
func Cros ¶
func Cros() gin.HandlerFunc
func DecreaseRateTime ¶
func DecreaseRateTime()
func LoadNewestDevice ¶
LoadNewestDevice
func LoadNewestInEnd ¶
LoadNewestInEnd
func LoadNewestOutEnd ¶
LoadNewestOutEnd
func RateLimit ¶
func RateLimit() gin.HandlerFunc
func ReInitRateTime ¶
func ReInitRateTime()
func StartDeviceSupervisor ¶
* * 设备监控器 5秒检查一下状态 *
func StartInSupervisor ¶
* * 南向资源监控器 5秒检查一下状态 *
func StartOutSupervisor ¶
* * 北向资源监控器 5秒检查一下状态 *
func StartRateLimiter ¶
func StartRateLimiter()
func StartRulexApiServer ¶
* * 开启Server *
func WWWRoot ¶
func WWWRoot(dir string) static.ServeFileSystem
Types ¶
type RulexApiServer ¶
type RulexApiServer struct {
// contains filtered or unexported fields
}
* * API Server *
var DefaultApiServer *RulexApiServer
全局API Server
func (*RulexApiServer) AddRoute ¶
func (s *RulexApiServer) AddRoute(f func(c *gin.Context, ruleEngine typex.RuleX)) func(*gin.Context)
即将废弃
func (*RulexApiServer) GetGroup ¶
func (s *RulexApiServer) GetGroup(name string) *gin.RouterGroup
func (*RulexApiServer) InitializeConfigCtl ¶
func (s *RulexApiServer) InitializeConfigCtl()
* * 初始化配置 *
func (*RulexApiServer) InitializeEEKITData ¶
func (s *RulexApiServer) InitializeEEKITData()
func (*RulexApiServer) InitializeGenericOSData ¶
func (s *RulexApiServer) InitializeGenericOSData()
* * 初始化网络配置,主要针对Linux,而且目前只支持了Ubuntu1804,后期分一个windows版本 *
func (*RulexApiServer) InitializeUnixData ¶
func (s *RulexApiServer) InitializeUnixData()
func (*RulexApiServer) InitializeWindowsData ¶
func (s *RulexApiServer) InitializeWindowsData()
func (*RulexApiServer) Route ¶
func (s *RulexApiServer) Route() *gin.Engine