gostack

package module
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README ΒΆ

GoStack Logo

Go Reference

GoStack β€” A modern fullstack web framework for scalable web development in Go.

πŸ“ The Philosophy & Vision of GoStack

The Problem GoStack Solves

Modern Web development in Go is fragmented by design. A typical Go Web project looks like:

  1. Router from a third-party library (gin or gorilla/mux)
  2. ORM from a third-party library (gorm or ent)
  3. Query Builder from a third-party library (sqlx or sqlc)
  4. Migration tool from a third-party library (golang-migrate or goose)
  5. Authentication system from a third-party library (authcore or goth)
  6. Social authentication from a third-party library (golang.org/x/oauth2)
  7. Background job queue from a third-party library (machinery or neoq)
  8. Cron scheduler from a third-party library (robfig/cron)
  9. Event dispatcher from a third-party library (EventBus)
  10. WebSocket library from a third-party library (gorilla/websocket or coder/websocket)
  11. File storage abstraction from a third-party library (aws-sdk-go or go-cloud)
  12. Caching layer from a third-party library (go-redis)
  13. Mail delivery from a third-party library (gomail)
  14. CLI tooling from a third-party library (cobra)
  15. Configuration management from a third-party library (viper)

And that's just the backend. If you need a modern frontend:

  1. Frontend built entirely separately (React, Vue or Svelte) in a different language, with its own build tools (vite/webpack), its own routing, its own state management, its own ecosystem β€” and its own 6 million package dependency hell.

The result: Sixteen third-party ecosystems. Sixteen mental models. Sixteen failure points β€” just to build one application. The GoStack Answer: One Language. One Binary. One Mental Model.

The Disruptive Paradigm Shift: GOSTACK

GoStack is the first complete end-to-end framework solution for building FullStack Web applications in Go. It handles:

01.) βœ… Kernel Bootloader (Citadel) β€” Unified service registration and framework orchestration boot system.

02.) βœ… Service Container (Anchor) β€” Fast, lock-shielded, thread-safe Dependency Injection & IoC container.

03.) βœ… HTTP Router (Navigator) β€” Ultra-fast, zero-allocation routing with automated path parameter binding.

04.) βœ… Middleware Pipeline (Bridge) β€” Onion-style middleware pipeline for request filtering and interception.

05.) βœ… Query Builder & Hydrator (Crafter) β€” Active Record query builder that hydrates database results into Go structs.

06.) βœ… ORM Relationships (Conflex) β€” Native resolver mapping HasOne, HasMany, and BelongsTo database relations.

07.) βœ… Database Migrations (Traveller) β€” Transaction-shielded, versioned database schema migration runner.

08.) βœ… Schema Builder (Grapher) β€” Fluent programmatic definition for columns, indexes, and constraints.

09.) βœ… Authentication (Guard) β€” Fully-baked session/token authentication with native CSRF protection.

10.) βœ… In-Memory Cache (Mory) β€” Generic-typed key-value caching layer with local and Redis memory adapters.

11.) βœ… Background Queues (Sequence) β€” Deferred job queue worker supporting delays, retries, and job chaining.

12.) βœ… Event Dispatcher (Spark) β€” Synchronous and asynchronous Pub/Sub event communication system.

13.) βœ… SMTP HTML Mailer (GoMail) β€” Rich HTML email formatting, template engines, and attachment delivery.

14.) βœ… File Storage (Vault) β€” Path-traversal secure storage engine supporting local and AWS S3 environments.

15.) βœ… Notification Router (Alert) β€” Decoupled, multi-channel alerting (Email, Database, SMS) dispatch engine.

16.) βœ… Cron Task Scheduler (Planner) β€” Native, in-app cron job scheduler replacing external system crontabs.

17.) βœ… Social Logins (SocialHub) β€” Plug-and-play OAuth2 login flow with Google, GitHub, and custom providers.

18.) βœ… Admin Dashboard (GoDash) β€” Auto-generated backoffice interface with real-time job and system monitors.

19.) βœ… AOT UI Compiler (Tempose) β€” Ahead-of-Time compiler translating HTML/CSS/JS components directly into Go source code.

