Documentation ¶
Overview ¶
Package copper encapsulates everything you need to build apps quickly
Index ¶
Constants ¶
This section is empty.
Variables ¶
WireModule can be used as part of google/wire setup to include the app's lifecycle, config, and logger.
Functions ¶
This section is empty.
Types ¶
type App ¶
App defines a Copper app container that can run provided code in its managed lifecycle. It provides functionality to read config in multiple environments as defined by command-line flags.
func New ¶ added in v0.3.4
func New() *App
New provides a convenience wrapper around InitApp that logs and exits if there is an error.
func NewApp ¶
NewApp creates a new Copper app and returns it along with the app's lifecycle manager, config, and the logger.
func (*App) Run ¶
Run runs the provided funcs. Once all of the functions complete their run, the lifecycle's stop funcs are also called. If any of the fns return an error, the app exits with an exit code 1. Run should be used when none of the fn are long-running. For long-running funcs like an HTTP server, use Start.
Directories ¶
Path | Synopsis |
---|---|
Package cconfig provides utilities to read app config files.
|
Package cconfig provides utilities to read app config files. |
cconfigtest
Package cconfigtest provides helper methods to test the cconfig package
|
Package cconfigtest provides helper methods to test the cconfig package |
Package cerrors provides a custom error type that can hold more context than the stdlib error package.
|
Package cerrors provides a custom error type that can hold more context than the stdlib error package. |
Package chttp helps setup a http server with routing, middlewares, and more.
|
Package chttp helps setup a http server with routing, middlewares, and more. |
chttptest
Package chttptest provides utility functions that are useful when testing chttp
|
Package chttptest provides utility functions that are useful when testing chttp |
Package clifecycle provides a Copper app's lifecycle management.
|
Package clifecycle provides a Copper app's lifecycle management. |
Package clogger provides a Logger interface that can be used to log messages and errors
|
Package clogger provides a Logger interface that can be used to log messages and errors |
Package csql helps create and manage database connections
|
Package csql helps create and manage database connections |