Documentation

Index

Constants

This section is empty.

Variables

View Source
var COLNAMES = map[int]string{0: "A", 1: "B", 2: "C", 3: "D", 4: "E", 5: "F", 6: "G", 7: "H", 8: "I", 9: "J", 10: "K", 11: "L", 12: "M",
	13: "N", 14: "O", 15: "P", 16: "Q", 17: "R", 18: "S", 19: "T", 20: "U", 21: "V", 22: "W", 23: "X", 24: "Y",
	25: "Z", 26: "AA", 27: "AB", 28: "AC", 29: "AD", 30: "AE", 31: "AF", 32: "AG", 33: "AH", 34: "AI", 35: "AJ",
	36: "AK", 37: "AL", 38: "AM", 39: "AN",
}

Functions

func ListenNBIServer

func ListenNBIServer(manager *models.ModelManager) error

运行管理系统

func ServerRecover

func ServerRecover(debug bool) echo.MiddlewareFunc

Types

type HTTPError

type HTTPError struct {
	Code     int         `json:"-"`
	Message  interface{} `json:"message"`
	Internal error       `json:"-"` // Stores the error returned by an external dependency
}

func NewHTTPError

func NewHTTPError(code int, message ...interface{}) *HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

type HttpHandler

type HttpHandler struct {
	Ctx *WebContext
}

func NewHttpHandler

func NewHttpHandler(ctx *WebContext) HttpHandler

func (*HttpHandler) AddCpeData

func (h *HttpHandler) AddCpeData(c echo.Context) error

func (*HttpHandler) AddData

func (h *HttpHandler) AddData(c echo.Context) error

AddData

func (*HttpHandler) AddOperator

func (h *HttpHandler) AddOperator(c echo.Context) error

AddOperator

func (*HttpHandler) AddSubscribeData

func (h *HttpHandler) AddSubscribeData(c echo.Context) error

func (*HttpHandler) AddVpeData

func (h *HttpHandler) AddVpeData(c echo.Context) error

func (*HttpHandler) ClearRadiusOnline

func (h *HttpHandler) ClearRadiusOnline(c echo.Context) error

func (*HttpHandler) CreateAuthToken

func (h *HttpHandler) CreateAuthToken(operator *models.Operator) (string, error)

func (*HttpHandler) DeleteData

func (h *HttpHandler) DeleteData(c echo.Context) error

DeleteData

func (*HttpHandler) DeleteMikrotikAcsTasks

func (h *HttpHandler) DeleteMikrotikAcsTasks(c echo.Context) error

func (*HttpHandler) DeleteOperator

func (h *HttpHandler) DeleteOperator(c echo.Context) error

DeleteOperator

func (*HttpHandler) ExportData

func (h *HttpHandler) ExportData(c echo.Context) error

ExportData

func (*HttpHandler) FetchExcelData

func (h *HttpHandler) FetchExcelData(c echo.Context, sheet string) ([]map[string]string, error)

func (*HttpHandler) GetConfig

func (h *HttpHandler) GetConfig() *config.AppConfig

func (*HttpHandler) GetData

func (h *HttpHandler) GetData(c echo.Context) error

AddData

func (*HttpHandler) GetDataValues

func (h *HttpHandler) GetDataValues(c echo.Context) error

AddData

func (*HttpHandler) GetInternalError

func (h *HttpHandler) GetInternalError(err interface{}) *echo.HTTPError

func (*HttpHandler) GetJwtData

func (h *HttpHandler) GetJwtData(c echo.Context) jwt.MapClaims

func (*HttpHandler) GetManager

func (h *HttpHandler) GetManager() *models.ModelManager

func (*HttpHandler) GetMikrotikAcsTasks

func (h *HttpHandler) GetMikrotikAcsTasks(c echo.Context) error

func (*HttpHandler) GetRadiusOnlineCountText

func (h *HttpHandler) GetRadiusOnlineCountText(c echo.Context) error

func (*HttpHandler) GetUserId

func (h *HttpHandler) GetUserId(c echo.Context) string

Get current api user id

func (*HttpHandler) GetUserLevel

func (h *HttpHandler) GetUserLevel(c echo.Context) string

Get current api user level

func (*HttpHandler) GetUsername

func (h *HttpHandler) GetUsername(c echo.Context) string

Get current api user name

func (*HttpHandler) GoInternalErrPage

func (h *HttpHandler) GoInternalErrPage(c echo.Context, err interface{}) error

func (*HttpHandler) ImportData

func (h *HttpHandler) ImportData(c echo.Context) error

ImportData

func (*HttpHandler) InitAllRouter

func (h *HttpHandler) InitAllRouter(e *echo.Echo)

func (*HttpHandler) InitRouter

func (h *HttpHandler) InitRouter(group *echo.Group)

func (*HttpHandler) IsManager

func (h *HttpHandler) IsManager(c echo.Context) bool

Get current api user level

func (*HttpHandler) ParseFormInt64

func (h *HttpHandler) ParseFormInt64(c echo.Context, name string) (int64, error)

func (*HttpHandler) ParseJsonBody

func (h *HttpHandler) ParseJsonBody(c echo.Context) (web.RequestParams, error)

解析 JSON POST 参数

func (*HttpHandler) QueryConfig

func (h *HttpHandler) QueryConfig(c echo.Context) error

func (*HttpHandler) QueryCpes

func (h *HttpHandler) QueryCpes(c echo.Context) error

func (*HttpHandler) QueryData

func (h *HttpHandler) QueryData(c echo.Context) error

QueryData

func (*HttpHandler) QueryDataOptions

func (h *HttpHandler) QueryDataOptions(c echo.Context) error

QueryData