20.) βœ… Reactive Client Runtime (Glide) β€” Zero-dependency DOM reactivity engine (Alpine/Svelte equivalent) running without Node.js.

21.) βœ… CLI Assistant (Gost) β€” Scaffolding runner for database models, migrations, and controller templates.

22.) βœ… Driver Contracts (Contract) β€” Interchangeable interface contracts decoupling framework drivers from core services.

23.) βœ… Config Manager (GoCon) β€” Clean, strongly-typed environment .env configuration file loader.

24.) βœ… Request Validation (Validator) β€” Declarative rule-based payload validation middleware for requests.

25.) βœ… Real-Time WebSockets (GowSocket) β€” Bi-directional, multi-group WebSocket communication hub.

26.) βœ… Translation Engine (Transios) β€” Localization manager supporting language dictionaries and formatting templates.

27.) βœ… NoSQL MongoDB (GoMon) β€” Active Record engine support mapping NoSQL document stores to Go models.

28.) βœ… Graph Database (Nexus) β€” Native Cypher query mapping and relation graph nodes for Neo4j database instances.

29.) βœ… Wide-Column Cassandra (Aether) β€” Distributed CQL query mapper and table optimizer for Apache Cassandra database structures.


πŸ“¦ Official Extensions (Isolated Packages)

To respect core design rationale and keep database/architecture boundaries perfectly clean, complex plug-and-play extensions are managed in isolated packages:

  • πŸ”‘ Multi-Factor Auth (MFA) β€” RFC 6238 TOTP validation and QR code generation wrappers.
  • πŸ›‘οΈ Role-Based Access Control (RBAC) β€” Relational & NoSQL database-agnostic role permission middlewares and policy resolvers.

Everything in One binary, One mental model, One language.

It's the equivalent of what Laravel gave PHP, what Django gave Python, and what Rails gave Ruby β€” instead of assembling an app from 10 independent packages, you get one coherent framework where every layer knows about every other layer by design.

Go developers have never had this β€” until now (June 2026).

The Five (5) Core Pillars

1.) πŸ”‹ Batteries Included:

GoStack ships with everything β€” routing, ORM, migrations, auth, caching, queues, WebSockets, scheduling, storage, events, admin dashboard, and a frontend compiler β€” all in one module, which means no abandonware risk, no integration hell, no context switching between Go and Node.js, no tracking ten different package versions, and no JavaScript frontend forced upon you, because everything is natively integrated, maintained as one coherent ecosystem, and compiled into a single binary, so you don't assemble a stack β€” you just build.

2.) πŸ”„ No Context Switching (Go-Native Fullstack)

The most radical part of GoStack: the frontend is Go. Components are .html, .css, and .js files that Tempose compiles into Go string literals at build time β€” no separate dev server, no proxy configuration, no CORS headaches.

Client-side reactivity is provided by Glide, a micro frontend engine inspired by Alpine.js, embedded directly in your binary. With Glide's gs-* directive system, you add interactivity using declarative attributes right in your HTML β€” gs-click, gs-model, gs-show, gs-for, and more. No useState, no useEffect, no virtual DOM, no build step. Just HTML with superpowers.

The result is a fullstack application with no Node.js, no npm, no package.json, no node_modules, no Webpack, no Vite, no Babel β€” just go build.

One language. One binary. No separate frontend toolchain.

3.) πŸ“˜ Easy to Learn and Use (One Mental Model)

When you learn a new framework, you're not just learning syntax β€” you're learning a way of thinking. Most frameworks teach you ten different ways of thinking: one for data, one for background tasks, one for real-time updates, one for configuration. Every new feature demands a new mental context switch.

GoStack doesn't do this β€” everything in GoStack works the way you'd naturally expect it to work. The pattern you learn on day one is the same pattern you use every time forward. There are no hidden layers where the framework suddenly behaves differently because you've crossed some invisible complexity threshold.

With GoStack, there's just one simple pattern that never changes, no matter how big your idea gets.

4.) πŸ”’ Secure by Default

