core

package
v0.0.0-...-ae67dfe Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bin2Hex

func Bin2Hex(b []byte) string

func DecodeIdToBase64

func DecodeIdToBase64(input string) string

func EncodeIdToBase64

func EncodeIdToBase64(input string) string

func GobMarshal

func GobMarshal(v interface{}) ([]byte, error)

func GobUnmarshal

func GobUnmarshal(data []byte, v interface{}) error

func Hex2bin

func Hex2bin(s string) []byte

func Microtime

func Microtime() string

func Uniqid

func Uniqid(prefix string, has_entropy bool) string

func UrlsafeBase64Encode

func UrlsafeBase64Encode(input string) string

Types

type AppContext

type AppContext struct {
	echo.Context

	AppDB       *mongo.Database
	AppDBCtx    context.Context
	AppDBClient *mongo.Client

	AppMemcached *memcache.Client

	Env *AppEnv
}

func NewAppContext

func NewAppContext(c echo.Context, cfg *config.Config) (*AppContext, error)

type AppDB

type AppDB struct {
	Ctx    context.Context
	DB     *mongo.Database
	Client *mongo.Client
}

func NewAppDB

func NewAppDB(db_config config.DBConfig) (*AppDB, error)

@params

mongodb_uri = mongodb://localhost:27017
db_name = app
timeout = 10

type AppEnv

type AppEnv struct {
	Config *config.Config
}

func NewAppEnv

func NewAppEnv(cfg *config.Config) (*AppEnv, error)

func (*AppEnv) GetDatabase

func (ae *AppEnv) GetDatabase() config.DBConfig

func (*AppEnv) GetEnvName

func (ae *AppEnv) GetEnvName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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