boost

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 9 Imported by: 0

README

Boost

Go

Overview

Boost is a modular and extensible framework for Go application development, designed to simplify the creation of robust, scalable, and observable services. The framework provides a comprehensive set of components that can be used independently or combined to build complete applications.

Key Features

  • Modular Architecture: Independent components that can be used as needed
  • Dependency Injection: Flexible system for managing dependencies between components
  • Integrated Observability: Native support for metrics, logging, and tracing
  • Adapters for Popular Libraries: Consistent wrappers for various libraries in the Go ecosystem
  • Design Patterns: Implementations of patterns such as Factory, Middleware, and Wrapper
  • CloudEvents Support: Native integration with the CloudEvents standard
  • Extensibility: Easy to add support for new libraries and frameworks

Project Structure

The project is organized into modular packages, each with specific responsibilities:

  • annotation: Annotations read from Go doc comments (// @Name(key=value))
  • bootstrap: Components for application initialization
  • builder: Generator of REST, gRPC, MCP and function doors from @REST/@GRPC/@MCP/@Function annotations, on top of inject
  • examples: Framework usage examples
  • extra: Additional functionalities (health checks, middleware, multiserver)
  • factory: Factory pattern implementations for various components
  • fx: Dependency injection and lifecycle management
  • inject: Generator of fx modules from @Provide/@Inject/@Invoke annotations
  • model: Data structures and interfaces definitions
  • utils: Various utilities
  • wrapper: Adapters for external libraries (cache, config, log, publisher)

Getting Started

Prerequisites
  • Go 1.18 or higher
  • Specific dependencies vary according to the components used
Installation
go get github.com/xgodev/boost
Basic Example
package main

import (
	"github.com/xgodev/boost"
	"github.com/xgodev/boost/factory/contrib/go.uber.org/zap/v1"
	"github.com/xgodev/boost/wrapper/log"
	"os"
)

func init() {
	os.Setenv("BOOST_FACTORY_ZAP_CONSOLE_FORMATTER", "JSON")
	os.Setenv("BOOST_FACTORY_ZAP_CONSOLE_LEVEL", "DEBUG")
}

func main() {
	boost.Start()
	log.Set(zap.NewLogger())
	log.Infof("hello world!!")
}
Claude Code plugin

AI agents get boost-shaped Go guidance (Iron Laws, Echo APIs, event-driven functions, contrib layout) plus the Quality Gate through the all-in-one claude-plugin@xgodev plugin (repo xgodev/claude-plugin). Install once in your Claude Code session:

/plugin marketplace add xgodev/claude-plugin
/plugin install claude-plugin@xgodev

The plugin is maintained in its own repo; this framework repo ships no plugin skills or marketplace.

Main Components

Bootstrap

The Bootstrap package provides components for application initialization, including support for serverless functions and event processing.

Bootstrap Documentation

Factory

The Factory package implements the Factory design pattern for various components, facilitating the creation and configuration of complex objects.

Factory Documentation

Wrapper

The Wrapper package provides adapters for external libraries, including cache, configuration, logging, and message publishing.

Wrapper Documentation

FX

The FX package provides dependency injection and component lifecycle management functionalities.

FX Documentation

Annotation

The Annotation package collects // @Name(key=value) annotations from Go doc comments and returns the annotated structs, methods and functions, for code generators to build on.

Annotation Documentation

Inject

The Inject package generates fx modules from @Provide, @Inject and @Invoke comment annotations, checking the dependency graph at generation time.

Inject Documentation

Builder

The Builder package generates the doors of an application (REST routes on echo, gRPC services, MCP tools and the event function) from @REST, @GRPC, @MCP and @Function annotations, one Modules() and the main of every app, on top of inject.

Builder Documentation

Extra

The Extra package includes additional functionalities such as health checks, middleware, and support for multiple servers.

Extra Documentation

Boost offers extensive integrations with a wide range of technologies:

Cloud Providers
  • AWS: AWS SDK integration for various services
  • Google Cloud Platform:
    • Pub/Sub
    • BigQuery
    • Firestore
    • API integration
    • gRPC
Databases
  • MongoDB: Native driver integration
  • PostgreSQL: pgx driver
  • Oracle: godror driver
  • CockroachDB: Compatible with PostgreSQL drivers
  • Cassandra: gocql driver
  • BuntDB: In-memory key/value database
  • MemDB: In-memory database with immutable radix tree
Caching
  • Redis: go-redis client
  • BigCache: In-memory caching system
  • FreeCache: Zero GC cache library
Messaging & Event Systems
  • NATS: Lightweight messaging system
  • Kafka: Confluent Kafka Go client
  • CloudEvents: SDK for CloudEvents standard
  • Go Cloud Pub/Sub: Cloud-agnostic pub/sub API
Web & API
  • Echo: High performance web framework
  • gRPC: High performance RPC framework
  • GraphQL: GraphQL server implementation
  • Swagger: API documentation with echo-swagger
Observability
  • Prometheus: Metrics and monitoring
  • OpenTelemetry: Observability framework
  • Datadog: APM and monitoring
  • Zap: Structured logging
  • Zerolog: Zero-allocation JSON logger
  • Logrus: Structured logger
Configuration
  • Koanf: Lightweight, extensible configuration management
  • Cobra: CLI application library
  • Viper: Configuration solution (via Koanf)
Resilience & Patterns
  • Hystrix: Latency and fault tolerance library
  • Ants: Goroutine pool
  • FTP: FTP client
  • Kubernetes: Client-go integration
  • Vault: HashiCorp Vault client
Serialization
  • JSON: Multiple implementations (standard, go-json)
  • MessagePack: Binary serialization
  • GOB: Go's native binary format

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a branch for your feature (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the terms included in the LICENSE file.

Contact

For questions, suggestions, or contributions, please open an issue in the GitHub repository.


Developed with ❤️ by the xgodev community.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationName

func ApplicationName() string

func Start

func Start()

Types

This section is empty.

Directories

Path Synopsis
examples/decode command
examples/func command
examples/method command
examples/simple command
Package builder generates the doors of an application (REST routes on echo, gRPC services, MCP tools and event functions) from @REST, @GRPC, @MCP and @Function annotations, on top of the fx modules generated by inject.
Package builder generates the doors of an application (REST routes on echo, gRPC services, MCP tools and event functions) from @REST, @GRPC, @MCP and @Function annotations, on top of the fx modules generated by inject.
cmd/builder command
Command builder generates the inject modules, the door modules and the main of every app from the annotations of an application, in one pass.
Command builder generates the inject modules, the door modules and the main of every app from the annotations of an application, in one pass.
examples/simple
Package simple is an application whose doors come from builder annotations: app api serves REST routes on two echo servers (rest and admin), a gRPC health service and the check_stock MCP tool; app worker records the orders of order.created events.
Package simple is an application whose doors come from builder annotations: app api serves REST routes on two echo servers (rest and admin), a gRPC health service and the check_stock MCP tool; app worker records the orders of order.created events.
examples/simple/cmd/api command
Command api runs app api: the doors builder generates in github.com/xgodev/boost/builder/examples/simple/gen/builder/api.
Command api runs app api: the doors builder generates in github.com/xgodev/boost/builder/examples/simple/gen/builder/api.
examples/simple/cmd/worker command
Command worker runs app worker: the doors builder generates in github.com/xgodev/boost/builder/examples/simple/gen/builder/worker.
Command worker runs app worker: the doors builder generates in github.com/xgodev/boost/builder/examples/simple/gen/builder/worker.
examples/simple/createorder
Package createorder serves the order routes of app api.
Package createorder serves the order routes of app api.
examples/simple/healthcheck
Package healthcheck serves grpc.health.v1.Health on the grpc server of app api.
Package healthcheck serves grpc.health.v1.Health on the grpc server of app api.
examples/simple/order
Package order keeps the orders of the example in memory.
Package order keeps the orders of the example in memory.
examples/simple/ordercreated
Package ordercreated records the orders of order.created events in app worker.
Package ordercreated records the orders of order.created events in app worker.
examples/simple/probe
Package probe answers the liveness probe on the admin server of app api, apart from the public routes.
Package probe answers the liveness probe on the admin server of app api, apart from the public routes.
examples/simple/stock
Package stock tells whether an item can be ordered.
Package stock tells whether an item can be ordered.
examples/simple/stock/memory
Package memory keeps the stock in memory.
Package memory keeps the stock in memory.
examples/simple/stock/remote
Package remote asks a warehouse over HTTP for the stock.
Package remote asks a warehouse over HTTP for the stock.
examples/simple/stock/unlimited
Package unlimited is a stock without limits.
Package unlimited is a stock without limits.
examples/simple/stocktool
Package stocktool serves the stock tools of app api over MCP.
Package stocktool serves the stock tools of app api over MCP.
examples
boot command
extra
Package factory holds the contract shared by every factory under it.
Package factory holds the contract shared by every factory under it.
contrib/go-resty/resty/v2/plugins/contrib/dubonzi/otelresty/v1
This package implements integration between the go-resty (https://github.com/go-resty/resty) library and OpenTelemetry.
This package implements integration between the go-resty (https://github.com/go-resty/resty) library and OpenTelemetry.
contrib/go.mongodb.org/mongo-driver/v1/plugins/contrib/go.opentelemetry.io/contrib/v0
This package implements integration between the official go mongodb driver (https://github.com/mongodb/mongo-go-driver) and OpenTelemetry.
This package implements integration between the official go mongodb driver (https://github.com/mongodb/mongo-go-driver) and OpenTelemetry.
contrib/go.mongodb.org/mongo-driver/v2/plugins/contrib/go.opentelemetry.io/contrib/v0
This package implements integration between the official go mongodb driver (https://github.com/mongodb/mongo-go-driver) and OpenTelemetry.
This package implements integration between the official go mongodb driver (https://github.com/mongodb/mongo-go-driver) and OpenTelemetry.
contrib/labstack/echo/v4/plugins/contrib/go.opentelemetry.io/contrib/v0
This package implements integration between echo (https://github.com/labstack/echo) and OpenTelemetry.
This package implements integration between echo (https://github.com/labstack/echo) and OpenTelemetry.
contrib/modelcontextprotocol/go-sdk/v1/client/examples/greet command
Command greet calls the greet tool of server/examples/greet.
Command greet calls the greet tool of server/examples/greet.
contrib/modelcontextprotocol/go-sdk/v1/client/plugins/contrib/go.opentelemetry.io/otel/v1
Package otel opens an OpenTelemetry span for every MCP call the client sends, propagating the trace to the server in _meta.
Package otel opens an OpenTelemetry span for every MCP call the client sends, propagating the trace to the server in _meta.
contrib/modelcontextprotocol/go-sdk/v1/client/plugins/local/wrapper/log
Package log logs every MCP call the client sends through wrapper/log: method, tool, duration and error.
Package log logs every MCP call the client sends through wrapper/log: method, tool, duration and error.
contrib/modelcontextprotocol/go-sdk/v1/internal/buildinfo
Package buildinfo reads the application version Go stamps into the binary.
Package buildinfo reads the application version Go stamps into the binary.
contrib/modelcontextprotocol/go-sdk/v1/internal/middleware
Package middleware holds the go-sdk middlewares the server and client plugins install: one call in, one log line or span out.
Package middleware holds the go-sdk middlewares the server and client plugins install: one call in, one log line or span out.
contrib/modelcontextprotocol/go-sdk/v1/server/examples/greet command
Command greet serves one MCP tool over streamable HTTP on :8090/mcp.
Command greet serves one MCP tool over streamable HTTP on :8090/mcp.
contrib/modelcontextprotocol/go-sdk/v1/server/plugins/contrib/go.opentelemetry.io/otel/v1
Package otel opens an OpenTelemetry span for every MCP call the server receives, continuing the trace the client sent in _meta.
Package otel opens an OpenTelemetry span for every MCP call the server receives, continuing the trace the client sent in _meta.
contrib/modelcontextprotocol/go-sdk/v1/server/plugins/local/wrapper/log
Package log logs every MCP call the server receives through wrapper/log: method, tool, duration and error.
Package log logs every MCP call the server receives through wrapper/log: method, tool, duration and error.
fx
cmd/inject command
Command inject generates fx modules from @Provide, @Inject and @Invoke annotations.
Command inject generates fx modules from @Provide, @Inject and @Invoke annotations.
examples/simple command
Command simple wires an fx application from inject annotations.
Command simple wires an fx application from inject annotations.
examples/simple/app
Package app consumes the values provided by the other packages.
Package app consumes the values provided by the other packages.
examples/simple/greeting
Package greeting provides the greeters used by the example.
Package greeting provides the greeters used by the example.
examples/simple/names
Package names contributes values to the "names" group.
Package names contributes values to the "names" group.
model
errors
Package errors provides an easy way to annotate errors without losing the original error context.
Package errors provides an easy way to annotate errors without losing the original error context.
utils
wrapper
config
Package config provides a wrapper around koanf.
Package config provides a wrapper around koanf.
log
Package log provides a generic interface around loggers.
Package log provides a generic interface around loggers.

Jump to

Keyboard shortcuts

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