Most frameworks assume you'll remember to lock the door after you build the house. GoStack assumes you won't β€” so it locks every door for you, before you even lay the first brick.

With GoStack, security isn't an afterthought you scramble to add at the end of a project. It's baked into the foundation from the very first line. Every request is questioned. Every file access is contained. Every database query is protected unless you explicitly say otherwise. Every user action needs permission. Nothing is trusted by accident.

This means you can build with speed and sleep with peace of mind. Beginners don't have to become security experts just to launch their first app. Investors don't have to worry about the hidden cost of a breach. And developers don't have to spend their nights wondering if they forgot to sanitize that one input.

GoStack doesn't wait for you to make a mistake β€” it prevents the mistake from ever happening. Security isn't a feature you add later. It's how the framework works, baked in and always on.

5. ⚑ Developer Experience as a First-Class Feature

For years, developers in other ecosystems have enjoyed something Go never had: a complete, integrated framework where every piece works with every other piece out of the box. Rails has it. Django has it. Laravel has it.

Go developers have built amazing things too β€” but not because of the tooling. Despite it. Go developers have built amazing things too β€” but not because of the tooling. Despite it. Go developers have always had to build integration themselves, piece by piece, and then maintain it forever. A router here. An ORM there. A queue library over here. A WebSocket package somewhere else. Ten different ecosystems. Ten different futures. Ten chances for any one of them to fall out of sync with your needs.

GoStack delivers what Go has always deserved: a complete, integrated framework designed from the ground up to be Future-Proof by Default. No hunting for which router works with which ORM. No wondering if your WebSocket library will still be maintained next year. No constant context switching between packages with different philosophies.

The result is simple: one stack, one way of working, one future. No assembly required. No fragmentation. No guesswork.

Other ecosystems have enjoyed this foundation for years. GoStack brings it to the Go ecosystem, to finally remove those headaches and uncertainties.

GoStack handles the heavy lifting and the behind-the-scenes complexity. While you handle your ambition and concentrate on your core business objectives.

The Core Rationale in One Sentence

GoStack exists because Go is an exceptional language held back by ecosystem fragmentation β€” and the cure is a single, opinionated, compile-safe framework that lets you build the server, the database layer, and the UI without ever leaving Go.

It's positioned as the answer to: "Why would I use Laravel/Rails/Django if I want Go's performance?" The answer GoStack gives is: "You wouldn't have to choose anymore."


⚑ The Death of "Glue Code" (15 Packages vs. The GoStack Way)

If you ask how to build a complete fullstack application in Go using standard open-source libraries, you are usually handed a fragmented stack of 15+ independent packages.

Instead of writing your product, you spend the first week writing "glue code" to make these libraries talk to each other, dealing with dependency version conflicts, and managing complex configurations.

Here is how GoStack consolidates the entire fullstack developer experience:

Feature Capability The Fragmented Way (15 Libraries) The GoStack Way (Unified Built-ins)
HTTP Routing gin-gonic/gin or chi Navigator β€” Built-in, high-performance router
Database ORM gorm.io/gorm Crafter & Conflex β€” Active Record & Hydrator
Migrations pressly/goose or golang-migrate Traveller β€” Database version schema runner
UI Templates a-h/templ Tempose β€” AOT component compiler
Session Auth authcore or custom cookie sessions Guard β€” Session & Token Auth + CSRF protection
Social Login golang.org/x/oauth2 SocialHub β€” Multi-provider OAuth login flow
Job Queue neoq or asynq Sequence β€” Delayed background worker queues
Cron Scheduling robfig/cron/v3 Planner β€” Background task scheduler
Event Dispatcher EventBus Spark β€” Pub/Sub event dispatcher
WebSockets coder/websocket GowSocket β€” Bi-directional WebSocket hub
File Storage gocloud.dev (blob) Vault β€” Local & AWS S3 secure storage sandbox
Caching / Cache go-redis/v9 Mory β€” Generic-typed key-value memory cache
SMTP Mailing gomail GoMail β€” SMTP HTML mailer
CLI App Runner spf13/cobra Gost β€” Interactive console command assistant
Config Loader spf13/viper GoCon β€” Dynamic .env environment parser
User Alerting Custom mail & DB notification logic Alert β€” Multi-channel notification router