func (*HttpHandler) QueryMikrotikDeviceDnsClientServer

func (h *HttpHandler) QueryMikrotikDeviceDnsClientServer(c echo.Context) error

func (*HttpHandler) QueryMikrotikDeviceInterfaces

func (h *HttpHandler) QueryMikrotikDeviceInterfaces(c echo.Context) error

QueryMikrotikDeviceInterfaces

func (*HttpHandler) QueryMikrotikDeviceIpInterfaces

func (h *HttpHandler) QueryMikrotikDeviceIpInterfaces(c echo.Context) error

func (*HttpHandler) QueryMikrotikDevicePPPInterfaces

func (h *HttpHandler) QueryMikrotikDevicePPPInterfaces(c echo.Context) error

func (*HttpHandler) QueryMikrotikDeviceRouters

func (h *HttpHandler) QueryMikrotikDeviceRouters(c echo.Context) error

func (*HttpHandler) QueryOperator

func (h *HttpHandler) QueryOperator(c echo.Context) error

QueryOperator

func (*HttpHandler) QueryPageData

func (h *HttpHandler) QueryPageData(c echo.Context) error

QueryData

func (*HttpHandler) QueryRadiusAccounting

func (h *HttpHandler) QueryRadiusAccounting(c echo.Context) error

func (*HttpHandler) QueryRadiusAuthlog

func (h *HttpHandler) QueryRadiusAuthlog(c echo.Context) error

func (*HttpHandler) QueryRadiusOnline

func (h *HttpHandler) QueryRadiusOnline(c echo.Context) error

func (*HttpHandler) QuerySubscribes

func (h *HttpHandler) QuerySubscribes(c echo.Context) error

func (*HttpHandler) QuerySyslog

func (h *HttpHandler) QuerySyslog(c echo.Context) error

func (*HttpHandler) QueryVpes

func (h *HttpHandler) QueryVpes(c echo.Context) error

func (*HttpHandler) RequestParse

func (h *HttpHandler) RequestParse(c echo.Context) web.RequestParams

func (*HttpHandler) RequestParseForm

func (h *HttpHandler) RequestParseForm(c echo.Context) web.RequestParams

解析表单提交参数

func (*HttpHandler) RequestParseGet

func (h *HttpHandler) RequestParseGet(c echo.Context) web.RequestParams

解析查询参数

func (*HttpHandler) RequestToken

func (h *HttpHandler) RequestToken(c echo.Context) error

func (*HttpHandler) RestError

func (h *HttpHandler) RestError(msg string) *RestResult

func (*HttpHandler) RestResult

func (h *HttpHandler) RestResult(data interface{}) *RestResult

func (*HttpHandler) RestSucc

func (h *HttpHandler) RestSucc(msg string) *RestResult

func (*HttpHandler) RetryMikrotikAcsTasks

func (h *HttpHandler) RetryMikrotikAcsTasks(c echo.Context) error

func (*HttpHandler) RunCpeTr069Policy

func (h *HttpHandler) RunCpeTr069Policy(c echo.Context) error

RunCpeTr069Policy params >> sn string : cpe sn pid string : policy id

func (*HttpHandler) RunMikrotikCpeApiPolicy

func (h *HttpHandler) RunMikrotikCpeApiPolicy(c echo.Context) error

RunCpeApiPolicy params >> sn string : cpe sn pid string : policy id

func (*HttpHandler) RunMikrotikCpeScriptPolicy

func (h *HttpHandler) RunMikrotikCpeScriptPolicy(c echo.Context) error

RunCpeTr069Policy params >> sn string : cpe sn pid string : policy id

func (*HttpHandler) RunMikrotikVpeApiPolicy

func (h *HttpHandler) RunMikrotikVpeApiPolicy(c echo.Context) error

RunMikrotikVpeApiPolicy sn string pid string

func (*HttpHandler) SaveAction

func (h *HttpHandler) SaveAction(c echo.Context) error

SaveAction

func (*HttpHandler) Status

func (h *HttpHandler) Status(c echo.Context) error

func (*HttpHandler) SyncManageUser

func (h *HttpHandler) SyncManageUser(c echo.Context) error

SyncUser sync socks account

func (*HttpHandler) SyncSocksUser

func (h *HttpHandler) SyncSocksUser(c echo.Context) error

SyncUser sync socks account

func (*HttpHandler) TruncateRadiusOnline

func (h *HttpHandler) TruncateRadiusOnline(c echo.Context) error

func (*HttpHandler) UpdateConfig

func (h *HttpHandler) UpdateConfig(c echo.Context) error

func (*HttpHandler) UpdateCpeData

func (h *HttpHandler) UpdateCpeData(c echo.Context) error

func (*HttpHandler) UpdateData

func (h *HttpHandler) UpdateData(c echo.Context) error

UpdateData

func (*HttpHandler) UpdateOperator

func (h *HttpHandler) UpdateOperator(c echo.Context) error

UpdateOperator

func (*HttpHandler) UpdateRadiusConfigs

func (h *HttpHandler) UpdateRadiusConfigs(c echo.Context) error

func (*HttpHandler) UpdateVpeData

func (h *HttpHandler) UpdateVpeData(c echo.Context) error

func (*HttpHandler) UploadCpeBackup

func (h *HttpHandler) UploadCpeBackup(c echo.Context) error

type RestResult

type RestResult struct {
	Code    int         `json:"code"`
	Msgtype string      `json:"msgtype"`
	Msg     string      `json:"msg"`
	Data    interface{} `json:"data"`
}

type WebContext

type WebContext struct {
	Manager *models.ModelManager
	Config  *config.AppConfig
}

type WebHandler

type WebHandler interface {
	InitRouter(group *echo.Group)
}

WebHandler