Flowfull-Go
Official Library + Starter Kit
Go has two official pieces:
- Library / SDK: github.com/pubflow/flowfull-go
- Backend starter template: github.com/pubflow/flowfull-go-starter
Use flowfull-go when you need the Go client package in your own backend. Use flowfull-go-starter when you want a complete backend template already wired with Fiber, GORM, Bridge validation, auth middleware, HybridCache, and Trust Tokens.
Status
Available - official Go library plus production-shaped starter for teams that want Flowfull concepts in Go.
Install the library:
bash
go get github.com/pubflow/flowfull-goOr clone the starter:
bash
git clone https://github.com/pubflow/flowfull-go-starter.git my-backend
cd my-backend
go mod downloadThe Go starter depends on the official flowfull-go library and keeps the same Flowfull model: Bridge Validation, auth middleware, portable database patterns, and custom backend routes.
Included / Expected Features
- Go 1.22+ - Modern Go with generics
- Fiber v2 - Fast web framework in the starter
- GORM - Multi-database ORM in the starter
- ✅ All 7 Core Concepts - Bridge Validation, HybridCache, Trust Tokens, etc.
- ✅ Type Safety - Leveraging Go's strong typing
- ✅ Goroutines - Concurrent request handling
Starter Structure
flowfull-go-starter/
├── cmd/
│ └── server/
│ └── main.go
├── internal/
│ ├── bridge/ # Bridge Validation
│ ├── cache/ # HybridCache
│ ├── auth/ # Auth Middleware
│ ├── database/ # Database
│ ├── tokens/ # Trust Tokens (PASETO)
│ └── config/ # Configuration
├── api/
│ ├── handlers/ # HTTP Handlers
│ └── middleware/ # Middleware
├── migrations/ # Database Migrations
├── .env.example
├── go.mod
└── README.mdTechnology Stack
| Technology | Purpose | Version |
|---|---|---|
| Go | Language | 1.22+ |
| flowfull-go | Official Go SDK/client | 0.1+ |
| Fiber | Starter web framework | v2 |
| GORM | Starter ORM | Latest |
| go-redis | Redis Client | Latest |
| paseto | Trust Tokens | v2 |
| viper | Configuration | Latest |
Core Concepts (Preview)
1. Bridge Validation
go
package bridge
import (
"context"
"net/http"
)
type Validator struct {
flowlessURL string
bridgeSecret string
}
func (v *Validator) ValidateSession(ctx context.Context, sessionID string, opts ValidationOptions) (*Session, error) {
// Validate the session with Flowless and enforce the selected validation mode.
return nil, nil
}2. HybridCache
go
package cache
import (
"context"
"time"
)
type HybridCache struct {
lru *LRUCache
redis *RedisCache
}
func (c *HybridCache) Get(ctx context.Context, key string, fetcher func() (interface{}, error)) (interface{}, error) {
// Layer 1: LRU
if val, ok := c.lru.Get(key); ok {
return val, nil
}
// Layer 2: Redis
if val, err := c.redis.Get(ctx, key); err == nil {
c.lru.Set(key, val)
return val, nil
}
// Layer 3: Database
val, err := fetcher()
if err != nil {
return nil, err
}
c.redis.Set(ctx, key, val, 5*time.Minute)
c.lru.Set(key, val)
return val, nil
}3. Auth Middleware
go
package middleware
import (
"github.com/gin-gonic/gin"
"net/http"
)
func RequireAuth(validator *bridge.Validator) gin.HandlerFunc {
return func(c *gin.Context) {
sessionID := c.GetHeader("X-Session-Id")
if sessionID == "" {
c.JSON(http.StatusUnauthorized, gin.H{"error": "Unauthorized"})
c.Abort()
return
}
session, err := validator.ValidateSession(c.Request.Context(), sessionID, bridge.ValidationOptions{
IP: c.ClientIP(),
UserAgent: c.GetHeader("User-Agent"),
})
if err != nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": "Invalid session"})
c.Abort()
return
}
c.Set("user_id", session.UserID)
c.Next()
}
}Repository
- Starter repo: github.com/pubflow/flowfull-go-starter
- Library repo: github.com/pubflow/flowfull-go
- Request changes or integrations: pubflow.com/requests
Resources
- Core Concepts: 7 Core Concepts
- Official Node.js Implementation: flowfull-node
- Community Contributions: Getting Started - Community Contributions
Support
- Community: discord.gg/pubflow
- Email: support@pubflow.com
- Professional Support: notside.com - contact@notside.com