By consolidating these 16 libraries into one binary, one programming language, and one cohesive mental model, GoStack frees you from configuration hell. Zero glue code. Zero package conflicts. Just pure product engineering.


πŸ—ΊοΈ The GoStack Subsystem Registry

Every major capability in GoStack is a fully tested, co-developed, and branded subsystem:

# Branded Name Subsystem Capability Description
1 Citadel Application Bootloader & Unified Kernel Coordinates GoStack's application lifecycle by executing registration and boot phases across all modules. It guarantees that critical resources (like database pools and routers) are fully initialized before the framework starts serving requests.
2 Anchor IoC Service Container & Dependency Injection A thread-safe, lock-shielded Inversion of Control storage container. By resolving service blueprints on demand, it completely eliminates dependency-ordering bugs and compile-time code generation bloat.
3 Navigator HTTP Router A high-performance, parameter-binding HTTP routing tree. It parses URL patterns, matches incoming paths, and passes request scopes directly to target handlers with zero dynamic runtime allocations.
4 Bridge Middleware Pipeline (Onion Architecture) Implements a sequential onion-style middleware pipeline. It intercepts requests to perform cross-cutting tasks (like CSRF protection, CORS handling, or sessions) before letting target handlers execute, supporting early-exit abort flows.
5 Crafter Query Builder & Reflective Hydrator Dynamically generates clean, optimized SQL and database calls. It utilizes a runtime reflection cache to safely translate raw database records into strongly-typed Go entities, shielding developer code from raw SQL boilerplate.
6 Conflex ORM Relationship Mapper Resolves relational model schemas (HasOne, HasMany, BelongsTo). It tracks and loads child connections, caching retrieved structures to eliminate costly N+1 query execution bottlenecks.
7 Traveller Database Migration Engine Performs transaction-shielded, versioned database schema updates. It maps applied migrations inside system ledgers to keep local development environments and production servers perfectly in sync.
8 Grapher Schema Builder (fluent column definitions) Provides a fluent, programmatic builder interface for setting up database columns, indexes, and constraints. It translates Go definitions into native DDL statements, avoiding raw schema script errors.
9 Guard Authentication (session-based) Manages secure user session cookies, token issuance, and CSRF token generation. It acts as the secure entry guard, shielding internal routes from unauthenticated actors.
10 Mory Generic-typed In-Memory Cache A high-speed, generic-typed key-value caching layer. It stores heavily accessed data models in local memory to speed up response times and reduce database querying overhead.
11 Sequence Background Job Queue Manages background queue workers to run deferred tasks (like report compiles or API calls). It supports retries, custom delays, and job chains, ensuring the main HTTP request thread remains fast.
12 Spark Pub/Sub Event Dispatcher Dispatches synchronous and asynchronous events across application modules. It allows developers to completely decouple actions (e.g. "UserRegistered") from side-effects (e.g. "SendWelcomeEmail").
13 GoMail SMTP Mailer A zero-dependency SMTP client built on standard Go packages. It handles HTML mail formatting, attachment rendering, and template loading, enabling professional email delivery.
14 Vault File Storage (Local + S3) Provides a secure, path-traversal shielded file storage gateway. It allows developers to swap local folder storage for cloud storage (like AWS S3) transparently by modifying a single environment variable.
15 Alert Multi-Channel Notification System Routes notifications across multiple delivery channels (Email, Database, SMS). It decouples notification messages from delivery platforms using a unified, fluent dispatcher structure.
16 Planner Cron Task Scheduler A background schedule scheduler that runs cron-style tasks. It eliminates the need for external system-level crontabs, letting developers configure recurrent jobs inside compile-safe Go code.
17 SocialHub OAuth Social Login Handles third-party OAuth2 authorization flows (like Google or GitHub). It validates secure callbacks, retrieves user profile metadata, and integrates credentials with the Guard subsystem.
18 GoDash Admin Panel & Sequence Monitor Provides an auto-generated admin interface and background queue monitoring screen. It allows developers to visualize active tasks, search database records, and debug jobs out of the box.
19 Tempose AOT UI Component Compiler Compiles HTML component templates, styles, and scripts into static Go code. It completely eliminates disk IO overhead at runtime, allowing templates to render at Go's compiled speed.
20 Glide Client-Side Reactive Runtime A zero-dependency reactive directive engine served directly inside page bundles. It parses dynamic HTML attributes (like gs-model, gs-show) to manage reactivity, spa router morphs, and transitions without Node.js toolchains.
21 Gost CLI Command Runner Powers the command-line interface. It registers custom console scripts, executes database migration scripts, and generates scaffolded components using Go's exact dependency tree.
22 Contract Interface Definitions (driver contracts) Defines the core interface contracts that decouple framework drivers from your application logic. It ensures that system implementations (like cache backends) remain fully interchangeable.
23 GoCon Environment Config Manager (.env parser) Scans, parses, and loads .env variables into application state at boot time. It converts configuration keys into strongly-typed structures, protecting startup routines from missing keys.
24 Validator Request Validation Engine Evaluates incoming request JSON payloads or form data against declared rules. It acts as the gateway validation layer, mapping error details onto contexts before reaching controller logic.
25 GowSocket Real-Time WebSocket Hub Orchestrates bi-directional, persistent WebSocket client connections. It manages socket groups, processes message frames, and runs real-time pushes with native Go channels.
26 Transios Localization & Translation Engine Dynamically formats dates, currencies, and localized strings based on user languages. It reads translation directories at boot time, mapping language templates for client renderers.
27 GoMon MongoDB Integration (NoSQL Document Store) Provides native NoSQL document store mappings. It extends Crafter's hydration engine to parse BSON objects, enabling schema-less database operations alongside relational models.
28 Nexus Neo4j Graph Database Integration Bridges GoStack with Neo4j graph nodes. It supports execution of Cypher query patterns, mapping complex relational graphs onto Go models.
29 Aether Cassandra Wide-Column Database Integration Cassandra Wide-Column Database Integration. It optimizes CQL queries and handles massive, distributed tables, mapping wide-column records into structured entities.

