server

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

README

PUSH 数据收集后端

示例:

LOG:
GET

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	LogLevel: "info",
	Db: &Db{
		Type: "mysql",
		Host: "root:password@tcp(127.0.0.1:3306)/hkrpg-go-push?charset=utf8mb4&parseTime=True&loc=Local",
	},
	Host: "127.0.0.1",
	Port: "3000",
	Email: &Email{
		Is:       false,
		From:     "123456789@qq.com",
		Addr:     "smtp.qq.com:587",
		Host:     "smtp.qq.com",
		Identity: "123456789",
	},
	Webhooks: &Webhooks{
		Is:    false,
		Info:  "",
		Error: "",
	},
}
View Source
var FileNotExist = errors.New("config file not found")
View Source
var WebhookClient *resty.Client

Functions

func Default

func Default(c *gin.Context)

func LoadConfig

func LoadConfig(confName string) error

func NewServer

func NewServer(done chan os.Signal, cfg *Config) error

Types

type Config

type Config struct {
	LogLevel string    `json:"LogLevel"`
	Db       *Db       `json:"Db"`
	Host     string    `json:"Host"`
	Port     string    `json:"Port"`
	Email    *Email    `json:"Email"`
	Webhooks *Webhooks `json:"Webhooks"`
}
var CONF *Config = nil

func GetConfig

func GetConfig() *Config

type Db

type Db struct {
	Type string `json:"Type"`
	Host string `json:"Host"`
}

type Email

type Email struct {
	Is       bool   `json:"Is"`
	From     string `json:"from"`
	Addr     string `json:"addr"`
	Host     string `json:"host"`
	Identity string `json:"identity"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) GetLog

func (s *Server) GetLog(c *gin.Context)

func (*Server) PushLog

func (s *Server) PushLog(c *gin.Context)

func (*Server) WebHooks

func (s *Server) WebHooks(msg string, url string)

type Webhooks

type Webhooks struct {
	Is    bool   `json:"Is"`
	Info  string `json:"Info"`
	Error string `json:"Error"`
}

Jump to

Keyboard shortcuts

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