config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 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"`
	SignServers          []SignServer `yaml:"sign-servers"`
	RuleChangeSignServer int          `yaml:"rule-change-sign-server"`
	MaxCheckCount        uint         `yaml:"max-check-count"`
	SignServerTimeout    uint         `yaml:"sign-server-timeout"`
	IsBelow110           bool         `yaml:"is-below-110"`
	AutoRegister         bool         `yaml:"auto-register"`
	AutoRefreshToken     bool         `yaml:"auto-refresh-token"`
	RefreshInterval      int64        `yaml:"refresh-interval"`
}

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"`
		ConvertWebpImage    bool   `yaml:"convert-webp-image"`
		HTTPTimeout         int    `yaml:"http-timeout"`
	} `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 的简介和初始配置

type SignServer added in v1.2.0

type SignServer struct {
	URL           string `yaml:"url"`
	Key           string `yaml:"key"`
	Authorization string `yaml:"authorization"`
}

SignServer 签名服务器

Jump to

Keyboard shortcuts

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