v1.0 - Solo Release

Gib.Run Give Data. Run Fast.

The opinionated Redis framework for Go developers who prioritize acceleration, sustainability, and high-performance downstreaming.

go get github.com/arielfikru/gibrun
main.go
app := gibrun.New(gibrun.Config{
    Addr: "localhost:6379",
})

// Store data with auto JSON marshalling
app.Gib(ctx, "user:123").
    Value(userData).
    TTL(5 * time.Minute).
    Exec()

// Retrieve with auto unmarshalling
found, _ := app.Run(ctx, "user:123").Bind(&result)
Features

Built for the Golden Era of Performance

Everything you need to accelerate your Redis operations

Auto-Downstreaming

Automatically transforms raw Go structs into JSON when storing, and back when retrieving. No more manual marshalling.

Nutritious API

Readable syntax that's healthy for your codebase. Prevents performance stunting with clean, fluent interfaces.

Coalition Locking

Strong distributed lock mechanism. Prevents race conditions across goroutines and microservices.

Targeted Caching

Generic type support for precise data retrieval. Data goes directly to the right destination.

Cluster Support

Native Redis Cluster support with automatic data migration across regions and shards.

Rate Limiting

Built-in token bucket rate limiter with HTTP middleware for fair API request distribution.

Installation

Get Started in Seconds

1

Install the package

go get github.com/arielfikru/gibrun
2

Import in your code

import "github.com/arielfikru/gibrun"
3

Connect to Redis

app := gibrun.New(gibrun.Config{Addr: "localhost:6379"})
Usage

Three Simple Operations

Master the framework with just three concepts

Gib - Store Data

Use .Gib() to store data in Redis. Structs are automatically marshalled to JSON.

  • .Value() - Set the data to store
  • .TTL() - Set expiration time
  • .Exec() - Execute the operation
type Program struct {
    Name   string `json:"name"`
    Budget int64  `json:"budget"`
}

data := Program{
    Name:   "Free Lunch",
    Budget: 400000000000,
}

err := app.Gib(ctx, "program:priority").
    Value(data).
    TTL(5 * time.Minute).
    Exec()

Run - Retrieve Data

Use .Run() to fetch data from Redis. Automatically unmarshals to your target type.

  • .Bind(&ptr) - Unmarshal to struct
  • .Raw() - Get raw string value
  • .Bytes() - Get raw bytes
var result Program

found, err := app.Run(ctx, "program:priority").
    Bind(&result)

if found {
    fmt.Printf("Program: %s\n", result.Name)
    fmt.Printf("Budget: %d\n", result.Budget)
} else {
    fmt.Println("Data not found")
}

Sprint - Atomic Operations

Use .Sprint() for high-speed counter operations.

  • .Incr() - Increment by 1
  • .IncrBy(n) - Increment by n
  • .Decr() - Decrement by 1
// Increment visitor count
count, _ := app.Sprint(ctx, "counter:visitors").
    Incr()

fmt.Printf("Total visitors: %d\n", count)

// Increment score by 100
score, _ := app.Sprint(ctx, "counter:score").
    IncrBy(100)
Integration

Works with PraboGo

Seamlessly integrates with PraboGo's hexagonal architecture

Hexagonal Architecture Ready

Gib.run is designed to work as an outbound adapter in PraboGo projects. Use it for caching, rate limiting, and session management.

Cache Adapter Templates
Fiber Rate Limiter Middleware
Repository Pattern Support
Docker Compose Compatible
View Integration Guide
user_cache_adapter.go
// PraboGo Hexagonal Architecture
type UserCacheAdapter struct {
    client *gibrun.Client
}

func (a *UserCacheAdapter) Set(
    ctx context.Context,
    user *User,
) error {
    return a.client.Gib(ctx, "user:"+user.ID).
        Value(user).
        TTL(time.Hour).
        Exec()
}

func (a *UserCacheAdapter) Get(
    ctx context.Context,
    id string,
) (*User, error) {
    var user User
    found, err := a.client.Run(ctx, "user:"+id).
        Bind(&user)
    if !found { return nil, nil }
    return &user, err
}