πŸ“¦ Official Extensions

GoStack supports optional plug-and-play extensions that are fully isolated from the core framework package to maintain clean database and architecture boundaries:

  • MFA (TOTP Multi-Factor Authentication): Standard RFC 6238 TOTP verification and QR code generation.
    go get github.com/charledeon77/gostack-extensions/mfa
    
  • RBAC (Role-Based Access Control): Dynamic roles, permissions, HTTP middlewares, and database-agnostic resolvers (supporting both relational SQL databases and NoSQL/Cassandra).
    go get github.com/charledeon77/gostack-extensions/rbac
    

✨ The GoStack Architectural Manifesto & Developer Joy Guidelines

GoStack was designed with a simple belief: building web apps should feel like play, not puzzle assembly. These principles ensure GoStack remains the most enjoyable, robust, and lightning-fast fullstack environment in the Go ecosystem.

πŸš€ 1. The Zero-Dependency Principle (Compile in under 2 Seconds)
  • The Rationale: GoStack avoids the library creep that slows down projects. By writing native, optimized standard library wrappers instead of importing heavy third-party packages, we preserve Go's famous compilation speeds.
  • The Developer Joy: Your entire app compiles in the blink of an eye. You get tiny, single-file distribution binaries with zero runtime dependencies.
  • The Guideline: Before running go get for a utility, try standard library primitives first. Keep the codebase clean, lean, and self-contained.
🎨 2. No Node.js. No npm. No Webpack. (Tempose AOT Compilation)
  • The Rationale: Frontend templates (HTML, CSS, JS) compile directly into Go code by Tempose during your build.
  • The Developer Joy: You get a fullstack app with no node_modules bloating your drive, no Webpack configuration files to debug, and no separate Node.js dev server. Just raw, lightning-fast Go runtime rendering.
  • The Guideline: Run gostack compile (or launch gost dev for real-time hot-reloading) to let the AOT compiler build your frontend assets directly into the Go source files.
