svc

package
v0.0.0-...-31439ab Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIGatewayConfig

type APIGatewayConfig struct {
	PEM        string `yaml:"pem"`
	PrivateKey string `yaml:"privateKey"`
	Host       string `yaml:"host"`
	Port       int    `yaml:"port"`
	APIPort    int    `yaml:"apiPort"`
	HTTPSPort  int    `yaml:"httpsPort"`
	IndexPath  string `yaml:"indexPath"`
	AssetsPath string `yaml:"assetsPath"`
	StaticPath string `yaml:"staticPath"`
}

type CQHttpBot

type CQHttpBot struct {
	Prefix  string `yaml:"prefix"`  // 命令头 如 .
	Address string `yaml:"address"` // http 地址
	Post    int    `yaml:"post"`    // 反向HTTP地址, 需要robot开启一个地址
}

type Config

type Config struct {
	GlobalConfig     GlobalConfig     `yaml:"global"`
	APIGatewayConfig APIGatewayConfig `yaml:"apiGateway"`
	Robot            RobotConfig      `yaml:"robot"`
}

func (*Config) Load

func (c *Config) Load(file string) error

type DBConfig

type DBConfig struct {
	Driver string `yaml:"driver"`
	DSN    string `yaml:"dsn"`
}

type EmailConfig

type EmailConfig struct {
	SmtpHost string `yaml:"smtpHost"`
	SmtpPort int    `yaml:"smtpPort"`
	From     string `yaml:"from"`
	FromName string `yaml:"fromName"`
	Password string `yaml:"password"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug       bool        `yaml:"debug"`
	BaseHost    string      `yaml:"baseHost"`
	XStaticPath string      `yaml:"xStaticPath"`
	XFilePath   string      `yaml:"xFilePath"`
	DB          DBConfig    `yaml:"db"`
	EmailConfig EmailConfig `yaml:"emailConfig"`
}

type QQBotConfig

type QQBotConfig struct {
	Group     bool     `yaml:"group"`
	Enable    bool     `yaml:"enable"`
	AppID     int      `yaml:"appID"`
	Token     string   `yaml:"token"`
	GroupList []string `yaml:"groupList"`
}

type RobotConfig

type RobotConfig struct {
	CQHttpBot []CQHttpBot `yaml:"CQHttpBot"` // cq http qq机器人

	QQBot     []QQBotConfig     `yaml:"QQBot"`
	WeChatBot []WeChatBotConfig `yaml:"WeChatBot"`
}

type Svc

type Svc struct {
	DB    *gorm.DB
	Cache *cache.Cache
	Cfg   Config
	Cov   convenient.ConvenientI
}

func NewAPISvc

func NewAPISvc(file string) (*Svc, error)

type WeChatBotConfig

type WeChatBotConfig struct {
	Enable bool `yaml:"enable"`
}

Jump to

Keyboard shortcuts

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