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) Find

func (s *UserStore) Find(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
errors
middleware