Skip to content

daidai21/biz_ext_framework

Repository files navigation

biz_ext_framework

biz_ext_framework is a repository for reusable business extension components.

Components are organized by top-level directories. Some directories are already independent Go modules, and some are placeholders reserved for follow-up work.

Directory Layout

  • biz_ctx/: placeholder directory for business context components
  • biz_identity/: independent Go module for business identity abstractions
  • biz_process/: independent Go module for business process FSM
  • ext_interceptor/: placeholder directory for extension interceptor components
  • ext_model/: independent Go module for extension model abstractions
  • ext_process/: independent Go module for extension process template
  • ext_spi/: independent Go module for SPI template abstractions
  • service_manager/: placeholder directory for service manager components
  • Makefile: repository-level helper targets
  • go.mod: repository-level Go module definition

Implemented Modules

ext_model

ext_model provides a generic, concurrency-safe model map abstraction:

  • ExtObj: value contract with Key() string
  • ExtModel[V]: map behavior interface
  • ExtMap[V]: default implementation
  • CopyExtMap: copy helper with WithDeepCopy and WithKeyFilter

Documentation:

biz_identity

biz_identity provides a technical component for business identity abstractions:

  • BizIdentity
  • Parser
  • Validator

Documentation:

biz_process

biz_process provides an extensible FSM framework:

  • State / Event
  • Transition (From + Event -> To)
  • Guard
  • Action
  • Extension hooks

Documentation:

ext_process

ext_process provides a generic extension process template:

  • Mode (Serial, Parallel)
  • Template
  • MatchFunc
  • ProcessFunc (with continueNext support in serial mode)

Documentation:

ext_spi

ext_spi provides a generic SPI template with four modes:

  • First
  • All
  • FirstMatched
  • AllMatched

Documentation:

Quick Start

package main

import (
    "fmt"

    "github.com/daidai21/biz_ext_framework/ext_model"
)

type User struct {
    ID   string
    Name string
}

func (u User) Key() string {
    return u.ID
}

func main() {
    var users ext_model.ExtModel[User] = &ext_model.ExtMap[User]{}

    users.Set(User{ID: "u1", Name: "Alice"})

    user, ok := users.Get("u1")
    fmt.Println(user.Name, ok)
}

Development

Run tests from the target module directory:

cd ext_model && go test ./...

Repository-level helper target:

make statistics_lines

About

a business extension module framework, created by CodeX

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors