Documentation ¶
Overview ¶
Package box is a bootstrap to help you build mirco services easily.
Example ¶
Example this is a ping-pong http server.
package main import ( "github.com/boxgo/box" "github.com/boxgo/box/pkg/logger" "github.com/boxgo/box/pkg/server/ginserver" "github.com/gin-gonic/gin" ) func main() { ginserver.Default.GET("/ping", func(ctx *gin.Context) { ctx.JSON(200, "pong") }) app := box.New( box.WithBoxes( ginserver.Default, ), ) if err := app.Run(); err != nil { logger.Errorw("server run error: ", "err", err) } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface {
Run() error
}
type Option ¶
type Option func(ops *Options)
Option setter
func WithAutoMaxProcs ¶ added in v1.0.0
WithAutoMaxProcs
func WithStartupTimeout ¶
Directories ¶
Path | Synopsis |
---|---|
pkg
|
|
client/rabbitmq
Package rabbitmq is an AMQP 0.9.1 client with RabbitMQ extensions in Go.
|
Package rabbitmq is an AMQP 0.9.1 client with RabbitMQ extensions in Go. |
codec
Package codec handles source encoding formats
|
Package codec handles source encoding formats |
config
Package config is an interface for dynamic configuration.
|
Package config is an interface for dynamic configuration. |
config/loader
Package loader manages loading from multiple sources
|
Package loader manages loading from multiple sources |
config/reader
Package reader parses change sets and provides config values
|
Package reader parses change sets and provides config values |
config/source
Package source is the interface for sources
|
Package source is the interface for sources |
config/source/file
Package file is a file source.
|
Package file is a file source. |
schedule
Package schedule is to help you manage schedule tasks.
|
Package schedule is to help you manage schedule tasks. |
server/ginserver/mid/ginlog
Package ginlog is gin server logger middleware.
|
Package ginlog is gin server logger middleware. |
server/ginserver/mid/ginsession
Package ginsession is gin server session middleware.
|
Package ginsession is gin server session middleware. |
Click to show internal directories.
Click to hide internal directories.