glock

package module
v0.0.0-...-7c5ca0a Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2017 License: MPL-2.0 Imports: 5 Imported by: 0

README

glock

a locked down golang project foundation

confirm dev setup
  • make dev will start a local golang server instance
  • curl localhost:8080/api/health/ping should return back Pong and log Ping on the server
confirm docker setup
  • make docker will start two development servers locally
  • curl localhost:8080/api/health/check should return back the time
confirm pg setup
  • make pg-setup will setup a local postgres docker volume
  • make pg-run will start a local postgres instance
helpful tools
  • docker ps will show all currently running containers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version  string
	LogLevel int
}

Config is the server configuration

func NewConfig

func NewConfig() Config

NewConfig creates a new server configuration It requires ENV vars:

VERSION
MODE

func (*Config) IsDebug

func (c *Config) IsDebug() bool

IsDebug returns if the configuration is in debug mode

type Server

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

Server is an http gateway

func New

func New(config Config) *Server

New creates a new Server

func (*Server) MountRoute

func (s *Server) MountRoute(path string, r Service, m ...echo.MiddlewareFunc) error

MountRoute mounts a service

func (*Server) Start

func (s *Server) Start(port uint) error

Start starts the server at the specified port

type Service

type Service interface {
	Mount(c Config, r *echo.Group, l *logrus.Logger) error
}

Service is an interface for services

Directories

Path Synopsis
cmd
service

Jump to

Keyboard shortcuts

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