ebrick

package module
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 13 Imported by: 2

README

eBrick Framework

eBrick Framework – a robust and flexible platform designed for building Elastic Applications which inspired by elastic architecture. The eBrick Framework leverages a brick architecture, seamlessly combining modular components, microservices, and a core kernel to facilitate the development of scalable and adaptable software solutions. Integrating the principles of clean architecture, eBrick ensures each layer of your application remains decoupled and maintainable, allowing for easy modifications, testing, and deployment.

Key Feature: Seamless Transition Between Architectures

One of the standout features of eBrick is its ability to support seamless transitions between monolithic and microservices architectures . You can start by building a monolithic application where all modules are integrated into a single, unified system. As your application grows, eBrick’s plug-and-play capability allows you to effortlessly transition to a microservices architecture, where each service contains one or more modules. If needed, you can just as easily transition back to a monolithic architecture, reintegrating the services into a single application. This flexibility ensures your application can evolve with your business needs, scaling up, breaking down, or consolidating as necessary—all without extensive rewrites or disruptions.

Additionally, eBrick comes with out-of-the-box support for
  • Observability with OpenTelemetry: Seamlessly monitor and trace your applications to ensure optimal performance and reliability.
  • Messaging with NATS JetStream: Efficiently handle messaging across your microservices with a robust and scalable messaging system.
  • API Handling with Gin: Develop high-performance APIs using the Gin framework, known for its speed and flexibility.
  • ORM with GORM: Simplify database interactions with GORM, a powerful and developer-friendly ORM for Golang.
  • Multi-Tenancy: Support multiple tenants within a single application instance, ensuring isolated and secure data handling for each tenant.

With eBrick, you’re equipped to build highly resilient, flexible, and observable applications that can easily adapt to your changing requirements, making it the ideal framework for dynamic and growing environments.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventBus    messaging.EventBus
	Logger      logger.Logger
	HTTPServer  http.HTTPServer
	GRPCServer  grpc.GRPCServer
	AuthManager auth.AuthManager
	DB          *gorm.DB
)

Functions

This section is empty.

Types

type Application

type Application interface {
	RegisterModules(ctx context.Context, modules ...module.Module) error
	GrpcServer() grpc.GRPCServer
	HTTPServer() http.HTTPServer
	Start(ctx context.Context) error
	Options() *Options
}

Application defines the interface for the application.

func NewApplication

func NewApplication(opts ...Option) Application

type Option

type Option func(*Options)

Option defines a function type to configure Options

func WithAuth added in v0.10.0

func WithAuth(authManager auth.AuthManager) Option

func WithCache

func WithCache(c cache.Cache) Option

WithCache sets the Cache dependency.

func WithDB added in v0.9.3

func WithDB(db *gorm.DB) Option

WithDB sets the DB dependency.

func WithEventBus

func WithEventBus(eventBus messaging.EventBus) Option

WithEventBus sets the EventBus dependency.

func WithGRPCServer added in v0.9.0

func WithGRPCServer(grpcServer grpc.GRPCServer) Option

WithGRPCServer sets the GRPCServer dependency.

func WithLogger

func WithLogger(l logger.Logger) Option

WithLogger sets the Logger dependency.

func WithName

func WithName(name string) Option

WithName sets the application name.

func WithVersion

func WithVersion(version string) Option

WithVersion sets the application version.

func Withhttp added in v0.11.0

func Withhttp(http http.HTTPServer) Option

Withhttp sets the http dependency.

type Options

type Options struct {
	Name     string             // Application name
	Version  string             // Application version
	Cache    cache.Cache        // Cache instance
	Logger   logger.Logger      // Logger instance
	EventBus messaging.EventBus // Event bus instance for inter-component communication

	GRPCServer  grpc.GRPCServer // gRPC server instance; optional
	DB          *gorm.DB
	AuthManager auth.AuthManager
	// contains filtered or unexported fields
}

Options holds both configuration values and runtime dependencies

Directories

Path Synopsis
Package cache is a generated GoMock package.
Package cache is a generated GoMock package.
store
Package store is a generated GoMock package.
Package store is a generated GoMock package.
Package logger is a generated GoMock package.
Package logger is a generated GoMock package.
security

Jump to

Keyboard shortcuts

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