helium

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2018 License: MIT Imports: 11 Imported by: 0

README

Helium

logo
  • bind - simple replacement for echo.Binder
  • cli - simple cli-wrapper for building apps
  • examples - of application
  • logger - simple package with global / echo logger
  • orm - connect to PG database and check connection
  • redis - connect to redis and check connection
  • settings - wrapper around viper
  • validate - simple replacement for echo.Validate

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config)

Types

type ActionFunc

type ActionFunc func(ctx Context) error

type App

type App interface {
	Commands() []Command
}

type Command

type Command struct {
	// Init method to invoke dependencies
	Init func(di Container) error
	// An action to execute after any subcommands are run, but after the subcommand has finished
	// It is run even if Action() panics
	After cli.AfterFunc
	// An action to execute before any sub-subcommands are run, but after the context is ready
	// If a non-nil error is returned, no sub-subcommands are run
	Before cli.BeforeFunc
	// The function to call when this command is invoked
	Action ActionFunc
	// The name of the command
	Name string
	// short name of the command. Typically one character (deprecated, use `Aliases`)
	ShortName string
	// A list of aliases for the command
	Aliases []string
	// A short description of the usage of this command
	Usage string
}

type Config

type Config struct {
	App       App
	File      string
	Name      string
	Version   string
	BuildTime string
}

type Container

type Container interface {
	Invoke(function interface{}, opts ...InvokeOption) error
	Provide(constructor interface{}, opts ...ProvideOption) error
}

type Context

type Context interface {
	Command() *cli.Context
	Graceful() context.Context
}

type InvokeOption

type InvokeOption = dig.InvokeOption

type ProvideOption

type ProvideOption = dig.ProvideOption

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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