lib

package
v0.0.0-...-ac8e0da Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package lib contains all application libraries.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongDateFormat = errors.New(`Formato de fecha erróneo - use MM/DD/YYYY instead. \n`)
)

Functions

This section is empty.

Types

type App

type App struct {
	Log         *Logger
	Config      *Config
	Environment string
	Version     string
	Name        string
	// contains filtered or unexported fields
}

App is a principal structure where we join all application components.

func NewApp

func NewApp() (application *App)

NewApp initialize all App fields

func (*App) Parse

func (a *App) Parse(args []string)

Parse all command line arguments

type Config

type Config struct {
	Pwd          string
	Filename     string
	IsProduction bool
	*conf.Config
}

Config models an entity config reader

func NewConfig

func NewConfig() (config *Config)

NewConfig creates a config struct.

func (*Config) BooleanDefault

func (c *Config) BooleanDefault(property string, boolDefault bool) (result bool)

BooleanDefault function gets config property from default section or use default boolean value

func (*Config) Default

func (c *Config) Default(property string) (result string)

Default function gets config property from default section

func (*Config) File

func (c *Config) File() (file string)

File function returns configuration file path

func (*Config) StringDefault

func (c *Config) StringDefault(property string, strDefault string) (result string)

StringDefault gets config property from default section or use default value

type Create

type Create struct {
	Name string
}

Create struct contains all about migration script creation

func (*Create) Run

func (cmd *Create) Run(c *kingpin.ParseContext) (err error)

Run generates a new migration file

type Logger

type Logger struct {
	*logging.Logger
}

Logger represents a logger strut

func GetLogger

func GetLogger() (l *Logger)

GetLogger configure and returns logger struct

func (*Logger) IfDebug

func (l *Logger) IfDebug(args ...interface{})

IfDebug is used when you want to print only in debug mode.

type Up

type Up struct {
	*time.Serie
}

Up command execute pending migrations

func NewUpCommand

func NewUpCommand() (cmd *Up)

NewUpCommand initialize new Create command.

func (*Up) Run

func (cmd *Up) Run(c *kingpin.ParseContext) (err error)

Run execute the migration command

Directories

Path Synopsis
Package io encapsulate any file system access
Package io encapsulate any file system access
Package time encapsulate common logic with related time operations
Package time encapsulate common logic with related time operations

Jump to

Keyboard shortcuts

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