🧩 3. Write Once, Run Anywhere (The Context & Contract Design)
  • The Rationale: Dynamic application operations use Contract interfaces (framework/contract), meaning they never bind directly to a specific backend database or driver.
  • The Developer Joy: Need to switch from local disk storage to AWS S3? Or from SQLite to PostgreSQL? Just change a line in your .env. The codebase remains untouched and fully operational.
  • The Guideline: Always accept contract interfaces in your services rather than concrete structs. Let the container handle the bindings.
⚑ 4. Streamlined HTTP Operations (The Context Wrapper Pattern)
  • The Rationale: Middleware, controllers, and interceptors share a unified *http.Context wrapper instead of raw primitives.
  • The Developer Joy: Retrieving path params, validating JSON inputs, rendering templates, or setting secure cookies becomes a single, clean method call. No redundant boilerplate code.
  • The Guideline: Utilize the context helpers to pass payload states cleanly through the Bridge onion middleware pipeline.
🎨 5. Style Freedom by Default (gs-css)
  • The Rationale: Tempose's baseline default styling engine only acts on HTML elements that explicitly carry the gs-css tag attribute.
  • The Developer Joy: The framework never hijacks your custom layouts or overrides your Tailwind/Vanilla CSS rules. You stay in full creative control of your design system from day one.
  • The Guideline: Include gs-css on components where you want GoStack's built-in styles, and leave it off where you want absolute creative freedom.

GoStack β€” The speed and performance of Go, the interconnected ecosystem of Laravel, the simplicity and reactivity of AlpineJS, with the complete powers of React, Svelte and Vue combined. One binary. One language. Zero headaches.


πŸ›‘οΈ Production Ready Assurance

Over the past few release cycles (leading up to the current version v1.0.11 released 24 July 2026), GoStack has transitioned from a lightweight full-stack prototype into a robust, enterprise-grade, and highly reliable framework.

Below is an overview of why GoStack is production-ready, its architecture, and its security details.


1. Robust Core Architecture & Subsystem Maturity

Every major framework layer has been branded and fully integrated via the dynamic Citadel container bootstrapper and the Anchor Dependency Injection engine defined in gostack.go.

  • Navigator (HTTP Router) and Bridge (Middleware Pipeline) handle request orchestration with built-in trailing slash normalization and routing conflict warning checks.

  • Crafter (ORM / Query Builder), Conflex (Relations Mapper), and Grapher (Schema Builder) automate database logic with full support for SQL dialects (PostgreSQL, MySQL, CockroachDB, SQLite) and NoSQL databases (MongoDB, Neo4j, Cassandra).

  • Glide (Reactive Runtime) and Tempose (AOT UI Compiler) provide reactive UI rendering compiled directly into Go source code, completely removing node/npm dependencies from production binaries.

2. Crucial Production-Grade Hardening & Security Features

Several major updates were implemented to secure and optimize the framework specifically for production environments (detailed in CHANGELOG.md).

  • CSS Scoping Fixed (v1.0.8): Resolved a critical compilation bug that previously caused scoped styles to be discarded in browser paint steps.

  • Client Reactivity & DOM Morphing (v1.0.10): Upgraded Glide to a Proxy-based reactivity engine supporting SPA routing, client-side hydration, and dynamic bindings. It uses a browser-native DOMParser to sanitize inputs and safeguard against XSS.

  • Nested Transactions (SQL Savepoints) & Connection Pooling (v1.0.2): Natively supports nested transactions via standard SQL SAVEPOINT protocols, together with full connection pool limit management (MaxOpenConns, MaxIdleConns, ConnMaxLifetime).

  • API Security & Throttling (v1.0.2 / v1.0.3): Employs an AuthThrottle rate-limiting middleware on auth endpoints (sliding-window composite keys) and alphanumeric identifier validation check allowlists to prevent SQL injection.

  • Reliable Cron Scheduler (v1.0.2): Implements timezone-aware schedules with .WithoutOverlapping() atomic locks to ensure long-running background tasks never trigger concurrent, degrading runs.

  • Transios i18n Localization (v1.0.7): Serves translation keys under zero disk I/O latency, preloading default locale data directly inside binaries.

