pkg

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config    *AppConfig
	DB        *sql.DB
	Cache     *lru.Cache
	CacheSize int = 512
)

Functions

func CloseRowsDefer

func CloseRowsDefer(rows *sql.Rows)

*

  • close rows defer

func GetDB

func GetDB(config *AppConfig) *sql.DB

func GetMinutes

func GetMinutes() string

func InitApp

func InitApp()

func LogError

func LogError(err error)

*

  • Logging error

func LogInfo

func LogInfo(msg string)

*

  • Logging info

func OutPutHtml

func OutPutHtml(c *gin.Context, s string)

func OutPutText

func OutPutText(c *gin.Context, s string)

Types

type AppConfig

type AppConfig struct {
	Dbdsn            string
	Admin_user       string
	Admin_password   string
	Site_name        string
	Site_description string
	SrvMode          string
	ObjectStorage    struct {
		Aws_access_key_id     string
		Aws_secret_access_key string
		Aws_region            string
		Aws_bucket            string
		Cdn_url               string
	}
}

func GetConfig

func GetConfig() *AppConfig

type Msg

type Msg struct {
	Msg string
}

func (*Msg) ShowMessage

func (m *Msg) ShowMessage(c *gin.Context)

* ShowMessage with template

type ShowMessage

type ShowMessage interface {
	ShowMessage(c *gin.Context)
}

type Umsg

type Umsg struct {
	Msg string
	Url string
}

func (*Umsg) ShowMessage

func (m *Umsg) ShowMessage(c *gin.Context)

type VBlogItem

type VBlogItem struct {
	Aid            int
	Title          sql.NullString
	Content        sql.NullString
	Publish_time   sql.NullString
	Publish_status sql.NullInt64
	Views          int
}

Jump to

Keyboard shortcuts

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