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.
biz_ctx/: placeholder directory for business context componentsbiz_identity/: independent Go module for business identity abstractionsbiz_process/: independent Go module for business process FSMext_interceptor/: placeholder directory for extension interceptor componentsext_model/: independent Go module for extension model abstractionsext_process/: independent Go module for extension process templateext_spi/: independent Go module for SPI template abstractionsservice_manager/: placeholder directory for service manager componentsMakefile: repository-level helper targetsgo.mod: repository-level Go module definition
ext_model provides a generic, concurrency-safe model map abstraction:
ExtObj: value contract withKey() stringExtModel[V]: map behavior interfaceExtMap[V]: default implementationCopyExtMap: copy helper withWithDeepCopyandWithKeyFilter
Documentation:
- English:
ext_model/README.md - 中文:
ext_model/README-ZH.md
biz_identity provides a technical component for business identity abstractions:
BizIdentityParserValidator
Documentation:
- English:
biz_identity/README.md - 中文:
biz_identity/README-ZH.md
biz_process provides an extensible FSM framework:
State/EventTransition(From + Event -> To)GuardActionExtensionhooks
Documentation:
- English:
biz_process/README.md - 中文:
biz_process/README-ZH.md
ext_process provides a generic extension process template:
Mode(Serial,Parallel)TemplateMatchFuncProcessFunc(withcontinueNextsupport in serial mode)
Documentation:
- English:
ext_process/README.md - 中文:
ext_process/README-ZH.md
ext_spi provides a generic SPI template with four modes:
FirstAllFirstMatchedAllMatched
Documentation:
- English:
ext_spi/README.md - 中文:
ext_spi/README-ZH.md
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)
}Run tests from the target module directory:
cd ext_model && go test ./...Repository-level helper target:
make statistics_lines