3. Mature Extension Architecture

Following GoStack's core design rules, complex plug-and-play features are decoupled into the gostack-extensions workspace:

  • πŸ”‘ Multi-Factor Auth (MFA): Defined in mfa.go handles RFC 6238 TOTP validation and QR code generation.

  • πŸ›‘οΈ Role-Based Access Control (RBAC): Defined in rbac.go β€” controls who is allowed to do what inside your application. You define roles (like "admin", "editor", "viewer"), assign them to users, and then restrict any page or action so that only users with the right role or permission can access it. Works with both SQL and NoSQL databases out of the box.

[!IMPORTANT] Why RBAC is an Extension

GoStack natively supports multiple database paradigmsβ€”including SQL (PostgreSQL, MySQL, SQLite) and NoSQL (MongoDB, Cassandra). Keeping RBAC as an isolated extension allows developers using SQL databases to pull it in and run relational checks, while NoSQL developers are not forced to follow a specific database schema and can utilize custom resolver callbacks.

4. 100% Green Test Suite

All test suites across the framework compile, build, and pass cleanly:

  • Core Framework: Passed and verified via go test ./... in the GoStack directory.

  • RBAC & MFA Extensions: Passed and verified in the gostack-extensions subdirectories.

Summary

With zero external node/npm runtime dependencies, built-in security protections (CSRF, XSS filtering, Rate-Limiting, SQL Injection guards), robust database transaction layers, and isolated extensible packages, GoStack is fully prepared to back Production-Grade Applications.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

Auth coordinates authentication strategies globally.

View Source
var Cassandra *gocql.Session

Cassandra is the global Aether facade exposing the official Cassandra session. This is populated when the application is initialized with a Cassandra connection.

DB holds the initialized global state application database driver adapter connection. This is populated for relational SQL databases (MySQL, PostgreSQL, CockroachDB, SQLite).

Mail is the global mailer facade. Initialise it with InitMail before sending.

View Source
var Mongo *mongo.Client

Mongo is the global GoMon facade exposing the official MongoDB client. This is populated when the application is initialized with a MongoDB connection.

Neo4j is the global Nexus facade exposing the official Neo4j graph database driver. This is populated when the application is initialized with a Neo4j connection.

Functions ΒΆ

func InitAether ΒΆ

func InitAether(hosts, keyspace string) error

InitAether provisions and activates the Aether Cassandra integration subsystem. It connects to the Cassandra cluster and sets the global gostack.Cassandra facade.

Parameters:

  • hosts: A comma-separated string of Cassandra contact points (e.g. "127.0.0.1:9042").
  • keyspace: The Cassandra keyspace to bind the session to.

func InitAuth ΒΆ

func InitAuth(defaultGuard string, userProvider contract.UserProvider)

InitAuth provisions and initializes the authentication system, registering default session and token guards.

func InitDatabase ΒΆ

func InitDatabase(driver, dsn string) error

InitDatabase provisions and activates the target relational database driver infrastructure.

Supported drivers: "mysql", "postgres", "sqlite", "sqlite3", "cockroach", "cockroachdb". For MongoDB, Neo4j, and Cassandra use InitMongo, InitNexus, and InitAether instead.

Parameters:

  • driver: The database identifier string (e.g. "mysql", "postgres", "sqlite").
  • dsn: The Data Source Name string configuration mapping host, credentials, and target database.

Returns:

  • An error if the driver registration is missing or connection handshake protocols fail.

func InitMail ΒΆ

func InitMail(cfg mail.Config)

InitMail provisions the global Mail facade from the given SMTP configuration.

Call this once at application boot, typically after InitConfig:

gostack.InitMail(mail.Config{
    Host:        gostack.Config.Get("MAIL_HOST"),
    Port:        587,
    Username:    gostack.Config.Get("MAIL_USERNAME"),
    Password:    gostack.Config.Get("MAIL_PASSWORD"),
    FromAddress: gostack.Config.Get("MAIL_FROM_ADDRESS"),
    FromName:    gostack.Config.Get("MAIL_FROM_NAME"),
})

func InitMongo ΒΆ

