core

package
v0.0.0-...-8c66a01 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIServer = gin.Default()
View Source
var CurrentDB *gorm.DB = nil
View Source
var MESSAGE_ERROR int = 0
View Source
var MESSAGE_OK int = 1
View Source
var SESSION_SECRET string = "changeme"

Functions

func ConnectDB

func ConnectDB()

func Count

func Count()

func CountByTime

func CountByTime(c *gin.Context)

func DSN

func DSN() string

func InitCounters

func InitCounters()

func InitRouter

func InitRouter()

func ListCommits

func ListCommits(c *gin.Context)

func NewCounter

func NewCounter()

Types

type Config

type Config struct {
	Server *ServerConfig `mapstructure:"server"`
	DB     *DBConfig     `mapstructure:"db"`
	Oauth  *OauthConfig  `mapstructure:"oauth"`
}
var CurrentConfig *Config = &Config{}

type DBConfig

type DBConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	Database string `mapstructure:"database"`
}

type Message

type Message struct {
	Code    int
	Payload interface{}
}

func NewMessage

func NewMessage(code int, payload interface{}) *Message

type OauthConfig

type OauthConfig struct {
	Provider     string `mapstructure:"provider"`
	ClientID     string `mapstructure:"client-id"`
	ClientSecret string `mapstructure:"client-secret"`
	RedirectURL  string `mapstructure:"redirect-url"`
}

type ServerConfig

type ServerConfig struct {
	Port   int    `mapstructure:"port"`
	Secret string `mapstructure:"secret"`
}

Jump to

Keyboard shortcuts

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