server

package
v0.0.0-...-ea61496 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWebPage

func GetWebPage(url string) (string, error)

func IsExist

func IsExist(f string) bool

IsExist checks whether a file or directory exists. It returns false when the file or directory does not exist.

func PluginDetailedInfoPage

func PluginDetailedInfoPage(ctx *fasthttp.RequestCtx)

func PluginListPage

func PluginListPage(ctx *fasthttp.RequestCtx)

func ReadFile

func ReadFile(path string) (string, error)

func RunMiraiApiServer

func RunMiraiApiServer()

Types

type BasicPluginInfo

type BasicPluginInfo struct {
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Author      string   `json:"author"`
	Core        string   `json:"core"`
	Console     string   `json:"console"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
	Commands    []string `json:"commands"`
}

type MiraiApiServer

type MiraiApiServer struct {
	ConfigPath   string
	Config       map[string]string
	Logger       *logger.MiraiLogger
	Router       *fasthttprouter.Router
	Service      *Service
	NotFoundPage string //提前写入内存
}

func GetMiraiApiServer

func GetMiraiApiServer() *MiraiApiServer

func (*MiraiApiServer) ConstructPluginPath

func (this *MiraiApiServer) ConstructPluginPath() string

func (*MiraiApiServer) Init

func (this *MiraiApiServer) Init()

type Plugin

type Plugin struct {
	BasicInfo BasicPluginInfo
	JsonFile  string
}

type ResponseInfo

type ResponseInfo struct {
	Success bool        `json:"success"`
	Info    string      `json:"info"`
	Result  interface{} `json:"result"`
}

type Service

type Service struct {
	PluginPathList      []string
	PluginInfoList      []Plugin
	PluginBasicJsonInfo []BasicPluginInfo
	PluginInfoMap       map[string]Plugin
	// contains filtered or unexported fields
}

func GetService

func GetService() *Service

Jump to

Keyboard shortcuts

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