func InitMongo(uri string) error

InitMongo provisions and activates the GoMon MongoDB integration subsystem. It connects to MongoDB using the provided URI and sets the global gostack.Mongo facade.

Parameters:

  • uri: The MongoDB connection string (e.g. "mongodb://127.0.0.1:27017").

func InitNexus ΒΆ

func InitNexus(uri, username, password string) error

InitNexus provisions and activates the Nexus Neo4j graph database integration subsystem. It connects using the official Neo4j driver and sets the global gostack.Neo4j facade.

Parameters:

  • uri: The Neo4j connection URI (e.g. "neo4j://localhost:7687").
  • username: The Neo4j username (typically "neo4j").
  • password: The Neo4j password.

func Table ΒΆ

func Table(name string) *database.QueryBuilder

Table provisions a fluent, decoupled instance of the QueryBuilder pipeline mapping a target table.

Why this exists: It hooks the global active database connection context into the builder framework, providing developers with an expressive data management interface from anywhere in the application scope.

Parameters:

  • name: The target schema table name string to initiate query expressions against.

Types ΒΆ

This section is empty.

Directories ΒΆ

Path Synopsis
_examples
app command
Package main serves as the primary operational entry point for the GoStack framework application.
Package main serves as the primary operational entry point for the GoStack framework application.
cmd
app command
Package main serves as the primary operational entry point for the GoStack framework application.
Package main serves as the primary operational entry point for the GoStack framework application.
gost command
Purpose: This file is the global command-line installer for the GoStack framework.
Purpose: This file is the global command-line installer for the GoStack framework.
gostack command
Purpose: This file is the project-local command-line entrypoint for the GoStack framework.
Purpose: This file is the project-local command-line entrypoint for the GoStack framework.
framework
auth
Purpose: This file implements Cross-Site Request Forgery (CSRF) protection middleware for GoStack.
Purpose: This file implements Cross-Site Request Forgery (CSRF) protection middleware for GoStack.
console
Purpose: This file implements the `make:migration` and `make:controller` CLI code generation commands.
Purpose: This file implements the `make:migration` and `make:controller` CLI code generation commands.
contract
Purpose: This file defines the abstract contract interfaces for the GoStack framework.
Purpose: This file defines the abstract contract interfaces for the GoStack framework.
database
Aether β€” GoStack Cassandra Wide-Column Database Integration Subsystem.
Aether β€” GoStack Cassandra Wide-Column Database Integration Subsystem.
foundation
Package foundation (Citadel) serves as the core booting and structural bedrock of the GoStack framework, managing low-level application lifecycles and diagnostics.
Package foundation (Citadel) serves as the core booting and structural bedrock of the GoStack framework, managing low-level application lifecycles and diagnostics.
foundation/config
Purpose: This file implements the GoCon environment configuration system.
Purpose: This file implements the GoCon environment configuration system.
foundation/events
Purpose: This file implements the Spark EventDispatcher subsystem for the GoStack framework.
Purpose: This file implements the Spark EventDispatcher subsystem for the GoStack framework.
http
Package http (Navigator, Bridge, Tempose, and Glide) houses the core HTTP request-response lifecycle management.
Package http (Navigator, Bridge, Tempose, and Glide) houses the core HTTP request-response lifecycle management.
mail
Purpose: This file implements the GoMail email sending component.
Purpose: This file implements the GoMail email sending component.
notification
Purpose: Implements the persistent database delivery channel for the notification system.
Purpose: Implements the persistent database delivery channel for the notification system.
storage
Purpose: This file implements the LocalStorage driver for the Vault storage subsystem of GoStack.
Purpose: This file implements the LocalStorage driver for the Vault storage subsystem of GoStack.
ui
Purpose: This file implements the Tempose Ahead-of-Time (AOT) component compilation engine.
Purpose: This file implements the Tempose Ahead-of-Time (AOT) component compilation engine.
worker/queue
Purpose: Implements a database-backed queue driver for GoStack's Sequence system.
Purpose: Implements a database-backed queue driver for GoStack's Sequence system.
internal

Jump to

Keyboard shortcuts

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