ReadConfig

package
v0.0.0-...-3e87f45 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Author: NyanCatda * @Date: 2022-03-08 21:25:31 * @LastEditTime: 2022-03-08 21:31:34 * @LastEditors: NyanCatda * @Description: 配置文件模块 * @FilePath: \Momizi\Tools\ReadConfig\ReadConfig.go

Index

Constants

This section is empty.

Variables

View Source
var (
	GetConfig  *Config
	ConfigPath string
)

Functions

func LoadConfig

func LoadConfig() error

*

  • @description: 加载配置文件
  • @param {*}
  • @return {*}

Types

type Config

type Config struct {
	Run struct {
		WebHook struct {
			Port string `yaml:"Port"` // WebHook接收端口
			Key  string `yaml:"Key"`  // WebHook接收密钥
		} `yaml:"WebHook"`
	} `yaml:"Run"`
	ChatSoftware struct {
		Mirai struct {
			Switch      bool   `yaml:"Switch"`      // Mirai处理开关
			APILink     string `yaml:"APILink"`     // Mirai API地址
			BotQQNumber int    `yaml:"BotQQNumber"` // Mirai机器人QQ号
			VerifyKey   string `yaml:"VerifyKey"`   // Mirai验证密钥
		} `yaml:"QQ"`
		Telegram struct {
			Switch   bool   `yaml:"Switch"`   // Telegram处理开关
			APIToken string `yaml:"APIToken"` // Telegram Bot API Token
			APILink  string `yaml:"APILink"`  // Telegram Bot API地址
		} `yaml:"Telegram"`
		Line struct {
			Switch      bool   `yaml:"Switch"`      // Line处理开关
			APIToken    string `yaml:"APIToken"`    // Line Bot API Token
			APILink     string `yaml:"APILink"`     // Line Bot API地址
			DataAPILink string `yaml:"DataAPILink"` // Line Bot 数据下载API地址
		} `yaml:"Line"`
	} `yaml:"ChatSoftware"`
}

func (*Config) CheckConfig

func (value *Config) CheckConfig() error

*

  • @description: 检查配置文件字段是否为空
  • @param {*}
  • @return {error}

Jump to

Keyboard shortcuts

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