{"id":35416083,"url":"https://github.com/forbearing/gst","last_synced_at":"2026-01-25T13:06:37.927Z","repository":{"id":222646718,"uuid":"757938129","full_name":"forbearing/gst","owner":"forbearing","description":"🚀 Golang Backend Framework","archived":false,"fork":false,"pushed_at":"2026-01-17T13:47:42.000Z","size":3580,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-17T18:36:36.258Z","etag":null,"topics":["backend","framework","go","golang"],"latest_commit_sha":null,"homepage":"https://deepwiki.com/forbearing/gst","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forbearing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-15T09:49:38.000Z","updated_at":"2026-01-17T07:59:30.000Z","dependencies_parsed_at":"2024-03-04T03:44:24.818Z","dependency_job_id":"4e4907fd-e943-4dd2-964d-cfbee68a132e","html_url":"https://github.com/forbearing/gst","commit_stats":null,"previous_names":["forbearing/golib","forbearing/gst"],"tags_count":139,"template":false,"template_full_name":null,"purl":"pkg:github/forbearing/gst","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbearing%2Fgst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbearing%2Fgst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbearing%2Fgst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbearing%2Fgst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forbearing","download_url":"https://codeload.github.com/forbearing/gst/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbearing%2Fgst/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","framework","go","golang"],"created_at":"2026-01-02T15:24:25.646Z","updated_at":"2026-01-25T13:06:37.922Z","avatar_url":"https://github.com/forbearing.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/forbearing/gst)\n\n## Install gst code generator\n\n```bash\ngo install github.com/forbearing/gst/cmd/gg@latest\n```\n\n## Description\n\n🚀 Golang Lightning Backend Framework\n\nWARNING: Library under active development - expect significant API changes.\n\n## Examples\n\n1.  [basic usage example](./examples/simple/main.go)\n\n2.  [example external project](https://github.com/forbearing/glpi)\n\n\n\n## Documents\n\n-   [Router usage](./examples/demo/main.go)\n-   [Model usage](./examples/demo/model/user.go)\n-   [Database Create](./examples/demo/controller/user_create.go)\n-   [Database Delete](./examples/demo/controller/user_delete.go)\n-   [Database Update](./examples/demo/controller/user_update.go)\n-   [Database List](./examples/demo/controller/user_list.go)\n-   [Database Get](./examples/demo/controller/user_get.go)\n-   [Controller usage](./controller/READMD.md)\n-   [Service usage](./examples/demo/service/user.go)\n-   [Client usage](./client/client_test.go)\n-   [tunnel usage](./tunnel/session_test.go)\n-   Package usage\n    -   lru\n    -   cmap\n    -   sqlite,postgres,mysql\n    -   redis\n    -   elastic\n    -   mongo\n    -   minio\n    -   mqtt\n    -   task\n\n\n\n## Data Structure\n\n-   [list](./ds/list)\n    -   [arraylist](./ds/list/arraylist/list.go)\n    -   [linkedlist](./ds/list/linkedlist/list.go)\n    -   [skiplist](./ds/list/skiplist/skiplist.go)\n-   [stack](./ds/stack)\n    -   [arraystack](./ds/stack/arraystack/stack.go)\n    -   [linkedstack](./ds/stack/linkedstack/stack.go)\n-   [queue](./ds/queue)\n    -   [arrayqueue](./ds/queue/arrayqueue/queue.go)\n    -   [linkedqueue](./ds/queue/linkedqueue/queue.go)\n    -   [priorityqueue](./ds/queue/priorityqueue/queue.go)\n    -   [circularbuffer](./ds/queue/circularbuffer/circularbuffer.go)\n-   [tree](./ds/tree)\n    -   [rbtree](./ds/tree/rbtree/rbtree.go)\n    -   [avltree](./ds/tree/avltree/avltree.go)\n    -   [splaytree](./ds/tree/splaytree/splaytree.go)\n    -   [trie](./ds/tree/trie/trie.go)\n-   [heap](./ds/heap)\n    -   [binaryheap](./ds/heap/binaryheap/binaryheap.go)\n-   [mapset](./ds/mapset/set.go)\n-   [multimap](./ds/multimap/multimap.go)\n\n\n## Interface\n\n### Logger\n\n```go\ntype StandardLogger interface {\n\tDebug(args ...any)\n\tInfo(args ...any)\n\tWarn(args ...any)\n\tError(args ...any)\n\tFatal(args ...any)\n\n\tDebugf(format string, args ...any)\n\tInfof(format string, args ...any)\n\tWarnf(format string, args ...any)\n\tErrorf(format string, args ...any)\n\tFatalf(format string, args ...any)\n}\n\ntype StructuredLogger interface {\n\tDebugw(msg string, keysAndValues ...any)\n\tInfow(msg string, keysAndValues ...any)\n\tWarnw(msg string, keysAndValues ...any)\n\tErrorw(msg string, keysAndValues ...any)\n\tFatalw(msg string, keysAndValues ...any)\n}\ntype ZapLogger interface {\n\tDebugz(msg string, fields ...zap.Field)\n\tInfoz(msg string, fields ...zap.Field)\n\tWarnz(msg string, feilds ...zap.Field)\n\tErrorz(msg string, fields ...zap.Field)\n\tFatalz(msg string, fields ...zap.Field)\n}\n\ntype Logger interface {\n\tWith(fields ...string) Logger\n\n\tWithObject(name string, obj zapcore.ObjectMarshaler) Logger\n\tWithArray(name string, arr zapcore.ArrayMarshaler) Logger\n\n\tWithControllerContext(*ControllerContext, consts.Phase) Logger\n\tWithServiceContext(*ServiceContext, consts.Phase) Logger\n\tWithDatabaseContext(*DatabaseContext, consts.Phase) Logger\n\n\tStandardLogger\n\tStructuredLogger\n\tZapLogger\n}\n```\n\n### Database\n\n```go\ntype Database[M Model] interface {\n\tCreate(objs ...M) error\n\tDelete(objs ...M) error\n\tUpdate(objs ...M) error\n\tUpdateByID(id string, key string, value any) error\n\tList(dest *[]M) error\n\tGet(dest M, id string) error\n\tFirst(dest M) error\n\tLast(dest M) error\n\tTake(dest M) error\n\tCount(*int64) error\n\tCleanup() error\n\tHealth() error\n\tTransaction(fn func(txDB Database[M]) error) error\n\tTransactionFunc(fn func(tx any) error) error\n\n\tDatabaseOption[M]\n}\n\ntype DatabaseOption[M Model] interface {\n\tWithDB(any) Database[M]\n\tWithTx(tx any) Database[M]\n\tWithTable(name string) Database[M]\n\tWithDebug() Database[M]\n\tWithQuery(query M, config ...QueryConfig) Database[M]\n\tWithCursor(string, bool, ...string) Database[M]\n\tWithTimeRange(columnName string, startTime time.Time, endTime time.Time) Database[M]\n\tWithSelect(columns ...string) Database[M]\n\tWithSelectRaw(query any, args ...any) Database[M]\n\tWithIndex(indexName string, hint ...consts.IndexHintMode) Database[M]\n\tWithRollback(rollbackFunc func()) Database[M]\n\tWithJoinRaw(query string, args ...any) Database[M]\n\tWithLock(mode ...consts.LockMode) Database[M]\n\tWithBatchSize(size int) Database[M]\n\tWithPagination(page, size int) Database[M]\n\tWithLimit(limit int) Database[M]\n\tWithExclude(map[string][]any) Database[M]\n\tWithOrder(order string) Database[M]\n\tWithExpand(expand []string, order ...string) Database[M]\n\tWithPurge(...bool) Database[M]\n\tWithCache(...bool) Database[M]\n\tWithOmit(...string) Database[M]\n\tWithDryRun() Database[M]\n\tWithoutHook() Database[M]\n}\n```\n\n### Modal\n\n```go\ntype Model interface {\n\tGetTableName() string\n\tGetID() string\n\tSetID(id ...string)\n\tClearID()\n\tGetCreatedBy() string\n\tGetUpdatedBy() string\n\tGetCreatedAt() time.Time\n\tGetUpdatedAt() time.Time\n\tSetCreatedBy(string)\n\tSetUpdatedBy(string)\n\tSetCreatedAt(time.Time)\n\tSetUpdatedAt(time.Time)\n\tExpands() []string\n\tExcludes() map[string][]any\n\tPurge() bool\n\tMarshalLogObject(zapcore.ObjectEncoder) error\n\n\tCreateBefore(*ModelContext) error\n\tCreateAfter(*ModelContext) error\n\tDeleteBefore(*ModelContext) error\n\tDeleteAfter(*ModelContext) error\n\tUpdateBefore(*ModelContext) error\n\tUpdateAfter(*ModelContext) error\n\tListBefore(*ModelContext) error\n\tListAfter(*ModelContext) error\n\tGetBefore(*ModelContext) error\n\tGetAfter(*ModelContext) error\n}\n```\n\n### Service\n\n```go\ntype Service[M Model, REQ Request, RSP Response] interface {\n\tCreate(*ServiceContext, REQ) (RSP, error)\n\tDelete(*ServiceContext, REQ) (RSP, error)\n\tUpdate(*ServiceContext, REQ) (RSP, error)\n\tPatch(*ServiceContext, REQ) (RSP, error)\n\tList(*ServiceContext, REQ) (RSP, error)\n\tGet(*ServiceContext, REQ) (RSP, error)\n\n\tCreateMany(*ServiceContext, REQ) (RSP, error)\n\tDeleteMany(*ServiceContext, REQ) (RSP, error)\n\tUpdateMany(*ServiceContext, REQ) (RSP, error)\n\tPatchMany(*ServiceContext, REQ) (RSP, error)\n\n\tCreateBefore(*ServiceContext, M) error\n\tCreateAfter(*ServiceContext, M) error\n\tDeleteBefore(*ServiceContext, M) error\n\tDeleteAfter(*ServiceContext, M) error\n\tUpdateBefore(*ServiceContext, M) error\n\tUpdateAfter(*ServiceContext, M) error\n\tPatchBefore(*ServiceContext, M) error\n\tPatchAfter(*ServiceContext, M) error\n\tListBefore(*ServiceContext, *[]M) error\n\tListAfter(*ServiceContext, *[]M) error\n\tGetBefore(*ServiceContext, M) error\n\tGetAfter(*ServiceContext, M) error\n\n\tCreateManyBefore(*ServiceContext, ...M) error\n\tCreateManyAfter(*ServiceContext, ...M) error\n\tDeleteManyBefore(*ServiceContext, ...M) error\n\tDeleteManyAfter(*ServiceContext, ...M) error\n\tUpdateManyBefore(*ServiceContext, ...M) error\n\tUpdateManyAfter(*ServiceContext, ...M) error\n\tPatchManyBefore(*ServiceContext, ...M) error\n\tPatchManyAfter(*ServiceContext, ...M) error\n\n\tImport(*ServiceContext, io.Reader) ([]M, error)\n\tExport(*ServiceContext, ...M) ([]byte, error)\n\n\tFilter(*ServiceContext, M) M\n\tFilterRaw(*ServiceContext) string\n\n\tLogger\n}\n```\n\n### RBAC\n\n```go\ntype RBAC interface {\n    AddRole(name string) error\n    RemoveRole(name string) error\n\n    GrantPermission(role string, resource string, action string) error\n    RevokePermission(role string, resource string, action string) error\n\n    AssignRole(subject string, role string) error\n    UnassignRole(subject string, role string) error\n}\n```\n\nDisabled mode behavior:\n\n- When RBAC is disabled or not initialized, the framework returns a safe no-op RBAC implementation. All RBAC operations succeed without side effects, preventing panics and allowing normal data operations.\n\n### Cache\n\n```go\ntype Cache[T any] interface {\n\tGet(key string) (T, error)\n\tPeek(key string) (T, error)\n\tSet(key string, value T, ttl time.Duration) error\n\tDelete(key string) error\n\tExists(key string) bool\n\tLen() int\n\tClear()\n\tWithContext(ctx context.Context) Cache[T]\n}\n\ntype DistributedCache[T any] interface {\n\tCache[T]\n\tSetWithSync(key string, value T, localTTL time.Duration, remoteTTL time.Duration) error\n\tGetWithSync(key string, localTTL time.Duration) (T, error)\n\tDeleteWithSync(key string) error\n}\n```\n\n### Module\n\n```go\ntype Module[M Model, REQ Request, RSP Response] interface {\n\tService() Service[M, REQ, RSP]\n\tPub() bool\n\tRoute() string\n\tParam() string\n}\n```\n\n### ESDocumenter\n\n```go\ntype ESDocumenter interface {\n\tDocument() map[string]any\n\tGetID() string\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforbearing%2Fgst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforbearing%2Fgst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforbearing%2Fgst/lists"}