config

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Overview

Package config 包含go-cqhttp操作配置文件的相关函数

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServer

func AddServer(s *Server)

AddServer 添加该服务的简介和默认配置

Types

type Account

type Account struct {
	Uin              int64      `yaml:"uin"`
	Password         string     `yaml:"password"`
	Encrypt          bool       `yaml:"encrypt"`
	Status           int        `yaml:"status"`
	ReLogin          *Reconnect `yaml:"relogin"`
	UseSSOAddress    bool       `yaml:"use-sso-address"`
	AllowTempSession bool       `yaml:"allow-temp-session"`
}

Account 账号配置

type Config

type Config struct {
	Account   *Account `yaml:"account"`
	Heartbeat struct {
		Disabled bool `yaml:"disabled"`
		Interval int  `yaml:"interval"`
	} `yaml:"heartbeat"`

	Message struct {
		PostFormat          string `yaml:"post-format"`
		ProxyRewrite        string `yaml:"proxy-rewrite"`
		IgnoreInvalidCQCode bool   `yaml:"ignore-invalid-cqcode"`
		ForceFragment       bool   `yaml:"force-fragment"`
		FixURL              bool   `yaml:"fix-url"`
		ReportSelfMessage   bool   `yaml:"report-self-message"`
		RemoveReplyAt       bool   `yaml:"remove-reply-at"`
		ExtraReplyData      bool   `yaml:"extra-reply-data"`
		SkipMimeScan        bool   `yaml:"skip-mime-scan"`
	} `yaml:"message"`

	Output struct {
		LogLevel    string `yaml:"log-level"`
		LogAging    int    `yaml:"log-aging"`
		LogForceNew bool   `yaml:"log-force-new"`
		LogColorful *bool  `yaml:"log-colorful"`
		Debug       bool   `yaml:"debug"`
	} `yaml:"output"`

	Servers  []map[string]yaml.Node `yaml:"servers"`
	Database map[string]yaml.Node   `yaml:"database"`
}

Config 总配置文件

func Parse

func Parse(path string) *Config

Parse 从默认配置文件路径中获取

type Reconnect

type Reconnect struct {
	Disabled bool `yaml:"disabled"`
	Delay    uint `yaml:"delay"`
	MaxTimes uint `yaml:"max-times"`
	Interval int  `yaml:"interval"`
}

Reconnect 重连配置

type Server

type Server struct {
	Brief   string
	Default string
}

Server 的简介和初始配置

Jump to

Keyboard shortcuts

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