app

package
Version: v0.0.0-...-c6e1f3d Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 9 Imported by: 0

README

项目配置目录

Documentation

Overview

Copyright (c) 2020 HXS R&D Technologies, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@Title main @Description Description

@Author zhongyongbiao 2020/9/4 下午2:05 @Version 1.0.0 @Software hxsapp-base-gin

Copyright (c) 2020 HXS R&D Technologies, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@Title session @Description

@Author zhongyongbiao @Version 1.0.0 @Time 2020/7/14 下午2:45 @Software GoLand

Index

Constants

This section is empty.

Variables

View Source
var (
	Name                  = "gin-framework"
	Version               = "1.0.0"
	HttpServerDefaultAddr = "0.0.0.0:9010"
	LogDir                = "/apps/logs/go/gin-framework"
	ErrorRobotToken       = ""
	GracefulRobotToken    = ""

	HttpServerAddr *string
	Engine         *gin.Engine
	Logger         *zap.Logger
	DebugStack     bool
	RobotEnable    bool

	ReqStrKey = "gin-gonic/gin/reqstr"
	TokenKey  = ""
)
View Source
var (
	DB = map[string]MysqlDialect{
		"test": {
			Host: os.Getenv("mysql_test_host"),
			User: os.Getenv("mysql_test_username"),
			Pwd:  os.Getenv("mysql_test_password"),
			Db:   os.Getenv("mysql_test_database"),
			Port: os.Getenv("mysql_test_port"),
		},
	}
)
View Source
var (
	Redis = RedisClientKey{
		Client: map[string]RedisClient{
			"cache": {
				Host: os.Getenv("redis_host"),
				Port: os.Getenv("redis_port"),
				Pwd:  os.Getenv("redis_password"),
				Db:   0,
			},
			"session": {
				Host: os.Getenv("redis_session_host"),
				Port: os.Getenv("redis_session_port"),
				Pwd:  os.Getenv("redis_session_password"),
				Db:   0,
			},
		},
		Key: redisKey{
			Session: session{
				StringSessToken: "ci_session:",
			},
		},
	}
)
View Source
var Session = SessionConfig{
	TokenKey:       "gin-gonic/gin/sesstoken",
	DataKey:        "gin-gonic/gin/sessdata",
	LoggedUidKey:   "gin-gonic/gin/loggeduserid",
	UpdateDuration: 5 * time.Minute,
	Expiration:     6 * 30 * 86400,
}

Functions

func ServerRun

func ServerRun()

Types

type MysqlDialect

type MysqlDialect struct {
	User, Pwd, Host, Port, Db string
}

type RedisClient

type RedisClient struct {
	Host, Port, Pwd string
	Db              int
}

type RedisClientKey

type RedisClientKey struct {
	Client map[string]RedisClient
	Key    redisKey
}

type SessionConfig

type SessionConfig struct {
	TokenKey, DataKey, LoggedUidKey string
	UpdateDuration                  time.Duration
	Expiration                      int64
}

Jump to

Keyboard shortcuts

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