ebrick

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 11 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

This section is empty.

Functions

This section is empty.

Types

type Application

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

Application defines the interface for the application.

func NewApplication

func NewApplication(opts ...Option) Application

NewApplication creates a new instance of Application with the provided options. It initializes the application configuration, web server, gRPC server, and module manager.

Parameters:

opts - A variadic list of Option functions to configure the application.

Returns:

An instance of Application.

type Option

type Option func(*Options)

Option defines a function type to configure Options

func WithCache

func WithCache(c cache.Cache) Option

WithCache sets the Cache 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 WithHTTPServer added in v0.9.1

func WithHTTPServer(httpServer httpserver.HTTPServer) Option

WithHTTPServer sets the HTTPServer 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.

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
	HTTPServer httpserver.HTTPServer // HTTP server instance
	GRPCServer grpc.GRPCServer       // gRPC server instance; optional
}

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.

Jump to

Keyboard shortcuts

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