config

package
v0.0.0-...-4e8f025 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

* @Author: fzf404 * @Date: 2022-08-18 11:01:34 * @LastEditors: fzf404 nmdfzf404@163.com * @LastEditTime: 2022-08-25 19:08:21 * @Description: 配置模型

Index

Constants

This section is empty.

Variables

View Source
var (
	POSTGRESDB *gorm.DB
	REDISDB    *redis.Client
	CONFIG     Config
)

Functions

func InitConfig

func InitConfig()

Types

type Config

type Config struct {
	Mode     Mode
	Http     Http
	Redis    Redis
	Postgres Postgres
	Limit    Limit
	Cors     Cors
}

type Cors

type Cors struct {
	Enable bool

	AllowOrigins []string
	AllowMethods []string
	AllowHeaders []string
}

type Http

type Http struct {
	Url  string
	Host string
	Port string
}

type Limit

type Limit struct {
	Request int64
	Content int
}

type Mode

type Mode struct {
	RunMode string
}

type Postgres

type Postgres struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
}

func (Postgres) Dsn

func (r Postgres) Dsn() string

type Redis

type Redis struct {
	Addr     string
	Password string
}

Jump to

Keyboard shortcuts

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