core

package
v0.0.0-...-3f65eb9 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: MIT Imports: 22 Imported by: 0 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 HTTPErrorHandler

func HTTPErrorHandler(err error, c echo.Context)

func NewRouter

func NewRouter(server *Server) *echo.Echo

Types

type CacheStore

type CacheStore struct {
	Cache *redis.Client
}

CacheStore simple redis implementation

func (*CacheStore) Get

func (s *CacheStore) Get(key string) (string, error)

func (*CacheStore) Ping

func (s *CacheStore) Ping() error

func (*CacheStore) Set

func (s *CacheStore) Set(key string, value interface{}, exp time.Duration) (string, error)

type Server

type Server struct {
	Echo *echo.Echo // HTTP middleware
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *config.Configuration) *Server

NewServer will create a new instance of the application

func (*Server) GetCache

func (s *Server) GetCache() *redis.Client

GetCache returns the current redis client

func (*Server) GetConfig

func (s *Server) GetConfig() *config.Configuration

GetConfig return the current app configuration

func (*Server) GetDB

func (s *Server) GetDB() *gorm.DB

GetDB returns gorm (ORM)

func (*Server) GetModelRegistry

func (s *Server) GetModelRegistry() *models.Model

GetModelRegistry returns the model registry

func (*Server) GracefulShutdown

func (s *Server) GracefulShutdown()

GracefulShutdown Wait for interrupt signal to gracefully shutdown the server with a timeout of 5 seconds.

func (*Server) ServeStaticFiles

func (s *Server) ServeStaticFiles()

ServeStaticFiles serve static files for development purpose

func (*Server) Start

func (s *Server) Start(addr string) error

Start the http server

type UserStore

type UserStore struct {
	DB *gorm.DB
}

UserStore implements the UserStore interface

func (*UserStore) Create

func (s *UserStore) Create(m *models.User) error

func (*UserStore) First

func (s *UserStore) First(m *models.User) error

func (*UserStore) Ping

func (s *UserStore) Ping() error

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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