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 chtml provides utilities to render HTML pages and for single-page apps
|
Package chtml provides utilities to render HTML pages and for single-page apps |
|
chtmltest
Package chtmltest provides utilities to test the chtml package
|
Package chtmltest provides utilities to test the chtml 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 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 |