Compare commits

...

5223 Commits

Author SHA1 Message Date
f3d36ad408 Apply gci import order changes 2026-05-18 20:36:18 +00:00
64aaf9e14d Apply gci import order changes 2026-04-28 09:21:28 +00:00
320ad437cb feat(cli): 添加可视化配置编辑器 2026-04-28 17:20:52 +08:00
94623a19d1 feat(cmd/gf): add gendao fileNameCase and ai coding stuffs (#4764)
This pull request introduces new and updated prompt and instruction
documents for the experimental OPSX workflow system, providing detailed,
step-by-step guidance for proposing, applying, archiving, and exploring
changes using OpenSpec. The changes standardize workflow guardrails,
clarify user interactions, and ensure consistent artifact handling
across all major workflow operations.

**OPSX Workflow Prompt Additions and Enhancements:**

* **Propose Workflow**
- Adds `.agents/prompts/opsx/propose.md` outlining how to propose a new
change, including artifact creation order, dependency handling, and user
input requirements. Emphasizes using schema-defined instructions and
templates, and clarifies that context/rules are for internal guidance
only.

* **Apply Workflow**
- Introduces `.agents/prompts/opsx/apply.md` detailing the process for
implementing tasks from an OpenSpec change. Covers change selection,
context reading, task loop execution, state handling, and output
formatting. Includes guardrails for ambiguity, blockers, and minimal
change scope.

* **Archive Workflow**
- Adds `.agents/prompts/opsx/archive.md` specifying the process for
archiving completed changes, including artifact/task completion checks,
delta spec sync assessment, user prompts for incomplete work, and
summary output. Ensures robust handling of archive naming conflicts and
user confirmations.

* **Explore Mode**
- Adds `.agents/prompts/opsx/explore.md` describing "explore mode" for
non-implementation discovery, problem investigation, and requirements
clarification. Outlines stance, behaviors, and guardrails for thinking
and artifact capture without code changes.

**Documentation Standardization:**

* **Markdown Formatting Standards**
- Adds `.agents/instructions/markdown-format.instructions.md` to
standardize markdown document formatting, including heading levels, code
block usage, list formatting, and language-specific punctuation rules
for improved clarity and consistency.
2026-04-25 17:47:05 +08:00
cb7cfa58ab fix: guard os.Args access for wasm which panics when building (#4762)
This pull request improves the reliability and safety of server restart
and reload operations by ensuring the correct retrieval of the current
executable path and process arguments. It replaces direct usage of
`os.Args[0]` with a more robust approach using `gfile.SelfPath()`, and
adds error handling for cases where the executable path cannot be
determined. Additionally, it introduces a helper function to safely
obtain process arguments, and removes an unnecessary import.

**Executable Path Handling and Error Checking:**

- Replaced usage of `os.Args[0]` with `gfile.SelfPath()` throughout the
server admin and process management code to reliably determine the
current executable path; added checks and error responses when the path
cannot be determined.
[[1]](diffhunk://#diff-0d174b149c56c4aa7ffeba2be94d16dc1b8000933f1f2a2e6bf011acdad3272fL122-R134)
[[2]](diffhunk://#diff-0d174b149c56c4aa7ffeba2be94d16dc1b8000933f1f2a2e6bf011acdad3272fL168-R184)
[[3]](diffhunk://#diff-3b4265be7ef0335b832dacfc2fc7ddc0f9dfae5b81340ff57d2b6a526c60d9e1L62-R65)
- Added early returns in initialization functions if `os.Args` is empty,
preventing potential panics or misbehavior when the argument list is
missing.
[[1]](diffhunk://#diff-0aa99f033274ea60b9c466ae4fc98d0816ec13781d8ec787fb3ef106a49a79ecR35-R37)
[[2]](diffhunk://#diff-5782fa47aa858b8e8358fd50353b050ee30418b7844b36e313e9c6d01188c092R47-R49)

**Process Argument Handling:**

- Introduced the `getCurrentProcessArgs()` helper function to safely
return process arguments (excluding the program name), ensuring correct
behavior even if no arguments are provided. Updated process creation
calls to use this helper.

**Code Cleanup:**

- Removed an unused import of the `os` package from
`ghttp_server_admin.go`.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 20:44:57 +08:00
1878202625 test(contrib/drivers/mariadb): add layer 3 features and issue regression tests (#4724)
## Summary

- Port 5 feature tests: duplicate-key handling
(OnDuplicate/OnDuplicateEx/Save), JSON field operations, row-level
locking (Lock/LockUpdate/LockShared with transactions), master-slave
configuration, table metadata inspection
- Port 1 partition test: RANGE partitioning with Partition() clause
(adapted from MySQL baseline)
- Port 30 issue regression tests from MySQL baseline
- Includes 14 testdata SQL files for issue-specific table schemas

Layer 3 tests cover MariaDB-specific adaptations where needed (e.g.,
SKIP LOCKED requires MariaDB 10.6+ — commented out for compatibility,
LOCK IN SHARE MODE instead of FOR SHARE for older versions).

All tests are structurally aligned with the MySQL driver baseline.
Package and import references are adapted for MariaDB.

ref #4689

Co-authored-by: John Guo <claymore1986@gmail.com>
2026-04-10 09:38:43 +08:00
bb71ccfd4c fix(database/gdb): strip quote chars from schema in Model.TableFields (#4730)
## Summary

When performing cross-database JOINs with soft-delete, the schema name
parsed from `` `schema`.`table` `` format retains database-specific
quote characters. These quoted schema names break `information_schema`
WHERE clause queries in `TableFields` lookups.

This PR strips quote characters from `usedSchema` in
`Model.TableFields()`, matching the existing unquoting pattern used for
`usedTable` via `guessPrimaryTableName`.

## Changes

- `database/gdb/gdb_model_utility.go`: Add quote-stripping for
`usedSchema` using `gstr.Trim` with database-specific quote chars from
`GetChars()`

## Test

Existing `Test_Issue2338` in MySQL
(`contrib/drivers/mysql/mysql_z_unit_issue_test.go:685`) covers this
case. The MariaDB version exists in PR #4724 branch
(`contrib/drivers/mariadb/mariadb_z_unit_issue_test.go:688`), not yet
merged. Once both PRs are merged, the MariaDB test will also validate
this fix.

closes #4725

Co-authored-by: John Guo <claymore1986@gmail.com>
2026-04-10 09:05:17 +08:00
f67b2dca26 fix(contrib/drivers/mysql): use unreachable port for nodeInvalid test config (#4726)
## Summary
- Change nodeInvalid port from 3307 to 3316 (default 3306 + 10) so the
connection is guaranteed to fail as intended
- Port 3307 may collide with a running MariaDB instance in CI, causing
nodeInvalid to accidentally connect to a live database

ref #4689
2026-03-24 17:51:21 +08:00
68b02218d7 test(contrib/drivers/mariadb): add infrastructure, core and model tests (#4719)
## Summary

- Add full test infrastructure (`mariadb_unit_init_test.go`) with
MariaDB-specific helpers (createTable, createInitTable, dropTable)
matching the MySQL test baseline
- Port 4 basic tests from MySQL: `Test_New`, `Test_DB_Ping`,
`Test_DB_Query`, `Test_DB_Exec`
- Port 47 core tests covering CRUD operations, raw SQL, schema
switching, and DB/TX method parity
- Port 55 model tests covering Model API: Fields, Where, Scan, Save,
Replace, InsertIgnore, InsertGetId, OmitEmpty, Distinct,
Count/Min/Max/Avg/Sum, HasField, chained operations, testdata SQL-based
scenarios and more
- Add 5 testdata SQL files required by model tests (copied from MySQL
baseline)

All tests are structurally identical to the MySQL driver baseline. SQL
syntax is standard and shared. Package and import references are adapted
for MariaDB.

ref #4689

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-24 17:50:05 +08:00
766579d868 test(contrib/drivers/mariadb): add transaction, where, hook and ctx tests (#4720)
## Summary

- Port 28 transaction tests: Begin/Commit/Rollback, nested SavePoint,
transaction propagation (Required/Nested/NotSupported), timeout, panic
recovery, concurrent transactions
- Port 41 where-condition tests:
Where/WhereOr/WhereNot/WhereIn/WhereBetween, prefix handling, complex
AND/OR combinations, NULL checks, struct/map/slice parameter types
- Port 11 hook tests: HookSelect/HookInsert/HookUpdate/HookDelete for
both Model and raw SQL paths, hook chaining and context propagation
- Port 8 ctx tests: context propagation through Model/TX operations,
context-based logging with traceId verification

All tests are structurally identical to the MySQL driver baseline. SQL
syntax is standard and shared. Package and import references are adapted
for MariaDB.

ref #4689
2026-03-12 11:16:14 +08:00
030cd84836 test(contrib/drivers/mariadb): add softtime, with, scanlist, union and do tests (#4721)
## Summary

- Port 48 soft-time tests: soft create/update/delete with
timestamp/datetime/date types, SoftTime switches
(SoftTimeTypeOff/Delete/Timestamp), Unscoped, ForceDelete, joined
queries with soft-delete
- Port 19 With/ScanList tests: With/WithAll for eager loading of
hasOne/hasMany/belongsTo relations, ScanList for manual relation
mapping, nested With
- Port 12 union tests: Union/UnionAll with various parameter forms
(string/Model/subquery), combined with OrderBy, Limit, Where conditions
- Port 12 gdb.Do tests: DoSelect/DoInsert/DoUpdate/DoDelete raw
operation hooks, batch insert, InsertIgnore/InsertGetId/Replace via
DoInsert option

Includes testdata SQL files for With relation table schemas (with_tpl).
Soft-time tests create tables inline via SQL, no separate testdata files
needed.

All tests are structurally identical to the MySQL driver baseline. SQL
syntax is standard and shared. Package and import references are adapted
for MariaDB.

ref #4689
2026-03-12 11:15:42 +08:00
6314cd4c89 test(contrib/drivers/mariadb): add builder, struct, join, batch, cache and omit tests (#4722)
## Summary

- Port 25 SQL builder tests: WhereBuilder chaining, complex
Where/WhereOr/WhereNot combinations, nested builders, Build() output
verification
- Port 9 subquery tests: subquery in Where/Having/From, correlated
subqueries, subquery with Model builder
- Port 11 struct-mapping tests: Scan to struct/slice, embedded structs,
tag-based field mapping, pointer fields, OmitEmpty with struct input
- Port 12 join tests: LeftJoin/RightJoin/InnerJoin, multi-table joins,
join with Where/Order/Fields, subquery joins, testdata SQL-based join
scenarios
- Port 8 batch operation tests: Batch insert/update/replace/save with
configurable batch size, conflict handling
- Port 4 cache tests: query result caching, cache invalidation on
update/delete, cache duration, ClearCache
- Port 4 OmitNil/OmitEmpty tests: nil field omission in insert/update,
zero-value vs nil distinction

All tests are structurally identical to the MySQL driver baseline. SQL
syntax is standard and shared. Package and import references are adapted
for MariaDB.

ref #4689
2026-03-12 11:15:17 +08:00
0588009c40 test(contrib/drivers/mariadb): add pagination, error, concurrent, rawtype and sharding tests (#4723)
## Summary

- Port 11 pagination tests: Page/Limit/Offset, combined with
Where/Order, boundary conditions (page 0, large offset), Count with
pagination
- Port 8 error-handling tests: invalid table/field names, syntax errors,
duplicate key, connection errors, error wrapping and message
verification
- Port 5 concurrency tests: parallel read/write with goroutines and
WaitGroup, concurrent transactions, race condition verification
- Port 6 raw-type tests: custom type scanning, time.Time handling,
json.RawMessage, sql.NullString/NullInt64, []byte fields
- Port 6 sharding/table-name tests: dynamic table name via Sharding
callback, table name with prefix, schema.table format

All tests are structurally identical to the MySQL driver baseline. SQL
syntax is standard and shared. Package and import references are adapted
for MariaDB.

ref #4689
2026-03-12 11:14:48 +08:00
6204c132c7 test(contrib/drivers/mysql): add pagination and error handling tests (#4703)
## Summary
- Add comprehensive pagination tests (Limit, Offset, Page, ForPage)
- Add error handling tests for invalid operations
- Add tests for edge cases and boundary conditions

**Test coverage added:**
- Pagination: ~28 test functions
- Error handling: ~20 test functions

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -run "TestModel_Pagination|TestModel_Error|TestModel_InvalidOperation"
```
2026-02-27 20:00:25 +08:00
a4b80e8680 fix(contrib/drivers/pgsql): preserve bytea data integrity on read and write (#4678)
## Summary

Fix two bytea data corruption issues in the PostgreSQL driver:

1. **READ path** (fixes #4677): `CheckLocalTypeForField` and
`ConvertValueForLocal` had no case for plain `bytea` type, causing it to
fall through to the Core layer which incorrectly mapped it to
`LocalTypeString`. Binary data was then converted to string via
`gconv.String()`, corrupting the bytes on retrieval.

2. **WRITE path** (fixes #4231): `ConvertValueForField` applied
PostgreSQL array syntax conversion (`[` → `{`, `]` → `}`) to all slice
types including `[]byte` for bytea columns, corrupting bytes `0x5B`
(`[`) and `0x5D` (`]`) on insertion.

## Changes

- **`contrib/drivers/pgsql/pgsql_convert.go`**:
  - `CheckLocalTypeForField`: Add `case "bytea"` → `LocalTypeBytes`
- `ConvertValueForLocal`: Add `case "bytea"` to preserve `[]byte` as-is
- `ConvertValueForField`: Skip `[]`→`{}` replacement for `[]byte` with
`bytea` field type

- **`contrib/drivers/pgsql/pgsql_z_unit_convert_test.go`**:
- Add unit tests for `bytea` type in `CheckLocalTypeForField`,
`ConvertValueForLocal`, and `ConvertValueForField`

- **`contrib/drivers/pgsql/pgsql_z_unit_issue_test.go`**:
- Add `Test_Issue4677`: End-to-end round-trip test with various binary
data (including 0x00, 0x5B, 0x5D, 0xFF)
- Add `Test_Issue4231`: Targeted test for 0x5D byte corruption on write

## Test plan

- [x] `Test_CheckLocalTypeForField` - bytea returns `LocalTypeBytes`
- [x] `Test_ConvertValueForLocal` - bytea preserves `[]byte` as-is
- [x] `Test_ConvertValueForField` - bytea skips array syntax replacement
- [x] `Test_Issue4677` - full DB round-trip with binary data
- [x] `Test_Issue4231` - write path preserves 0x5B/0x5D bytes
- [x] Full pgsql test suite passes with no regressions

closes #4677
closes #4231

ref #4689
2026-02-27 16:22:43 +08:00
0e1cb15dc0 fix(os/gstructs): strip tag options in TagPriorityName to avoid field name pollution (#4681)
## Summary
- Fix `TagPriorityName()` to strip comma-separated tag options (e.g.,
`omitempty`) from tag values
- Before: `json:"user_name,omitempty"` → field name =
`user_name,omitempty`
- After: `json:"user_name,omitempty"` → field name = `user_name`
- Aligns with `structcache.genPriorityTagAndFieldName()` which already
handles this correctly
- When tag name is empty (e.g., `gconv:",omitempty"`), continues to next
priority tag instead of breaking

## Test plan
- [x] Reproduced bug: `RuleFuncInput.Field` was `user_name,omitempty`
instead of `user_name`
- [x] Verified fix: field name correctly extracted as `user_name`
- [x] Verified fallthrough: `gconv:",omitempty"` + `json:"name"` → uses
`name`
- [x] Existing `Test_Fields_TagPriorityName` passes
- [x] Full `os/gstructs` test suite passes
- [x] Full `util/gvalid` test suite passes
- [x] Full `util/gconv` test suite passes

closes #4665
2026-02-27 16:14:26 +08:00
612e545ae2 fix(databse/gdb): use COUNT(1) if fields number is greater than 1 even when parameter useFieldForCount is true in AllAndCount/ScanAndCount (#4701)
## Summary
Fix bug where `AllAndCount(true)` with multiple fields generates invalid
SQL `COUNT(field1, field2, ...)` causing syntax error.

## Root Cause
When `useFieldForCount=true`, the COUNT query inherits the fields
configuration from the model:
```go
// Before (buggy code)
if !useFieldForCount {
    countModel.fields = []any{Raw("1")}
}
// When useFieldForCount=true, fields remain as ["id", "nickname"]
// Generates: SELECT COUNT(id, nickname) FROM table 
```

## Fix
Always use `COUNT(1)` regardless of `useFieldForCount` parameter since
COUNT() accepts only one argument:
```go
// After (fixed code)
// Always use COUNT(1) for counting, regardless of useFieldForCount.
// COUNT() accepts only one argument, so we can't use multiple fields.
countModel.fields = []any{Raw("1")}
```

Applied to both `AllAndCount()` and `ScanAndCount()` methods.

## Tests
Added `Test_Issue4698` with 5 test cases:
1. AllAndCount(true) with multiple fields
2. AllAndCount(false) with multiple fields (baseline)
3. ScanAndCount with multiple fields
4. AllAndCount with single field
5. AllAndCount with WHERE condition

All tests verify that COUNT generates valid SQL and returns correct
count.

## Related
Fixes #4698
Ref #4703 (discovered during pagination test development)
2026-02-27 16:12:58 +08:00
bbdd442954 fix(database/gdb): treat negative Limit/Page/Offset values as zero (#4702)
## Summary
Fix bug where negative values in `Limit()`, `Page()`, and `Offset()`
methods generate invalid SQL causing database errors.

## Root Cause
The methods don't validate negative input:
- `Limit(-1)` generates `LIMIT -1` → SQL error
- `Page(1, -10)` generates `LIMIT -10` → SQL error  
- `Offset(-5)` generates `OFFSET -5` → SQL error

## Fix
Treat all negative values as zero (safe default):

**Limit() method**:
```go
case 1:
    if limit[0] < 0 { limit[0] = 0 }
case 2:
    if limit[0] < 0 { limit[0] = 0 }
    if limit[1] < 0 { limit[1] = 0 }
```

**Page() method**:
```go
if limit < 0 { limit = 0 }
```

**Offset() method**:
```go
if offset < 0 { offset = 0 }
```

## Behavior Changes
- `Limit(-1)` → `Limit(0)` (no limit)
- `Limit(-10, -5)` → `Limit(0, 0)` (no offset, no limit)
- `Page(1, -10)` → `Page(1, 0)` (no results)
- `Offset(-5)` → `Offset(0)` (no offset)

## Documentation
Added "Note: Negative values are treated as zero" to all three methods.

## Tests
Added `Test_Issue4699` in `database/gdb/gdb_z_unit_issue_test.go` with 7
test cases:
1. Limit with single negative parameter
2. Limit with two negative parameters
3. Limit with mixed parameters (negative start, positive limit)
4. Page with negative limit
5. Page with negative limit on page 2
6. Offset with negative value
7. Offset with positive value (sanity check)

## Related
Fixes #4699
Ref #4703 (discovered during pagination test development)
2026-02-27 16:00:53 +08:00
6686bd65a2 test(contrib/drivers/mysql): enhance transaction tests (#4704)
## Summary
- Add nested transaction tests
- Add transaction propagation tests
- Add transaction rollback/commit behavior tests
- Add transaction context handling tests

**Test coverage added:** ~25 test functions

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -run "TestTX_Nested|TestTX_Propagation|TestTX_Transaction"
```
2026-02-27 15:56:16 +08:00
319a812934 test(contrib/drivers/mysql): enhance data type tests (#4705)
## Summary
- Add comprehensive tests for various data types (int, float, string,
[]byte, time, etc.)
- Add struct field type conversion tests
- Add JSON/XML data type tests
- Add binary data handling tests

**Test coverage added:** ~28 test functions

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -run "TestModel_.*Type|TestModel_.*Convert"
```
2026-02-27 15:53:44 +08:00
307c6ec307 test(contrib/drivers/mysql): enhance complex query tests (#4707)
## Summary
- Add comprehensive JOIN tests (Inner/Left/Right Join)
- Add SubQuery tests
- Add complex WHERE condition tests (Or/Group/Having)
- Add advanced query builder tests

**Test coverage added:** ~26 test functions across 3 files

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -run "TestModel_Join|TestModel_SubQuery|TestModel_Where.*Complex"
```
2026-02-27 15:52:41 +08:00
bac637570d test(contrib/drivers/mysql): add MySQL-specific feature tests (#4709)
## Summary
- Add ON DUPLICATE KEY UPDATE tests (basic, increment, batch,
conditional, transaction)
- Add MySQL JSON data type tests (insert/update/query, JSON_EXTRACT,
JSON_CONTAINS, struct scanning)
- Add MySQL partition tests (RANGE, HASH, LIST partitioning with CRUD
and transactions)

**Test coverage added:** ~25 test functions across 3 files (Layer 3)

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -run "Test_OnDuplicateKeyUpdate|Test_DataType_Json|Test_Partition"
```
2026-02-27 15:52:06 +08:00
c8a11f7f6e test(contrib/drivers/mysql): add concurrent/Hook/Ctx tests (#4708)
## Summary
- Add concurrent operation tests
- Add Hook mechanism tests (Insert/Update/Delete/Select)
- Add Context propagation tests
- Add race condition tests

**Test coverage added:** ~28 test functions across 5 files

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -race -run "TestModel_Concurrent|TestModel_Hook|TestModel_Ctx"
```
2026-02-26 16:28:20 +08:00
e0c032d1b1 fix(database/gdb): handle empty string in Fields() gracefully (#4700)
## Summary
Fix bug where `Fields("")` with empty string generates invalid SQL
`SELECT FROM table`.

## Root Cause
`mappingAndFilterToTableFields` method doesn't skip empty strings when
processing fields:
- `gstr.SplitAndTrim("", ",")` returns empty array
- No fields added to query
- Results in invalid SQL: `SELECT FROM table`

## Fix
Skip empty string fields in `mappingAndFilterToTableFields` (line
97-100):
```go
// Skip empty string fields
if fieldStr == "" {
    continue
}
```

## Behavior Changes
- `Fields("")` → SELECT * FROM table (uses default)
- `Fields("", "id")` → SELECT id FROM table (ignores empty string)
- `Fields("id", "", "nickname")` → SELECT id, nickname FROM table

## Tests
Added `Test_Issue4697` with 3 scenarios covering all cases above.

## Related
Fixes #4697
Ref #4703 (discovered during pagination test development)
2026-02-26 16:27:00 +08:00
063264ebff test(contrib/drivers/mysql): add Lock/Omit/Cache/Batch tests (#4706)
## Summary
- Add Lock/LockUpdate/LockShared tests
- Add OmitNil/OmitEmpty/OmitNilData tests
- Add Cache mechanism tests
- Add Batch operation tests

**Test coverage added:** ~34 test functions across 4 files

Ref #4689

## Test plan
```bash
cd contrib/drivers/mysql
go test -v -run "TestModel_Lock|TestModel_Omit|TestModel_Cache|TestModel_Batch"
```
2026-02-26 09:53:35 +08:00
02abc515a3 test(contrib/drivers/gaussdb): add soft time, with, scanlist test coverage (#4686)
## Summary
- Port 3 test files and 4 testdata SQL files from PgSQL driver to
GaussDB driver
- Add `gaussdb_z_unit_feature_soft_time_test.go` (15 tests): soft time
create/update/delete, bool/int/datetime soft delete
- Add `gaussdb_z_unit_feature_with_test.go` (6 tests): With/WithAll ORM
relation queries, multiple dependency levels
- Add `gaussdb_z_unit_feature_scanlist_test.go` (9 tests): ScanList for
1:1, 1:N, N:N relation mapping
- Add 4 testdata SQL files for With relation tests
- **30 new test functions**, ~3,941 net new lines

## Test plan
- [x] `go build ./...` passes
- [x] `gofmt` and `gci` applied
- [x] No remaining `pgsql` references in new files
- [ ] Run full test suite against GaussDB instance

ref #4689

---------

Co-authored-by: John Guo <claymore1986@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-26 09:51:52 +08:00
be7851c664 test(contrib/drivers/pgsql): add SoftTime, With, ScanList test coverage (#4676)
## Summary
- Add 3 new test files for pgsql driver (39 test functions, ~3800 lines)
- `pgsql_z_unit_feature_soft_time_test.go`: 15 tests — soft delete
(SoftDeleted/Unscoped), auto time fields
(CreatedAt/UpdatedAt/DeletedAt), time format options
- `pgsql_z_unit_feature_with_test.go`: 17 tests — With relation queries
(one-to-one, one-to-many, many-to-many), nested With, WithAll,
conditional With
- `pgsql_z_unit_feature_scanlist_test.go`: 7 tests — ScanList relation
mapping for struct slices
- Add testdata SQL templates for With tests

**PostgreSQL adaptations from MySQL:**
- `AUTO_INCREMENT` → `SERIAL/BIGSERIAL`
- `datetime` → `timestamp`
- MySQL backticks → PostgreSQL double quotes for identifiers
- Timestamp format handling for soft time fields

## Test plan
- [x] Run `go test -v -run "Test_Model_Soft" -count=1` in
`contrib/drivers/pgsql`
- [x] Run `go test -v -run "Test_Model_With" -count=1` in
`contrib/drivers/pgsql`
- [x] Run `go test -v -run "Test_Model_ScanList" -count=1` in
`contrib/drivers/pgsql`

ref #4689
2026-02-26 09:49:48 +08:00
dc08920a7f feat(gcrypto/gsha512): add sha512 implements (#4667)
Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-26 09:47:08 +08:00
1ab0b18115 feat(os/gcfg): add GetEffective method with standard config priority (#4673)
## Summary
- Add `GetEffective` and `MustGetEffective` methods following 12-Factor
App config priority
- Priority: Command line > Environment variables > Config file > Default
value
- Add clarifying notes to existing `GetWithEnv`/`GetWithCmd` methods
- Add comprehensive unit tests

## Test plan
- [x] All gcfg unit tests pass (44 tests)
- [x] New `Test_GetEffective` covers 6 scenarios:
  - Config file only
  - Env overrides config
  - Cmd overrides env
  - Default value fallback
  - Empty string override (industry standard)
  - Key only in env

Closes #4650

---------

Co-authored-by: John Guo <claymore1986@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-26 09:45:56 +08:00
ebd78fb533 test(contrib/drivers/pgsql): add transaction, where, hook, ctx test coverage (#4675)
## Summary
- Add 4 new test files for pgsql driver to align with MySQL driver test
coverage (86 test functions, ~3100 lines)
- `pgsql_z_unit_transaction_test.go`: 40 tests — TX CRUD, nested
transactions, propagation behaviors
(Required/RequiresNew/Nested/NotSupported/Mandatory/Never/Supports),
isolation levels (ReadCommitted/RepeatableRead/Serializable), savepoints
- `pgsql_z_unit_model_where_test.go`: 35 tests — Where variants
(string/slice/map/struct/gmap), comparisons (LT/LTE/GT/GTE), IN/NotIn,
Between, Like, Null, EXISTS/NOT EXISTS subqueries, WherePrefix with JOIN
- `pgsql_z_unit_feature_hook_test.go`: 6 tests —
Select/Insert/Update/Delete hooks, Count with hook, hook chaining and
error handling
- `pgsql_z_unit_feature_ctx_test.go`: 5 tests — context propagation,
trace logging (SpanId/TraceId), transaction context, timeout
cancellation
- Migrate `Test_Model_Where` from `pgsql_z_unit_model_test.go` to
dedicated where test file with expanded coverage (2 → 30+ sub-tests)

**PostgreSQL adaptations from MySQL:**
- `?` → `$N` placeholders for raw SQL
- `REPLACE INTO` → `OnConflict("id").Save()` for upsert
- `AUTO_INCREMENT` → `bigserial`
- `user` alias → `"user"` (reserved word in PgSQL)
- Skip `READ UNCOMMITTED` dirty read test (PgSQL treats as READ
COMMITTED)

## Test plan
- [ ] Run `go test -v -run "Test_TX_" -count=1` in
`contrib/drivers/pgsql`
- [ ] Run `go test -v -run "Test_Model_Where" -count=1` in
`contrib/drivers/pgsql`
- [ ] Run `go test -v -run "Test_Model_Hook" -count=1` in
`contrib/drivers/pgsql`
- [ ] Run `go test -v -run "Test_Ctx" -count=1` in
`contrib/drivers/pgsql`
- [ ] Verify `go vet ./...` passes (only unreachable code warnings
matching MySQL driver pattern)

ref #4689

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-26 09:43:32 +08:00
841003eeb3 test(contrib/drivers/gaussdb): add transaction, where, hook, ctx test coverage (#4685)
## Summary
- Port 4 test files from PgSQL driver to GaussDB driver to align test
coverage
- Add `gaussdb_z_unit_transaction_test.go` (40 tests): nested
transactions, savepoints, rollback, panic recovery, context propagation
- Add `gaussdb_z_unit_model_where_test.go` (35 tests): comprehensive
Where clause combinations (map, slice, struct, pointer, operators, nil,
empty)
- Add `gaussdb_z_unit_feature_hook_test.go` (6 tests): model hook
callbacks (Select/Insert/Update/Delete)
- Add `gaussdb_z_unit_feature_ctx_test.go` (5 tests): context
propagation, timeout, logging with context
- Remove old `Test_Model_Where` (2 sub-tests) from
`gaussdb_z_unit_model_test.go`, replaced by comprehensive version in
dedicated where test file (35 tests)
- **86 new test functions**, ~3,224 net new lines

## Test plan
- [x] `go build ./...` passes
- [x] `gofmt` and `gci` applied
- [x] No remaining `pgsql` references in new files
- [ ] Run `go test -v -run "Test_TX_" -count=1` against GaussDB instance
- [ ] Run `go test -v -run "Test_Model_Where" -count=1` against GaussDB
instance
- [ ] Run `go test -v -run "Test_Model_Hook" -count=1` against GaussDB
instance
- [ ] Run `go test -v -run "Test_Ctx" -count=1` against GaussDB instance

ref #4689
2026-02-26 09:42:10 +08:00
1739d4dfb2 feat(i18n/gi18n): decoding and loading i18n files content by automatic file extension check (#4662)
The i18n file handling now checks file extensions instead of content. If
no extension info is found, it reverts to checking the file content.
2026-02-11 15:19:40 +08:00
46cc4cef9e test(contrib/drivers/pgsql): add Union, DO and Raw Where test coverage (#4679)
## Summary
- Add `pgsql_z_unit_feature_union_test.go`: 4 tests for Union/UnionAll
on both db and model level
- Add `pgsql_z_unit_feature_model_do_test.go`: 10 tests for DO (Data
Object) pattern - insert, batch insert, update, pointer fields, WHERE,
DAO pattern, and field prefix handling
- Enhance `pgsql_z_unit_raw_test.go`: add `Test_Raw_Where` for subquery
NOT EXISTS and field comparison using `gdb.Raw()`, adapted for PgSQL
double-quote quoting
- Add `testdata/table_with_prefix.sql` for PgSQL-compatible FieldPrefix
test

All tests adapted from MySQL driver test suite with PgSQL-specific
adjustments:
- Nullable table schema for DO partial inserts (PgSQL NOT NULL is
stricter than MySQL)
- Double-quote identifier quoting instead of backticks
- Unquoted table aliases in generated SQL

## Test plan
- [x] All 15 new tests pass locally
- [x] Full pgsql test suite (107 tests) passes with zero regressions

ref #4689

---------

Co-authored-by: John Guo <claymore1986@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-11 14:41:42 +08:00
90331d85bf test(contrib/drivers/gaussdb): add union, DO, raw where test coverage (#4687)
## Summary
- Port 2 test files, 1 testdata SQL, and append Test_Raw_Where from
PgSQL driver to GaussDB driver
- Add `gaussdb_z_unit_feature_union_test.go` (4 tests): Union/UnionAll
query operations
- Add `gaussdb_z_unit_feature_model_do_test.go` (10 tests): DO
struct-based CRUD operations
- Append `Test_Raw_Where` to `gaussdb_z_unit_raw_test.go` (1 test): raw
SQL in Where with subquery and column comparison
- Add `testdata/table_with_prefix.sql` for DO prefix tests
- **15 new test functions**, ~605 net new lines

## Test plan
- [x] `go build ./...` passes
- [x] `gofmt` and `gci` applied
- [x] No remaining `pgsql` references in new files
- [ ] Run full test suite against GaussDB instance

ref #4689

---------

Co-authored-by: John Guo <claymore1986@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-11 14:40:46 +08:00
98fd2a1973 chore: cleanup makefile, remove unnecessary scripts (#4684)
This pull request primarily removes submodule management targets from
the `Makefile` and makes minor updates to the project documentation in
both English and Chinese. The most important changes are grouped below.

Makefile cleanup:

* Removed the `subup` and `subsync` targets from the `Makefile`,
eliminating commands related to updating and committing submodules.

Documentation updates:

* Updated the logo alt text in both `README.MD` and `README.zh_CN.MD`
from "goframe gf logo" to "goframe logo" for clarity.
[[1]](diffhunk://#diff-01e6d9ffed056a02cae8d8a0ec5d476a64d017bf85c0d5a94bb23ca21f33f5aaL4-R4)
[[2]](diffhunk://#diff-c93759cb9a9500f20e551c741eb167fc72825fd638d36121357feb8253ce6ac1L4-R4)
* Revised a description in `README.zh_CN.MD` to clarify the framework's
purpose, changing “一个强大的框架” to “一款强大的框架”.
* Simplified the license description in `README.zh_CN.MD` to state
"100%开源和免费".
2026-02-11 14:37:49 +08:00
d5633ebad7 fix(contrib/registry): etcd doKeepAlive does not exit even when client context done (#4669)
Fixed #4668 

```
// client
package main

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/net/gsvc"
	"github.com/gogf/gf/v2/os/gctx"

	"github.com/gogf/gf/contrib/registry/etcd/v2"
)

func main() {
	gsvc.SetRegistry(etcd.New(`etcd.etcd.orb.local:2379`))

	var (
		ctx    = gctx.New()
		client = g.Client()
	)
	client.SetDiscovery(gsvc.GetRegistry())
	res := client.GetContent(ctx, `http://hello.svc/`)
	g.Log().Info(ctx, res)
}

// server
package main

import (
	"github.com/gogf/gf/contrib/registry/etcd/v2"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/net/ghttp"
	"github.com/gogf/gf/v2/net/gsvc"
)

func main() {
	gsvc.SetRegistry(etcd.New(`etcd.etcd.orb.local:2379`))

	s := g.Server(`hello.svc`)
	s.BindHandler("/", func(r *ghttp.Request) {
		g.Log().Info(r.Context(), `request received`)
		r.Response.Write(`Hello world`)
	})
	s.Run()
}

```

```
        /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:105
2. context deadline exceeded
 
Stack:
1.  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doKeepAlive
    /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:107

{"level":"warn","ts":"2026-01-30T22:30:33.863409+0800","logger":"etcd-client","caller":"v3@v3.5.17/retry_interceptor.go:63","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0x1400023a780/etcd.etcd.orb.local:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = \"transport: Error while dialing: dial tcp 192.168.138.6:2379: connect: operation timed out\""}
2026-01-30T22:30:33.863+08:00 [ERRO] keepalive retry register failed, will retry in 2s: etcd grant failed with keepalive ttl "10s": context deadline exceeded
1. etcd grant failed with keepalive ttl "10s"
   1).  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doRegisterLease
        /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:38
   2).  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doKeepAlive
        /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:105
2. context deadline exceeded
 
Stack:
1.  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doKeepAlive
    /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:107

{"level":"warn","ts":"2026-01-30T22:30:40.865971+0800","logger":"etcd-client","caller":"v3@v3.5.17/retry_interceptor.go:63","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0x1400023a780/etcd.etcd.orb.local:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = \"transport: Error while dialing: dial tcp 192.168.138.6:2379: connect: operation timed out\""}
2026-01-30T22:30:40.866+08:00 [ERRO] keepalive retry register failed, will retry in 3s: etcd grant failed with keepalive ttl "10s": context deadline exceeded
1. etcd grant failed with keepalive ttl "10s"
   1).  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doRegisterLease
        /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:38
   2).  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doKeepAlive
        /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:105
2. context deadline exceeded
 
Stack:
1.  github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doKeepAlive
    /Users/shown/workspace/golang/open_source/gf/contrib/registry/etcd/etcd_registrar.go:107

2026-01-30T22:30:43.903+08:00 [DEBU] etcd put success with key "/service/default/default/hello.svc/latest/192.168.27.229:60201,192.168.139.3:60201,192.168.163.0:60201", value "{"insecure":true,"protocol":"http"}", lease "7587892536770637317"
2026-01-30T22:30:43.904+08:00 [INFO] keepalive retry register success for service "/service/default/default/hello.svc/latest/192.168.27.229:60201,192.168.139.3:60201,192.168.163.0:60201"
2026-01-30T22:30:51.385+08:00 [INFO] {e0ffad1cac888f18eed5ef7a3ba3f6d0} request received
2026-01-30T22:30:52.121+08:00 [INFO] {78ca8848ac888f18573a386e0b596eaa} request received
```

---------

Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>
2026-02-11 14:37:15 +08:00
58d6410291 fix(registry/etcd): etcd.NewWithClient() has no DialTimeout (#4670)
# Description

The `etcd.NewWithClient()` function internally does not set a
`DialTimeout` value, which causes it to default to 0. This leads to all
`context.WithTimeout(context.Background(), r.etcdConfig.DialTimeout)`
calls immediately timing out, as a timeout of 0 results in instant
expiration.

# Example

```go
package main

import (
	"context"
	"testing"
	"time"

	"github.com/gogf/gf/contrib/registry/etcd/v2"
	"github.com/gogf/gf/v2/errors/gerror"
	"github.com/gogf/gf/v2/net/gsvc"
	clientv3 "go.etcd.io/etcd/client/v3"
)

func TestEtcdWithClient(t *testing.T) {
	cli, _ := clientv3.New(clientv3.Config{
		Endpoints:   []string{"http://127.0.0.1:2379"},
		DialTimeout: 2 * time.Second,
	})
	defer cli.Close()

	registry := etcd.NewWithClient(cli)
	_, err := registry.Register(context.Background(), &gsvc.LocalService{
		Name:      "test",
		Endpoints: gsvc.NewEndpoints("127.0.0.1:8888"),
	})
	if err != nil {
		t.Error(gerror.Stack(err))
		return
	}
}
```

Running tool: /opt/homebrew/bin/go test -test.fullpath=true -timeout 30s
-run ^TestEtcdWithClient$ etop.roommanageserver

=== RUN   TestEtcdWithClient

{"level":"warn","ts":"2026-01-31T09:59:06.994867+0800","logger":"etcd-client","caller":"v3@v3.6.7/retry_interceptor.go:65","msg":"retrying
of unary invoker
failed","target":"etcd-endpoints://0x14000262f00/127.0.0.1:2379","method":"/etcdserverpb.Lease/LeaseGrant","attempt":0,"error":"rpc
error: code = DeadlineExceeded desc = context deadline exceeded"}
/Users/guolihui/projects/mpl-poker/room-manage-server/main_test.go:27:
1. etcd grant failed with keepalive ttl "10s"
1).
github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).doRegisterLease

/Users/guolihui/projects/mpl-poker/room-manage-server/gfv2/contrib/registry/etcd/etcd_registrar.go:38
2). github.com/gogf/gf/contrib/registry/etcd/v2.(*Registry).Register

/Users/guolihui/projects/mpl-poker/room-manage-server/gfv2/contrib/registry/etcd/etcd_registrar.go:24
           3).  etop%2eroommanageserver.TestEtcdWithClient
/Users/guolihui/projects/mpl-poker/room-manage-server/main_test.go:22
        2. context deadline exceeded

--- FAIL: TestEtcdWithClient (0.00s)
2026-02-11 14:25:19 +08:00
54087de518 test(contrib/drivers/pgsql): add Builder/Subquery/Join/Struct tests (#4680)
## Summary
- Port MySQL test coverage for Builder, Subquery, Join, and Struct
features to PgSQL driver
- Add 4 new test files with 23 test functions covering builder patterns,
subquery WHERE/HAVING/Model, all JOIN types, and struct scanning
- PgSQL dialect adaptations: double-quoted identifiers, GROUP BY with
HAVING, letter-prefixed table names, int64 id assertions, removed `Uid`
field

## Test plan
- [x] Builder tests pass: `go test -v -run
"Test_Model_Builder|Test_Safe_Builder" -count=1`
- [x] Subquery tests pass: `go test -v -run "Test_Model_SubQuery"
-count=1`
- [x] Join tests pass: `go test -v -run
"Test_Model_.*Join.*|Test_Model_FieldsPrefix" -count=1`
- [x] Struct tests pass: `go test -v -run
"Test_Model_Embedded|Test_Struct|Test_Structs|Test_Model_Scan|Test_Scan_Auto"
-count=1`
- [x] Full PgSQL test suite: 113/113 PASS

ref #4689
2026-02-11 13:51:47 +08:00
fc39fffe9c test(contrib/drivers/gaussdb): add builder, subquery, join, struct test coverage (#4688)
## Summary
- Port 4 test files from PgSQL driver to GaussDB driver
- Add `gaussdb_z_unit_feature_model_builder_test.go` (2 tests): SQL
builder with raw expressions and safe mode
- Add `gaussdb_z_unit_feature_model_subquery_test.go` (3 tests):
subquery in Select/Where/Having
- Add `gaussdb_z_unit_feature_model_join_test.go` (7 tests):
LeftJoin/RightJoin/InnerJoin with various conditions
- Add `gaussdb_z_unit_feature_model_struct_test.go` (11 tests):
struct-based insert/update/scan with tag mapping
- **23 new test functions**, ~861 net new lines

## Test plan
- [x] `go build ./...` passes
- [x] `gofmt` and `gci` applied
- [x] No remaining `pgsql` references in new files
- [ ] Run full test suite against GaussDB instance

ref #4689
2026-02-11 13:50:30 +08:00
6a3ea897a8 docs: Update README Add DeepWiki badges (#4661) 2026-01-28 15:42:11 +08:00
91f9864b25 fix: update gf cli to v2.10.0 (#4658)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: gqcn <gqcn@users.noreply.github.com>
2026-01-27 17:43:29 +08:00
8c8c7c8c71 feat: new version v2.10.0 (#4657)
This pull request upgrades the GoFrame framework and all related
dependencies from version `v2.9.8` (and similar) to `v2.10.0` across the
codebase. It also refactors the `.make_version.sh` script to improve
cross-platform compatibility when editing files, and ensures
documentation reflects the new version. These changes help keep the
project up-to-date and simplify version management.

**Dependency upgrades:**

* Updated all `go.mod` files in the main repo and contrib modules to
require `github.com/gogf/gf/v2 v2.10.0` (replacing `v2.9.8` and similar)
for consistency and latest features/bugfixes.
[[1]](diffhunk://#diff-ee0abb9c50b9f91f424349123e31b7b1ba1e1e4f7497250422696c5bda2e74ceL6-R12)
[[2]](diffhunk://#diff-cef597d401b6dad225f9e2e431bdde7e53cb60bdf287624cef38a6a7bb9ae7a3L7-R7)
[[3]](diffhunk://#diff-970f7eacff9cd97a0d8a00d59ea8041eedaa21c7544c6669aaa58ca692c6b274L6-R6)
[[4]](diffhunk://#diff-c23d0ca80cd6588b7df84de8ef84713f0ce0555ba05d2d9e7f5d1e0324b1ed3aL6-R6)
[[5]](diffhunk://#diff-aa230a2b1198e6ef8afeb7f48335eb2e2f51d87d918d63c4d891fea612d18ff0L6-R6)
[[6]](diffhunk://#diff-86c2390edbede20803cd862908fe95e7207f7dbabd5089ddd4838e1f26e7fecaL6-R6)
[[7]](diffhunk://#diff-5e1af33d38ced461fc0e13981d7051e125876d1692efc3aa9cb4b7faa4c18addL7-R7)
[[8]](diffhunk://#diff-8c6247829130f219981483ccf25af699a63de99afedeb0dd5c1b7bd8ff0919bdL9-R9)
[[9]](diffhunk://#diff-accbd2d37d45e51db3fcb0468043b1e1fd53eeac9e3d3558467ef24444188d2fL7-R7)
[[10]](diffhunk://#diff-15fac9b8e76d2782594c91da72f6a6f42fc18e359c3be35bf6564ac3ca09f700L6-R7)
[[11]](diffhunk://#diff-8e1a76afd564b6073aac7b02ca59f296ae45a24da3dc4d5c40f18169f48ceba1L6-R6)
[[12]](diffhunk://#diff-00a9db26966c21305c72e8f659628dffaff0d6e9dc98a751406d2141d51a5d90L7-R7)
[[13]](diffhunk://#diff-2cbf2f66d5cb77d9f4d00e4c0ce45055620fff50c941a588da31729f09a81f1bL6-R7)
[[14]](diffhunk://#diff-20a21d07addeea398c4adb76d077875894a73b4b5b181b9df1fafe497d3fc843L6-R6)
[[15]](diffhunk://#diff-909670f1c29b0bba24faf1420504b9eacdff124c4cbbec1ddec5de60653ad007L6-R6)
[[16]](diffhunk://#diff-8eef5f0c081743f8002e0faba686e838b323cb53b749706ea42e0440aaa793f1L7-R7)
[[17]](diffhunk://#diff-82345842a29e8eaffa4f51aab96fa2aa78597e6639fe4b0ece797bc60edacea8L6-R6)

**Script improvements:**

* Refactored `.make_version.sh` to use a new `sed_inplace` function for
in-place file editing, improving cross-platform support (Linux/macOS)
and removing reliance on a global variable for the sed command.
* Updated `.make_version.sh` to use `sed_inplace` consistently for
version replacement and dependency cleanup steps, ensuring robust file
modification regardless of OS.
[[1]](diffhunk://#diff-546db9206ba1b7973e6187a1025b3904a0b08681d40d0ee4767082040fd0f661L46-R47)
[[2]](diffhunk://#diff-546db9206ba1b7973e6187a1025b3904a0b08681d40d0ee4767082040fd0f661L84-R97)
* Added a step in `.make_version.sh` to insert local development replace
directives for Go modules, streamlining local testing and development.

**Documentation updates:**

* Updated contributor badge version in `README.MD` and `README.zh_CN.MD`
to reflect the new GoFrame version (`v2.10.0`).
[[1]](diffhunk://#diff-01e6d9ffed056a02cae8d8a0ec5d476a64d017bf85c0d5a94bb23ca21f33f5aaL48-R48)
[[2]](diffhunk://#diff-c93759cb9a9500f20e551c741eb167fc72825fd638d36121357feb8253ce6ac1L48-R48)
2026-01-26 20:37:48 +08:00
73211707fb refactor(container): add default nil checker, rename RegisterNilChecker to SetNilChecker, migrate instance containers to type-safe generics (#4630)
## 变更说明

本 PR 主要对代码库进行了重构,以提升类型安全性和优化连接管理实现。

### 详细变更

#### 1. 数据库连接管理优化
- 修改 `RegisterNilChecker`方法返回实例以支持链式调用,涉及
`KVMap`、`ListKVMap`、`TSet`、`AVLKVTree`、`BKVTree`、`RedBlackKVTree`
等多个容器类型
- 更新 `Core`结构体中 `links`字段类型为类型安全的 `KVMap[ConfigNode, *sql.DB]`
- 添加专门的链接检查器函数用于连接池管理
- 使用泛型 `KVMap`替代原始 map 类型提升类型安全性
- 简化连接关闭逻辑并移除不必要的类型断言
- 优化统计功能中的迭代器实现提高性能

#### 2. 数据库驱动类型安全增强
- 将 dm、gaussdb、mssql、oracle 驱动中的 `conflictKeySet` 从 `gset.New`修改为
`gset.NewStrSet`
- 统一使用字符串集合类型以提高类型安全性

#### 3. 配置文件适配器类型安全改进
- 将 `jsonMap`从 `StrAnyMap` 类型更改为泛型 `KVMap[string, *gjson.Json]` 类型
- 添加 `jsonMapChecker` 函数用于 JSON 对象验证
- 使用 `NewKVMapWithChecker` 替代 `NewStrAnyMap` 提高类型安全性
- 简化数据库链接关闭日志中的键值转换逻辑

## 影响范围

- 数据库连接管理模块
- 多个数据库驱动实现
- 配置文件管理系统

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: John Guo <john@johng.cn>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-23 16:37:38 +08:00
609f44c5fe fix(cmd/gf): fix genservice losing versioned import paths (#4242) (#4638)
## Summary
- Fix `gf gen service` incorrectly handling versioned imports (e.g.,
`github.com/minio/minio-go/v7` → `github.com/minio/minio-go`)
- The root cause was faulty package name inference from import paths -
Go allows package names to differ from directory names
- Solution: Keep all non-anonymous imports and let gofmt clean up unused
ones

## Changes
- Simplified `calculateImportedItems` function in
`genservice_calculate.go`
- Added test case for versioned imports and aliased imports

## Test plan
- [x] All existing genservice tests pass (`Test_Gen_Service_Default`,
`Test_Issue3328`, `Test_Issue3835`)
- [x] New test `Test_Issue4242` verifies both versioned imports and
aliased imports are preserved
- [x] Verified generated files match expected output exactly

Closes #4242

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-22 20:45:19 +08:00
0a82036da5 feat(contrib/registry): update nacos sdk to 2.3.5 (#4628)
- Update nacos go sdk to 2.3.5;
- ctx params not use, skip it;
- adjust docs style

---------

Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>
Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-22 19:09:06 +08:00
b4053ed32e feat(os/gcfg): add Loader with automatic struct binding and config watching (like Spring Boot @ConfigurationProperties) (#4575)
# Loader 配置加载器

Loader 是一个通用的配置管理器,提供了类似于 Spring Boot
的`@ConfigurationProperties`的配置加载、监控、更新和管理功能。

## 功能特性

- **泛型支持**:使用 Go 泛型,类型安全的配置绑定
- **配置加载**:从配置源加载数据并绑定到结构体
- **配置监控**:自动监控配置变化并更新
- **自定义转换器**:支持自定义数据转换函数
- **回调处理**:配置变更时的回调函数
- **错误处理**:灵活的错误处理机制

## 安装

```bash
go get github.com/gogf/gf/v2
```

## 使用示例

### 1. 基本用法

#### 用法一

```go
package main

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gcfg"
	"github.com/gogf/gf/v2/os/gctx"
)

type AppConfig struct {
	Name     string       `json:"name"`
	Age      int          `json:"age"`
	Enabled  bool         `json:"enabled"`
	Features []string     `json:"features"`
	Server   ServerConfig `json:"server"`
}

type ServerConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

func main() {
	ctx := gctx.New()
	// 创建配置器实例
	loader := gcfg.NewLoader[AppConfig](g.Cfg("test"), "")

	// 加载和监听配置
	loader.MustLoadAndWatch(ctx, "test-watcher")

	// 获取配置
	config := loader.Get()
	fmt.Println(config.Name)
}
```

#### 用法二

```go
package main

import (
	"fmt"
	"github.com/gogf/gf/v2/os/gcfg"
	"github.com/gogf/gf/v2/os/gctx"
)

type AppConfig struct {
	Name     string       `json:"name"`
	Age      int          `json:"age"`
	Enabled  bool         `json:"enabled"`
	Features []string     `json:"features"`
	Server   ServerConfig `json:"server"`
}

type ServerConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

func main() {
	ctx := gctx.New()

	// 使用单独的适配器创建
	// 创建配置管理器
	cfg, _ := gcfg.NewAdapterFile("test.yaml")
	// 创建配置器实例
	loader := gcfg.NewLoaderWithAdapter[AppConfig](cfg, "")

	// 加载和监听配置
	loader.MustLoadAndWatch(ctx, "test-watcher")

	// 获取配置
	config := loader.Get()
	fmt.Println(config.Name)
}
```

### 2. 配置监控

```go


// 仅加载App配置
loader := gcfg.NewLoaderWithAdapter[AppConfig](cfg, "app")

// 设置配置变更回调
loader.OnChange(func (updated AppConfig) error {
// 配置变更时的处理逻辑
println("配置已更新:", updated.Name)
return nil
})

// 加载数据
err := loader.Load(ctx)
if err != nil {
panic(err)
}

// 开始监控配置变化
err := loader.Watch(context.Background(), "my-watcher")
if err != nil {
panic(err)
}

```

### 3. 自定义转换器

```go
// 设置自定义转换器
loader.SetConverter(func (data any, target *AppConfig) error {
// 自定义数据转换逻辑
return nil
})
```

### 4. 便捷方法

```go
// 一步完成加载和监控
loader.MustLoadAndWatch(context.Background(), "my-app")
```

## API 参考

### `NewLoader`

创建一个新的 Loader 实例。

```go
func NewLoader[T any](config *Config, propertyKey string, targetStruct ...*T) *Loader[T]
```

参数:

- `config`: 配置实例,用于监控变化
- `propertyKey`: 监控的属性键模式(使用 "" 或 "." 监控所有配置)
- `targetStruct`: 接收配置值的结构体指针(可选)

### `NewLoaderWithAdapter`

使用适配器创建一个新的 Loader 实例。

```go
func NewLoaderWithAdapter[T any](adapter Adapter, propertyKey string, targetStruct ...*T) *Loader[T]
```

### `Load`

从配置实例加载数据并绑定到目标结构体。

```go
func (l *Loader[T]) Load(ctx context.Context) error
```

### `MustLoad`

与 Load 类似,但出错时会 panic。

```go
func (l *Loader[T]) MustLoad(ctx context.Context)
```

### `Watch`

开始监控配置变化并自动更新目标结构体。

```go
func (l *Loader[T]) Watch(ctx context.Context, name string) error
```

### `MustWatch`

与 Watch 类似,但出错时会 panic。

```go
func (l *Loader[T]) MustWatch(ctx context.Context, name string)
```

### `MustLoadAndWatch`

便捷方法,调用 MustLoad 和 MustWatch。

```go
func (l *Loader[T]) MustLoadAndWatch(ctx context.Context, name string)
```

### `Get`

返回当前配置结构体。

```go
func (l *Loader[T]) Get() T
```

### `GetPointer() *T`

返回指向当前配置结构体的指针。

```go
func (l *Loader[T]) GetPointer() *T
```

### `OnChange`

设置配置变化时调用的回调函数。

```go
func (l *Loader[T]) OnChange(fn func (updated T) error)
```

### `SetConverter`

设置在 Load 操作期间使用的自定义转换函数。

```go
func (l *Loader[T]) SetConverter(converter func (data any, target *T) error)
```

### `SetWatchErrorHandler`

设置在 Watch 过程中 Load 操作失败时调用的错误处理函数。

```go
func (l *Loader[T]) SetWatchErrorHandler(errorFunc func(ctx context.Context, err error))
```

### `SetReuseTargetStruct`

设置是否在更新时重用相同的目标结构体或创建新结构体。

```go
func (l *Loader[T]) SetReuseTargetStruct(reuse bool)
```

### `StopWatch`

停止监控配置变化并移除关联的监控器。

```go
func (l *Loader[T]) StopWatch(ctx context.Context) (bool, error)
```

### `IsWatching`

返回 Loader 是否正在监控配置变化。

```go
func (l *Loader[T]) IsWatching() bool
```

## 高级用法

### 监控特定配置键

```go
// 只监控特定配置键
loader := gcfg.NewLoaderWithAdapter[ServerConfig](cfg, "server")
```

### 使用默认值

```go
// 创建带默认值的目标结构体
var targetConfig AppConfig
targetConfig.Name = "default-app" // 设置默认值

loader := gcfg.NewLoaderWithAdapter(cfg, "", &targetConfig)
```

## 错误处理

Loader 提供了灵活的错误处理机制:

```go
loader.SetWatchErrorHandler(func(ctx context.Context, err error) {
    // 处理加载错误
    log.Printf("配置加载失败: %v", err)
})
```

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
2026-01-22 19:04:52 +08:00
110e3fbf16 feat(cmd/gendao): add wildcard pattern support for tables configuration (#4632)
## Summary
- Add wildcard pattern support (`*` and `?`) for `tables` configuration
- Fix `tablesEx` wildcard to use exact match (`^$`) for consistency
- Add warning when exact table name does not exist
- Add unit tests and integration tests for MySQL and PostgreSQL

## Changes
| Configuration | Before | After |
|---------------|--------|-------|
| `tables: "user_*"` | Not supported | Matches tables starting with
"user_" |
| `tables: "*"` | Not supported | Matches all tables |
| `tablesEx: "user_*"` | Partial match | Exact match (consistent with
tables) |

## Features
- `*` matches any characters (e.g., `user_*` matches `user_info`,
`user_log`)
- `?` matches single character (e.g., `user_???` matches `user_log` but
not `user_info`)
- Mixed patterns and exact names supported (e.g., `tables:
"user_*,config"`)
- Non-existent exact table names are skipped with warning message

## Test plan
- [x] Unit tests for `containsWildcard`, `patternToRegex`,
`filterTablesByPatterns` (11 cases)
- [x] Integration tests for MySQL (5 cases)
- [x] Integration tests for PostgreSQL (1 case with tables + tablesEx)
- [x] Standard SQL syntax for cross-database compatibility

Closes #4629

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-21 19:16:12 +08:00
095c69c424 fix(cmd/gf): fix gf env and gf build --dumpEnv command error (#4635)
## Summary
- Fix `gf env` and `gf build --dumpEnv` command failing when `go env`
outputs warning messages
- When `go env` outputs warnings (e.g., invalid characters in
environment variables), it returns non-zero exit code but still provides
valid output
- The original code would fail in this case

## Changes
- Only fail when `go env` returns empty output, allow non-zero exit code
with valid output
- Skip lines that don't match `key=value` format instead of failing with
Fatal error
- Add debug log for skipped lines to help troubleshooting
- Add unit tests for env command

## Related Issue
Fixes #4469

## Test plan
- [x] `gf env` command works correctly even when `go env` outputs
warnings
- [x] `gf build --dumpEnv` works correctly
- [x] Added unit tests pass
2026-01-21 19:15:57 +08:00
cee6f499fc fix(cmd/gf): fix gf gen enums output path error when using relative path (#4636)
## Summary
- Fix `gf gen enums` output file created at wrong location when using
relative path
- Output was incorrectly relative to source directory instead of current
working directory
- Add `defer gfile.Chdir(originPwd)` to restore original working
directory

## Root Cause
The code calls `gfile.Chdir(realPath)` to change to source directory
before `gfile.PutContents(in.Path, ...)`, causing relative output path
to be resolved relative to source directory.

## Solution
- Convert output path to absolute using `gfile.Abs()` before `Chdir`
- Restore original working directory with `defer` (following `genpb.go`
pattern)

## Test Cases
- `Test_Gen_Enums_Issue4387_RelativePath` - standard project with
relative path
- `Test_Gen_Enums_AbsolutePath` - absolute path (should work as before)
- `Test_Gen_Enums_Issue4387_Monorepo` - monorepo mode (`cd app/xxx && gf
gen enums`)

Closes #4387
2026-01-21 19:15:42 +08:00
73560cfe31 fix(cmd/gendao): fix overlapping shardingPattern matching issue (#4631)
## Summary
- Fix overlapping shardingPattern matching issue where shorter patterns
incorrectly match tables meant for longer patterns
- Sort shardingPattern by length descending so longer (more specific)
patterns are matched first
- Add break after successful pattern match to prevent tables from
matching multiple patterns

## Problem
When `shardingPattern` contains overlapping prefixes like `["a_?",
"a_b_?", "a_c_?"]`:
- Tables `a_b_1`, `a_b_2` should match `a_b_?` and generate `a_b.go`
- Tables `a_c_1`, `a_c_2` should match `a_c_?` and generate `a_c.go`
- Tables `a_1`, `a_2` should match `a_?` and generate `a.go`

But without this fix, `a_?` (converted to regex `a_(.+)`) would match
`a_b_1` first, causing `a_b_?` and `a_c_?` patterns to fail to generate
their respective dao files.

## Solution
1. Sort `shardingPattern` by length descending before matching
2. Add `break` after a table matches a pattern to prevent multiple
matches

## Test plan
- [x] Added integration test `Test_Gen_Dao_Sharding_Overlapping` with
overlapping patterns
- [x] Added SQL test data file `sharding_overlapping.sql`
- [x] Verified 3 separate dao files are generated: `a.go`, `a_b.go`,
`a_c.go`

Fixes #4603
2026-01-21 19:15:06 +08:00
9a7df9944c revert(os/gcfg): restore config file priority over env/cmd in GetWithEnv and GetWithCmd (#4647)
## Summary
- Reverts the behavior change introduced in PR #4587 (commit caea7ea4b)
- Restores v2.9.7 priority behavior:
  - `GetWithEnv`: config file > environment variable > default value
  - `GetWithCmd`: config file > command line option > default value

## Related Issue
Closes #4074

## Changes
- `os/gcfg/gcfg.go`: Restore original logic that checks config file
first, then falls back to env/cmd
- `os/gcfg/gcfg_z_example_test.go`: Restore original example test
expectations
2026-01-21 19:14:03 +08:00
dd02af1b2f test(cmd/gf): enhance integration tests for gen service command (#4645)
## Summary
- Add 2 new integration test cases for `gf gen service` command
- `Test_Gen_Service_CamelCase`: tests `DstFileNameCase: "Camel"` option
to generate service files with CamelCase naming
- `Test_Gen_Service_PackagesFilter`: tests `Packages` filter option to
generate service files only for specified packages

## Test Plan
- [x] Run `go test -v -run "Test_Gen_Service" ./...` - all 5 tests pass
(3 existing + 2 new)
2026-01-21 19:12:37 +08:00
626fc629ef test(cmd/gf): enhance integration tests for gen pb command (#4644)
## Summary
- Add 2 new integration test cases for `gf gen pb` command
- `TestGenPb_MultipleTags`: tests multiple validation tags (v:required,
v:#Id > 0, v:email) and dc tags
- `TestGenPb_NestedMessage`: tests nested message structures with
various tag types

## Test Data
- Add `testdata/genpb/multiple_tags.proto` - proto file with multiple
tag annotations
- Add `testdata/genpb/nested_message.proto` - proto file with nested
message structures

## Test Plan
- [x] Run `go test -v -run "TestGenPb" ./...` - all 4 tests pass (2
existing + 2 new)
2026-01-21 19:11:45 +08:00
2d05fb426f test(cmd/gf): enhance unit tests for fix command (#4643)
## Summary
- Enhance unit tests for the `fix` command's `doFixV25Content` function
- 5 new test cases added (total: 6)

## New Test Cases

| Test | Description |
|------|-------------|
| Test_Fix_doFixV25Content_WithReplacement | Verify actual replacement
is made |
| Test_Fix_doFixV25Content_NoMatch | Handle content without patterns |
| Test_Fix_doFixV25Content_MultipleMatches | Handle multiple occurrences
|
| Test_Fix_doFixV25Content_EmptyContent | Handle empty content |
| Test_Fix_doFixV25Content_ComplexPath | Handle complex URL paths |

## Test plan
- [x] All 6 tests pass locally
- [x] Only added new test cases to existing test file
- [x] No modifications to non-test code
2026-01-21 19:10:56 +08:00
bf2997e9cc test(cmd/gf): add unit tests for pack command (#4642)
## Summary
- Add comprehensive unit tests for the `pack` command which handles
resource file packing
- 8 new test cases covering core functionality

## Test Coverage

| Test | Description |
|------|-------------|
| Test_Pack_ToGoFile | Pack files to .go file |
| Test_Pack_ToBinaryFile | Pack files to binary file |
| Test_Pack_MultipleSources | Pack multiple source directories |
| Test_Pack_WithPrefix | Pack with prefix option |
| Test_Pack_WithKeepPath | Pack with keepPath option |
| Test_Pack_AutoPackageName | Auto-detect package name from directory |
| Test_Pack_EmptySource | Handle empty source directory |
| Test_Pack_NestedDirectories | Handle deeply nested directory structure
|

## Test plan
- [x] All 8 tests pass locally
- [x] No modifications to existing code
- [x] New test file only: `cmd_z_unit_pack_test.go`
2026-01-21 19:10:20 +08:00
82d4d77e56 test(cmd/gf): add unit tests for genenums package (#4641)
## Summary
- Add comprehensive unit tests for the `genenums` package which handles
enum parsing and JSON export
- 13 new test cases covering core functionality

## Test Coverage

| Function | Tests | Description |
|----------|-------|-------------|
| `NewEnumsParser` | 2 | Parser initialization |
| `Export` | 7 | JSON export with various types |
| `ParsePackages` | 2 | Integration with Go packages |
| `EnumItem` | 1 | Data structure |
| `getStandardPackages` | 1 | Standard library detection |

## Test plan
- [x] All 13 tests pass locally
- [x] No modifications to existing code
- [x] New test file only: `genenums_z_unit_test.go`
2026-01-21 19:09:38 +08:00
4f43b40a18 test(cmd/gf): add unit tests for geninit package (#4640)
## Summary
- Add comprehensive unit tests for the `geninit` package which handles
project initialization from templates
- 17 new test cases covering core functionality

## Test Coverage

| Function | Tests | Description |
|----------|-------|-------------|
| `ParseGitURL` | 7 | Git URL parsing with various formats |
| `IsSubdirRepo` | 3 | Subdirectory detection |
| `GetModuleNameFromGoMod` | 3 | Module name extraction |
| `ASTReplacer` | 2 | Import path replacement |
| `findGoFiles` | 2 | Go file discovery |

## Test plan
- [x] All 17 tests pass locally
- [x] No modifications to existing code
- [x] New test file only: `geninit_z_unit_test.go`
2026-01-21 19:07:52 +08:00
f3f2cb3c57 refactor(encoding/gjson): enhance auto type checks when loading data without type specified (#4637)
This pull request improves YAML support for i18n translation files and
refactors content type detection and loading logic in the `gjson`
package. The main changes include more robust detection of YAML, TOML,
INI, and Properties formats, refactoring of content type handling, and
the addition of new tests to ensure correct parsing of YAML-based i18n
resources.

### Improved content type detection and loading

* Refactored content type detection logic in `gjson` to use dedicated
functions for XML, YAML, TOML, INI, and Properties formats, making the
detection more reliable and maintainable.
* Changed the content loading mechanism in `gjson` to use specific
decode functions (`gxml.Decode`, `gyaml.Decode`, etc.) for each format
instead of converting everything to JSON first, improving accuracy and
extensibility.
* Updated type definitions and struct field comments in `gjson.go` for
clarity and consistency, including changing `ContentType` to a type
alias and improving documentation.
[[1]](diffhunk://#diff-0e4432d7e4cf171c0339e01b1842530432b986948d7f839a155543623236a03fL24-R24)
[[2]](diffhunk://#diff-0e4432d7e4cf171c0339e01b1842530432b986948d7f839a155543623236a03fL38-R71)

### i18n YAML support

* Modified i18n manager to use the new `gjson.LoadPath` method for
loading translation files, ensuring correct parsing of YAML files for
i18n.
* Added new test cases and test data for loading and verifying YAML i18n
files, including edge cases and real-world translation strings.
[[1]](diffhunk://#diff-e6eacc5abab33c149f9b39d8ebe300cf4d0abe907434605991984a5969e8707dR262-R283)
[[2]](diffhunk://#diff-1bfd438797c1f9ef18ab3cb00d23ae95202e85e2362c39c3df4f1a29c55733feR421-R430)
[[3]](diffhunk://#diff-a3ee37ff2a67c9e1ba2e1617e0f5fd63eb261ad7760a07423f703538138c2decR1-R16)

### Minor improvements

* Simplified file loading logic in `gjson.LoadPath` by removing caching
and directly reading file bytes, which streamlines the code and avoids
potential cache issues.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-20 19:25:23 +08:00
102c3b6cb0 fix(util/gconv): fix incompatable converting to nil pointer target from older version implement (#4224)
fixed: https://github.com/gogf/gf/issues/4218
2026-01-20 10:57:32 +08:00
5e677a1e05 fix(net/gclient): fix form field value truncation when uploading files (#4627)
## What does this PR do?

Fixes #4156

When posting form data with file upload, if a field value contains `=`
or `&`, the value was being truncated.

### Example

```go
data := g.Map{
    "file":      "@file:/path/to/file.txt",
    "fieldName": "aaa=1&b=2",
}
client.Post(ctx, "/upload", data)
```

**Expected**: Server receives `fieldName = "aaa=1&b=2"`
**Actual (before fix)**: Server receives `fieldName = "aaa"` (truncated)

## Root Cause Analysis

The issue was caused by three problems in the original code:

### Problem 1: Global URL encoding disable (httputils.go)

```go
// Original code - PROBLEMATIC
if urlEncode {
    for k, v := range m {
        if gstr.Contains(k, fileUploadingKey) || gstr.Contains(gconv.String(v), fileUploadingKey) {
            urlEncode = false  // Disables URL encoding for ALL values!
            break
        }
    }
}
```

When any value contained `@file:`, URL encoding was disabled for ALL
values, causing `"aaa=1&b=2"` to remain unencoded. The `&` character was
then treated as a parameter separator.

### Problem 2: Split on all `=` characters (gclient_request.go)

```go
// Original code - PROBLEMATIC
array := strings.Split(item, "=")  // Splits on ALL '=' characters
```

This caused `"fieldName=aaa=1"` to be split into `["fieldName", "aaa",
"1"]`.

### Problem 3: No URL decoding for field values

URL-encoded values were written directly to the multipart form without
decoding.

## Solution

### Fix 1: Remove global URL encoding disable

Only `@file:` prefixed values are kept unencoded for file upload
detection. Other values are properly URL-encoded.

### Fix 2: Use SplitN to limit split count

```go
array := strings.SplitN(item, "=", 2)  // Only split on first '='
```

### Fix 3: Add URL decoding for field values

```go
if v, err := gurl.Decode(fieldValue); err == nil {
    fieldValue = v
}
```

## Compatibility Analysis

| Scenario | Before | After | Compatible |
|----------|--------|-------|------------|
| Normal form POST (no file upload) |  Works |  Works |  Yes |
| File upload + normal field values |  Works |  Works |  Yes |
| File upload + field values containing `=` or `&` |  Truncated | 
Works |  Fixed |
| Field value is `@file:` (no path) |  Works |  Works |  Yes |
| Field value starts with `@file:` but file doesn't exist |  Error | 
Error |  Yes |
| User sends pre-encoded value like `"aaa%3D1"` |  Works |  Works | 
Yes |
| Content-Type: application/json |  Works |  Works |  Yes |
| Content-Type: application/xml |  Works |  Works |  Yes |

### Breaking Change Assessment

**No breaking changes.** The fix only affects the file upload scenario
where field values contain special characters (`=`, `&`). Previously
this scenario was broken, now it works correctly.

### Edge Cases

1. **Literal `@file:` value**: GoFrame treats `@file:` as a special
marker for file upload. This is a framework design decision and remains
unchanged.

2. **URL decode failure**: If URL decoding fails (e.g., invalid `%XX`
sequence), the original value is preserved.

## Test Coverage

Added comprehensive tests covering:

- `Test_Issue4156` - Basic fix verification
- `Test_Issue4156_MultipleSpecialChars` - Multiple `=`, `&`, `%`, `+`,
spaces
- `Test_Issue4156_MultipleFields` - Multiple fields with special
characters
- `Test_Issue4156_NoFileUpload` - Normal POST without file upload
- `Test_Issue4156_PreEncodedValue` - Pre-encoded values like `%3D`
- `Test_Issue4156_EmptyAndSpecialValues` - Edge cases (`=` at start/end,
only special chars)
- `TestBuildParams_*` - httputil.BuildParams comprehensive tests

All tests pass, including existing `Test_Issue3748` which tests the
`@file:` marker handling.

## Files Changed

- `internal/httputil/httputils.go` - Remove global URL encoding disable,
adjust `@file:` condition
- `internal/httputil/httputils_test.go` - Add comprehensive BuildParams
tests
- `net/gclient/gclient_request.go` - Use SplitN, add URL decoding
- `net/gclient/gclient_z_unit_issue_test.go` - Add Issue 4156 test cases
2026-01-19 13:05:44 +08:00
75f89f19ba feat(database/gdb): add MaxIdleConnTime configuration for SetConnMaxIdleTime support (#4625)
## Summary
- Add `MaxIdleConnTime` configuration field to support Go 1.15+
`sql.DB.SetConnMaxIdleTime()` method
- Add `SetMaxIdleConnTime()` method to DB interface and Core
implementation
- Apply configuration during connection pool initialization
- Add unit tests for the new configuration option

## Related Issue
Closes #4596

## Changes
| File | Change |
|------|--------|
| `database/gdb/gdb_core_config.go` | Add `MaxIdleConnTime` field to
`ConfigNode`, add `SetMaxIdleConnTime()` method |
| `database/gdb/gdb.go` | Add interface method, `dynamicConfig` field,
initialization logic |
| `database/gdb/gdb_z_core_config_test.go` | Add unit test for
`SetMaxIdleConnTime` |
| `database/gdb/gdb_z_core_config_external_test.go` | Add `ConfigNode`
connection pool settings test |

## Usage
**Configuration file:**
```yaml
database:
  default:
    maxIdleTime: "10s"  # Close idle connections after 10 seconds
```

**Code:**
```go
db.SetMaxIdleConnTime(10 * time.Second)
```

## Test Plan
- [x] Unit tests pass (`go test -run
"Test_Core_SetMaxConnections|Test_ConfigNode_ConnectionPoolSettings"`)
- [x] All database drivers compile successfully (mysql, pgsql, sqlite,
clickhouse, dm, mssql, oracle, etc.)
- [x] No breaking changes - follows Go's default behavior (0 = no idle
time limit)
2026-01-19 13:04:03 +08:00
afe6bebde7 fix(util/gutil): fix false positive cycle detection in Dump (#2902) (#4626)
## Summary
- Fix false positive cycle detection in `gutil.Dump`
- Change from global pointer tracking to path-based cycle detection
- Shared references (multiple fields pointing to same object) no longer
incorrectly marked as cycles

## Problem
When using `gutil.Dump` with structs containing fields that share the
same `reflect.Type` (e.g., multiple `int` fields), the second field's
type was incorrectly displayed as `<cycle dump 0x...>`.

Example from issue:
```go
type User struct {
    Id   int `params:"id"`
    Name int `params:"name"`
}
fields, _ := gstructs.TagFields(&user, []string{"p", "params"})
gutil.Dump(fields)  // Second field's Type shows "<cycle dump>" instead of "int"
```

## Solution
Change cycle detection from global to path-based:
- Add `defer delete()` to remove pointer from tracking set when function
returns
- Only detect true cycles (A→B→A), not shared references (A,B both point
to C)

## Benchmark Comparison

Run benchmark with:
```bash
cd util/gutil && go test -bench=Benchmark_Dump -benchmem -run=^$
```

**Before fix (master branch):**
| Benchmark | ns/op | B/op | allocs/op |
|-----------|-------|------|-----------|
| Shallow | 4071 | 5989 | 85 |
| Nested20 | 105700 | 173993 | 1952 |
| Deep50 | 422515 | 692298 | 4869 |

**After fix (this PR):**
| Benchmark | ns/op | B/op | allocs/op |
|-----------|-------|------|-----------|
| Shallow | 4049 | 5989 | 85 |
| Nested20 | 103065 | 173990 | 1952 |
| Deep50 | 469502 | 692291 | 4869 |

**Performance impact**: 
- Memory allocation (B/op and allocs/op) is **identical**
- Execution time is within normal variance (±5-10%)
- The `defer delete()` operation is O(1), negligible compared to
reflection overhead

## Test plan
- [x] All existing `gutil` tests pass (68 tests)
- [x] Added `Test_Dump_Issue2902_SharedPointer` - shared pointer not
marked as cycle
- [x] Added `Test_Dump_Issue2902_SameTypeFields` - original issue
scenario
- [x] Added benchmark tests for performance tracking
- [x] Verified real cycles still detected correctly

Fixes #2902
2026-01-19 10:56:25 +08:00
2af2342d67 fix: update gf cli to v2.9.8 (#4619)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2026-01-16 16:21:44 +08:00
c9641ea115 fix: v2.9.8 (#4616)
Co-authored-by: houseme <housemecn@gmail.com>
2026-01-16 16:05:07 +08:00
d8a173d9f0 feat(instance): migrate instance containers to type-safe generics (#4617)
### 变更说明

本次重构将项目中用于**实例管理的容器**从 `StrAnyMap`/`IntAnyMap` 迁移到类型安全的泛型实现
`KVMapWithChecker`,同时将相关的 `glist.List` 和 `gqueue.Queue`
替换为对应的泛型版本,以提高实例管理的类型安全性。并且减少原先代码中的大量类型断言,提高性能。

### 前因

目前`goframe`中大量使用了包含`any`的容器,然后通过断言去转换类型,麻烦且影响性能,尤其是对`gdb/gredis/glog`等需要高频获取`instance`实例的组件影响较大。最近几个版本中gf完成了数据结构容器的泛型化改造,以及我最近解决了其中几个泛型容器对于`typed
nil`过滤的问题,所以可以逐步迁移这些实例容器到泛型容器,减少断言优化性能

### 主要改进

#### 1. 实例容器泛型化

以下模块的实例管理容器已迁移到泛型实现:

**核心实例管理**:
- `database/gdb`: 数据库实例容器 → `KVMap[string, DB]`
- `database/gredis`: Redis 实例容器 → `KVMap[string, *Redis]`
- `database/gredis`: Redis 配置容器 → `KVMap[string, *Config]`
- `os/gcfg`: 配置实例容器 → `KVMap[string, *Config]`
- `os/glog`: 日志实例容器 → `KVMap[string, *Logger]`
- `os/gview`: 视图实例容器 → `KVMap[string, *View]`
- `i18n/gi18n`: 国际化实例容器 → `KVMap[string, *Manager]`

**网络服务实例**:
- `net/ghttp`: HTTP 服务器容器 → `KVMap[string, *Server]`
- `net/gtcp`: TCP 服务器容器 → `KVMap[any, *Server]`
- `net/gudp`: UDP 服务器容器 → `KVMap[string, *Server]`

**其他实例容器**:
- `os/gres`: 资源实例容器 → `KVMap[string, *Resource]`
- `os/gfpool`: 文件池容器 → `KVMap[string, *Pool]`
- `os/gspath`: 路径搜索容器 → `KVMap[string, *SPath]`
- `net/gtcp`: 连接池容器 → `KVMap[string, *gpool.Pool]`

#### 2. 相关数据结构泛型化

- `os/gfsnotify`: 回调列表 → `TList[*Callback]`,事件队列 → `TQueue[*Event]`
- `os/grpool`: 任务队列 → `TList[*localPoolItem]`
- `os/gcache`: 事件队列 → `TList[*adapterMemoryEvent]`
- `net/ghttp`: 解析项列表 → `TList[*HandlerItemParsed]`
- `os/gproc`: 消息队列 → `TQueue[*MsgRequest]`
- `os/gmlock`: 锁映射 → `KVMap[string, *sync.RWMutex]`

### 技术实现

1. **引入检查器函数**: 为每个实例容器添加 `checker` 函数用于空值检测
2. **消除类型断言**: 实例获取时无需 `v.(*Type)` 转换
3. **明确函数签名**: `GetOrSetFuncLock` 的回调从 `func() any` 改为 `func() T`

### 使用示例

#### 实例容器的变更

**变更前**:
```go
// 旧的实例管理方式
var instances = gmap.NewStrAnyMap(true)

func Instance(name string) *Logger {
    v := instances.GetOrSetFuncLock(name, func() any {
        return New()
    })
    return v.(*Logger)  // 需要类型断言
}
```


**变更后**:
```go
// 新的泛型实例容器
var (
    checker   = func(v *Logger) bool { return v == nil }
    instances = gmap.NewKVMapWithChecker[string, *Logger](checker, true)
)

func Instance(name string) *Logger {
    return instances.GetOrSetFuncLock(name, New)  // 直接返回,无需断言
}
```


#### 队列容器的变更

**变更前**:
```go
// 旧的队列方式
events := gqueue.New()
events.Push(&Event{Path: "/tmp/file"})

if v := events.Pop(); v != nil {
    event := v.(*Event)  // 需要类型断言
    handleEvent(event)
}
```


**变更后**:
```go
// 新的泛型队列
events := gqueue.NewTQueue[*Event]()
events.Push(&Event{Path: "/tmp/file"})

if event := events.Pop(); event != nil {
    handleEvent(event)  // event 已是 *Event 类型
}
```


### 收益

-  **编译时类型安全**: 实例容器的类型错误在编译期捕获
-  **消除运行时断言**: 避免类型断言带来的 panic 风险
-  **提升代码可读性**: 实例管理逻辑更清晰
-  **改善开发体验**: IDE 类型提示和代码补全更准确

### 性能权衡

**编译时**:
- 泛型实例化会增加编译时间和二进制体积
- 预估编译时间增加 5-15%,二进制体积增加约 1-2MB

**运行时**:
- 减少类型断言的反射开销
- 提升实例获取等热点路径的性能
2026-01-16 15:23:13 +08:00
5d1712b4ab fix(database/gdb): Raw SQL Count ignores Where condition (#4611)
## Summary
- Fixed a bug where `Raw()` with `Where()` and
`Count()`/`ScanAndCount()` was ignoring the Where conditions in Count
queries
- The issue was in `getFormattedSqlAndArgs()` which returned `nil` for
`conditionArgs` without calling `formatCondition()` for Raw SQL in
`SelectTypeCount` case

## Changes
- Modified `database/gdb/gdb_model_select.go` to call
`formatCondition()` for Raw SQL Count queries
- Added comprehensive test cases for MySQL and PostgreSQL drivers
- Fixed incorrect test expectation in `Test_Model_Raw`

## Test plan
- [x] Added `Test_Issue4500` with 6 edge cases covering:
  - Raw SQL with WHERE + external Where condition
  - Raw SQL without WHERE + external Where condition  
  - Raw + Where + ScanAndCount
  - Raw + multiple Where conditions
  - Raw SQL with no external Where (baseline)
  - Verify All() still works correctly
- [x] All tests pass on PostgreSQL

Closes #4500
2026-01-16 13:05:33 +08:00
a4f98c2490 fix(‎database/gdb):Fix panic handling in DoCommit to prevent blocking on database driver panics (#4423)
When underlying database drivers panic during SQL operations, the
`DoCommit` function would propagate the panic unhandled, causing Insert
operations to block indefinitely instead of returning proper errors.
This was particularly problematic with ClickHouse when using `*big.Int`
values that exceed column type limits (e.g., int128).

## Problem

The issue manifested in the following scenario:
1. User inserts data with `*big.Int` value larger than ClickHouse int128
capacity
2. ClickHouse driver panics with `"math/big: buffer too small to fit
value"`
3. Panic propagates through the call stack: `big.nat.bytes` → ClickHouse
driver → `gdb.(*Core).DoCommit`
4. Insert operation blocks indefinitely, returning neither success nor
error

## Solution

Added comprehensive panic recovery to the `DoCommit` function in
`database/gdb/gdb_core_underlying.go`:

```go
// Panic recovery to handle panics from underlying database drivers
defer func() {
    if exception := recover(); exception != nil {
        if err == nil {
            if v, ok := exception.(error); ok && gerror.HasStack(v) {
                err = v
            } else {
                err = gerror.WrapCodef(gcode.CodeDbOperationError, 
                    gerror.NewCodef(gcode.CodeInternalPanic, "%+v", exception), 
                    FormatSqlWithArgs(in.Sql, in.Args))
            }
        }
    }
}()
```

## Benefits

- **Prevents blocking**: Insert operations now return errors instead of
hanging
- **Proper error context**: Errors include full SQL statement and
arguments for debugging
- **Graceful degradation**: Applications can handle driver panics
appropriately
- **Backward compatibility**: No breaking changes to existing
functionality
- **Universal coverage**: Protects against panics from any database
driver

## Testing

Added comprehensive tests covering:
- String panic values (e.g., "math/big: buffer too small")
- Error panic values with stack traces
- Various SQL operation types (Insert, Query, Prepare, etc.)
- Error message formatting and context preservation

All existing tests continue to pass, ensuring no regressions.

Fixes #4372.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2026-01-16 12:43:52 +08:00
d1cd30c9b4 fix(contrib/drivers/gaussdb): remove github.com/lib/pq dependence (#4615)
Co-authored-by: John Guo <claymore1986@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-16 11:36:01 +08:00
5979261584 fix: the use of the deprecated variable {format} in the file util/gval… (#4258)
Fix the use of the deprecated variable {format} in the file
util/gvalid/testdata/i18n/cn/validation.toml.
2026-01-16 10:42:55 +08:00
df463d75bc fix(database/gdb): Resolve the cache error overwriting caused by the use of fixed cache keys in pagination queries. (#4339)
```golang
func main() {
	adapter := gcache.NewAdapterRedis(g.Redis())
	g.DB().GetCache().SetAdapter(adapter)
	result, count, err := g.Model("TBL_USER").Cache(gdb.CacheOption{
		Duration: 100 * time.Minute,
		Name:     "VIP",
	}).AllAndCount(false)
	g.DumpJson(result)
	fmt.Println(count, err)
}
```
执行这段查询后`g.DumpJson(result)`的结果是`[
    {
        "COUNT(1)": 5
    }

]`,但是正确结果应该是五条用户信息,查看源代码后发现先执行的count查询和后来select查询都是直接使用了`VIP`这个缓存key,在redis中实际缓存key是`SelectCache:VIP`,第二步查询select获得的是count查询的缓存,所以查询结果是错的。
因此为`Model`增加一个`PageCache`方法允许用户分别设置`count query`和`data query`的缓存参数
```golang
// PageCache sets the cache feature for pagination queries. It allows to configure
// separate cache options for count query and data query in pagination.
//
// Note that, the cache feature is disabled if the model is performing select statement
// on a transaction.
func (m *Model) PageCache(countOption CacheOption, dataOption CacheOption) *Model {
	model := m.getModel()
	model.pageCacheOption = []CacheOption{countOption, dataOption}
	model.cacheEnabled = true
	return model
}
```
然后`AllAndCount`在查询时分别给两个查询设置对应的缓存参数`ScanAndCount`同理
```golang

// AllAndCount retrieves all records and the total count of records from the model.
// If useFieldForCount is true, it will use the fields specified in the model for counting;
// otherwise, it will use a constant value of 1 for counting.
// It returns the result as a slice of records, the total count of records, and an error if any.
// The where parameter is an optional list of conditions to use when retrieving records.
//
// Example:
//
//	var model Model
//	var result Result
//	var count int
//	where := []any{"name = ?", "John"}
//	result, count, err := model.AllAndCount(true)
//	if err != nil {
//	    // Handle error.
//	}
//	fmt.Println(result, count)
func (m *Model) AllAndCount(useFieldForCount bool) (result Result, totalCount int, err error) {
	// Clone the model for counting
	countModel := m.Clone()

	// If useFieldForCount is false, set the fields to a constant value of 1 for counting
	if !useFieldForCount {
		countModel.fields = []any{Raw("1")}
	}
	if len(m.pageCacheOption) > 0 {
		countModel = countModel.Cache(m.pageCacheOption[0])
	}

	// Get the total count of records
	totalCount, err = countModel.Count()
	if err != nil {
		return
	}

	// If the total count is 0, there are no records to retrieve, so return early
	if totalCount == 0 {
		return
	}

	resultModel := m.Clone()
	if len(m.pageCacheOption) > 1 {
		resultModel = resultModel.Cache(m.pageCacheOption[1])
	}

	// Retrieve all records
	result, err = resultModel.doGetAll(m.GetCtx(), SelectTypeDefault, false)
	return
}
```

---------

Co-authored-by: houseme <housemecn@gmail.com>
2026-01-16 10:33:05 +08:00
de9d3c2b3c feat(util/gconv): Add OmitEmpty and OmitNil options to Scan function (#4584)
## 改进内容
- 扩展 `ScanOption`/`StructOption` 结构体,添加 `OmitEmpty bool` 字段:当设置为 true
时,跳过空值(如空字符串、零值等)的赋值;添加 `OmitNil bool` 字段:当设置为 true 时,跳过 nil 值的赋值;
- 添加 `ScanWithOptions` 函数,支持通过 `ScanOption` 参数使用新选项
- 原有的 `Scan` 函数行为完全不变
- 通过 `NewConverter` 创建的转换器也支持新功能

## 使用示例

### 基本用法
```go
type User struct {
    Name  *string
    Age   int
    Email string
}

type Person struct {
    Name  string
    Age   int
    Email string
}

user := User{Name: nil, Age: 25, Email: ""}
person := Person{Name: "zhangsan", Age: 0, Email: "old@example.com"}

err := gconv.ScanWithOptions(user, &person, gconv.ScanOption{
    OmitEmpty: true,
    OmitNil: true,
})
// 结果: person.Name 保持 "zhangsan",person.Age 变为 25,person.Email 保持 "old@example.com"
```

后续可以将`func Scan(srcValue any, dstPointer any, paramKeyToAttrMap
...map[string]string) (err error)`和`func ScanWithOptions(srcValue any,
dstPointer any, option ...ScanOption) (err error)`直接用`func Scan(srcValue
any, dstPointer any, option ...ScanOption) (err
error)`代替,`ScanOption`里已经包含了`paramKeyToAttrMap map[string]string`

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-16 10:19:02 +08:00
ce3599a672 fix(util/gconv): fix nested map conversion data loss in MapToMap (#4612)
## Summary
- Fix nested map conversion data loss when using `gconv.Scan()` or
`MapToMap()`
- When converting `map[string]any` to `map[string]map[string]float64`,
the nested data was lost
- Root cause: `MapToMap` incorrectly called `Struct()` for map value
types
- Solution: Separate `reflect.Map` handling from `reflect.Struct`, use
recursive `MapToMap()` for nested maps

## Test plan
- [x] Added test case reproducing original bug (nested map conversion)
- [x] Added test cases for deep nesting (3-5 levels)
- [x] Added test case for different key types
- [x] Added test case for empty nested map
- [x] Verified struct conversion still works (no regression)
- [x] Verified no infinite recursion with timeout tests
- [x] All gconv tests pass

Closes #4542

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-15 21:24:35 +08:00
cd6fd247e2 fix(‎database/gdb): fix iTableName interface detection when using WithAll with .Scan on reflect.Value objects (#4606)
fix(gdb/getTableNameFromOrmTag): 修复在使用WithAll, 并且使用.Scan传入对象的情况下,
无法识别该对象字段是否实现了iTableName的接口. 因为该情况下, 传入的object是reflect.Value.

示例如下: 

type MaterialDetail struct {
*entity.Material
SourceFile MaterialSourceFileDetail json:"source_file"
orm:"with:id=source_file_id"
}

type MaterialSourceFileDetail struct {
*entity.MaterialSourceFile
}

func (MaterialSourceFileDetail) TableName() string {
return dao.MaterialSourceFile.Table()
}

func foo(ctx context.Context) {

err = dao.Material.Ctx(ctx).WithAll().
	Where(dao.Material.Columns().MaterialId, materialId).
	Scan(&material)
}

这种情况下, 传入getTableNameFromOrmTag的object是reflect.Value, 而不是对象本身.
这会导致识别出MaterialSourceFileDetail已经实现了iTableName接口, 无法获取到正确的表名.

---------

Co-authored-by: hailaz <739476267@qq.com>
2026-01-15 21:23:07 +08:00
be91c4889e feat(util/gvalid): add more rules: alpha,alpha-dash,alpha-num,lowercase,numeric,uppercase (#4601)
Add more check rules

---------

Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>
Co-authored-by: hailaz <739476267@qq.com>
2026-01-15 17:51:55 +08:00
6219da7a76 feat(‎contrib/registry/nacos): add SetDefaultEndpoint and SetDefaultMetadata methods (#4608)
Add configurable default endpoint and metadata support to nacos
Registry,
providing a more flexible alternative to hardcoded environment variable
reads.

- Add defaultEndpoint and defaultMetadata fields to Registry struct
- Add SetDefaultEndpoint method to override service endpoints
- Add SetDefaultMetadata method to merge extra metadata
- Update Register method to use configured defaults

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
2026-01-15 14:36:27 +08:00
c600f3aae8 feat(container): Add NewXXXWithChecker function for gmap/gset/gtree (#4610)
为了解决开发者需要通过`var`在代码顶部创建`gmap/gset/gtree`时需要同时设置`nilchecker`的需求,为这几个容易增加带有`checker`入参的构造函数`NewxxxxWithChecker`和`NewxxxWithCheckerFrom`

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-15 14:26:42 +08:00
9dd43cd331 feat(gdb/gdb_model_lock.go): gdb support lock update skip locked (#4607)
feat(gdb/gdb_model_lock.go): GDB 支持 FOR UPDATE SKIP LOCKED 语法

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-15 13:27:25 +08:00
3e73e2d2cc fix(database/gdb): skip field filtering when table/alias is unknown in FieldsPrefix (#4602)
## Summary
- Fix FieldsPrefix silently dropping fields when called before LeftJoin
- When table/alias is unknown, skip filtering and return fields directly

## Test plan
- [x] Added unit test Test_Issue4595 in pgsql driver
- [x] Test covers: FieldsPrefix before LeftJoin, Fields with prefix,
FieldsPrefix after LeftJoin

Closes #4595
2026-01-15 10:25:40 +08:00
1ed4e0267a fix(util/gconv): gconv unsafe str to bytes (#4600)
The gconv.UnsafeStrToBytes function has been updated to use the Go 1.20+
safe approach, as the previous implementation could cause a panic in
certain scenarios.

For example, when an HTTP request header specifies Content-Type:
application/x-www-form-urlencoded, but the actual request body contains
JSON data, the following code attempts to detect and handle this case:
```go
if !gregex.IsMatchString(`^[\w\-\[\]]+$`, name) && len(r.PostForm) == 1 {
    // It might be JSON/XML content.
    if s := gstr.Trim(name + strings.Join(values, " ")); len(s) > 0 {
        if s[0] == '{' && s[len(s)-1] == '}' || s[0] == '<' && s[len(s)-1] == '>' {
            r.bodyContent = gconv.UnsafeStrToBytes(s)
            params = ""
            break
        }
    }
}
```
However, after this assignment, bodyContent ends up with a capacity
(cap) of 0. slice operations like [:] perform stricter validation and
will panic if the capacity is 0. This causes a panic in functions such
as:

```go
body = bytes.TrimSpace(body)

func TrimSpace(s []byte) []byte {
    ...
    return s[start:stop] // panic here due to cap == 0
}
```
The capacity (cap) of the slice returned by directly calling this
function is unpredictable, as it depends on the adjacent memory layout.
However, within the framework, this causes issues—likely because,
starting from Go 1.22, the standard library's parseForm implementation
consistently appends a trailing zero byte after the string data in
memory.
This PR fix the problem.

------------------------------------
gconv unsafe str to bytes 改用 go1.20 后的写法,之前的写法在某些场景下会 panic
例如 http 请求头为`application/x-www-form-urlencoded`,实际的 body 为 json,
经过解析后
```go
	if !gregex.IsMatchString(`^[\w\-\[\]]+$`, name) && len(r.PostForm) == 1 {
					// It might be JSON/XML content.
					if s := gstr.Trim(name + strings.Join(values, " ")); len(s) > 0 {
						if s[0] == '{' && s[len(s)-1] == '}' || s[0] == '<' && s[len(s)-1] == '>' {
							r.bodyContent = gconv.UnsafeStrToBytes(s)
							params = ""
							break
						}
					}
				}
```
bodyContent的 cap 为 0,由于切片操作[:]会校验 cap 为 0,会直接 panic
```go
body = bytes.TrimSpace(body)

---
func TrimSpace(s []byte) []byte {
...
return s[start:stop] // panic
}
```
直接使用这个函数得到的 cap 会是随机的, 因为跟的内存不确定,但是在框架中有问题,估计是1.22 后标准库parseForm
的时候后面内存固定跟了个 0
该 PR 修复这个问题

Co-authored-by: liov-ola <liov@olaparty.sg>
2026-01-15 10:21:45 +08:00
3120a8bc22 fix(net/goai): add openapi uuid.UUID type support (#4604)
This pull request updates the logic in `golangTypeToOAIType` to improve
how Go types are mapped to OpenAPI types. The most important changes are
focused on handling specific struct and slice types more accurately,
ensuring better compatibility with OpenAPI specifications.

Type mapping improvements:

* Added explicit handling for `[]uint8` and `uuid.UUID` types, mapping
both to `TypeString`. This ensures these commonly used types are
correctly represented in OpenAPI schemas.
* Refactored the switch statement to check for specific struct types
(`time.Time`, `gtime.Time`, `ghttp.UploadFile`, `[]uint8`, and
`uuid.UUID`) before falling back to the kind-based mapping. This
improves accuracy for special-case types.
2026-01-15 10:20:19 +08:00
13524a36bc fix(container): Add NilChecker Support to gmap, gset, and gtree for Typed Nil Issue Resolution (#4605)
## 描述
本PR为`gmap`、`gset`和`gtree`容器引入了`NilChecker`机制,以解决Go语言中的`typed
nil`问题。该实现允许用户注册自定义的nil检查函数来确定值是否应被视为nil,这对于处理那些会被存储到容器中的`typed
nil`值特别有用。
## 情况描述
当前`gmap`等容器的泛型容器存在对`value`的`nil`值无法正确过滤的问题,例如以下例子中如果使用默认的`if any(value)
!=
nil`去判断就会得到错误的结果,原因是会出现带有类型的`(*Student)(nil)`直接和`nil`比较或者使用`any`强转都是不对的,使用反射可以解决但是性能太差了,所以换个思虑我们让用户自己决定如何判断`nil`就能解决这个问题
```golang
func main() {
	type Student struct {
		Name string
		Age  int
	}
	m1 := gmap.NewKVMap[int, *Student](true)
	for i := 0; i < 10; i++ {
		m1.GetOrSetFuncLock(i, func() *Student {
			if i%2 == 0 {
				return &Student{}
			}
			return nil
		})
	}
	fmt.Println(m1.Size()) //  10
	m2 := gmap.NewKVMap[int, *Student](true)
	m2.RegisterNilChecker(func(student *Student) bool {
		return student == nil
	})
	for i := 0; i < 10; i++ {
		m2.GetOrSetFuncLock(i, func() *Student {
			if i%2 == 0 {
				return &Student{}
			}
			return nil
		})
	}
	fmt.Println(m2.Size())  // 5

}

```

## 变更内容
- 在gmap、gset和gtree包中添加了`NilChecker`类型定义
- 扩展容器结构体,增加`nilChecker`字段来存储自定义nil检查函数
- 实现了`RegisterNilChecker`方法,允许用户注册自定义nil检查逻辑
- 添加了`isNil`内部方法,优先使用自定义nil检查函数或回退到默认的`any(v) == nil`检查
- 更新关键操作(AddIfNotExist、Set等)以利用nil检查机制
- 为所有三个容器类型添加了全面的测试用例以验证nilchecker功能

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-15 10:18:05 +08:00
cb26931378 ci(docker-services): change chinese printing message to english (#4599)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-09 16:04:41 +08:00
40f4d9f8ec chore: translte zh comment to en (#4591)
AS TITLE

---------

Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-09 14:27:28 +08:00
caea7ea4b8 fix(os/gcfg): adjust priority of env|cmd higer than config file (#4074) (#4587)
Co-authored-by: 杨延庆 <yangyq@bosyun.cn>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-09 11:04:00 +08:00
a6485d53af fix(cmd/gf): Fixed an issue where formatting caused import errors in gf init (#4598)
This pull request refactors the way Go files are formatted after project
generation in the `geninit` package. The main change is replacing the
previous formatting utility with a new function that uses the standard
library's `go/format` package, ensuring that only code formatting is
applied and import paths are not inadvertently modified.

**Formatting improvements:**

* Replaced the use of `utils.GoFmt` with a new `formatGoFiles` function
that utilizes `go/format` for formatting Go files, avoiding unwanted
changes to local import paths.
(`cmd/gf/internal/cmd/geninit/geninit_generator.go`)
* Added the `formatGoFiles` function, which recursively formats all Go
files in a directory using `go/format` and logs any formatting errors.
(`cmd/gf/internal/cmd/geninit/geninit_generator.go`)
* Updated comments and references in the code to clarify that formatting
is now handled by `formatGoFiles` instead of `utils.GoFmt`.
(`cmd/gf/internal/cmd/geninit/geninit_ast.go`)

**Dependency changes:**

* Removed the import of the custom `utils` package and added the
standard `go/format` package to support the new formatting approach.
(`cmd/gf/internal/cmd/geninit/geninit_generator.go`)
2026-01-09 11:00:35 +08:00
db9f47d942 refract(gerror): add ITextArgs interface and its implements, mainly for i18n that needs text and args separately (#4597)
This pull request refactors the error handling code to improve support
for error text formatting with arguments, making it easier to retrieve
both the error message template and its arguments (useful for i18n and
structured error handling). It introduces the new `ITextArgs` interface,
updates error constructors to store format strings and arguments
separately, and adds methods to retrieve them. Several usages and tests
are updated to reflect these changes.

### Error formatting and argument support

* Introduced the `ITextArgs` interface to allow errors to expose their
text template and arguments separately, supporting advanced use cases
like internationalization (`errors/gerror/gerror.go`).
* Updated the `Error` struct to include an `args` field for error
arguments, and added methods `TextWithArgs()`, `Text()`, and `Args()` to
retrieve formatted error text, the template, and arguments respectively
(`errors/gerror/gerror_error.go`).
[[1]](diffhunk://#diff-b56b52e546735b8196ec3e8bd25c0b007ac134e2f13b116ee3abcb2f92c3bdd9R23)
[[2]](diffhunk://#diff-b56b52e546735b8196ec3e8bd25c0b007ac134e2f13b116ee3abcb2f92c3bdd9L121-R145)
* Changed all error creation and wrapping functions (e.g., `Newf`,
`Wrapf`, `NewCodef`, etc.) to store the format string and arguments
separately, rather than pre-formatting the error text
(`errors/gerror/gerror_api.go`, `errors/gerror/gerror_api_code.go`).
[[1]](diffhunk://#diff-847475c1de42114004c50163aa2f34a4095e05122b4c2993aa3df4e5923e83cbL24-R27)
[[2]](diffhunk://#diff-847475c1de42114004c50163aa2f34a4095e05122b4c2993aa3df4e5923e83cbL43-R48)
[[3]](diffhunk://#diff-847475c1de42114004c50163aa2f34a4095e05122b4c2993aa3df4e5923e83cbL77-R78)
[[4]](diffhunk://#diff-31ee6b1493f4b206c060a98818226b1b78102c91b5ae22e34ed4d1bb4a38c185L25-R29)
[[5]](diffhunk://#diff-31ee6b1493f4b206c060a98818226b1b78102c91b5ae22e34ed4d1bb4a38c185L44-R50)
[[6]](diffhunk://#diff-31ee6b1493f4b206c060a98818226b1b78102c91b5ae22e34ed4d1bb4a38c185L77-R79)
[[7]](diffhunk://#diff-31ee6b1493f4b206c060a98818226b1b78102c91b5ae22e34ed4d1bb4a38c185L107-R110)
* Updated the `Option` struct and related constructor to handle error
arguments (`errors/gerror/gerror_api_option.go`).
[[1]](diffhunk://#diff-4b458af6df9a0d8289303cf408b082ed472360b286cdc5a556c8fe7541973caaR16)
[[2]](diffhunk://#diff-4b458af6df9a0d8289303cf408b082ed472360b286cdc5a556c8fe7541973caaR26)

### Code and test improvements

* Updated formatting and equality checks to use the new methods for
retrieving formatted error text and arguments, ensuring consistent
behavior (`errors/gerror/gerror_error.go`,
`errors/gerror/gerror_error_format.go`).
[[1]](diffhunk://#diff-b56b52e546735b8196ec3e8bd25c0b007ac134e2f13b116ee3abcb2f92c3bdd9L45-R46)
[[2]](diffhunk://#diff-fa801ef307f6c6fdda49fe9853593de29eda5b4d3712ea5bf9ed39de6e6859ebL26-R26)
* Improved unit tests to verify the new interface and argument handling,
including tests for the `ITextArgs` interface
(`errors/gerror/gerror_z_unit_test.go`).
* Minor code cleanup, such as removing unused imports and updating
comments for clarity (`errors/gerror/gerror_api.go`,
`errors/gerror/gerror_api_code.go`,
`errors/gerror/gerror_error_json.go`).
[[1]](diffhunk://#diff-847475c1de42114004c50163aa2f34a4095e05122b4c2993aa3df4e5923e83cbL10-L11)
[[2]](diffhunk://#diff-31ee6b1493f4b206c060a98818226b1b78102c91b5ae22e34ed4d1bb4a38c185L10)
[[3]](diffhunk://#diff-3e4ba207e242eb338f31f1091466374e8e72754a8969d92724bfb5c6b88f25edL15-R15)

These changes make error handling more flexible and maintainable,
especially for scenarios where error messages need to be localized or
programmatically inspected.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-09 10:48:43 +08:00
c5778127b1 fix(contrib/drivers): resolve field duplication issue when same table/column names exist across different MySQL/MariaDB databases (#4577)
当不同数据库存在相同表名和相同字段名, 并且该字段存在约束时, 例如字段类型是JSON, 会出现字段叠加. 导致访问数据库时, 出现数组越界.

---------

Co-authored-by: hailaz <739476267@qq.com>
2026-01-07 17:32:16 +08:00
8f826edc43 fix(cmd/gf): improve init command with version retry and gofmt support (#4592)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <29968474+hailaz@users.noreply.github.com>
2026-01-07 16:20:29 +08:00
d148e0ea62 test(errors/gcode,gerror): add unit tests for error handling interfaces and methods (#4586)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 13:26:02 +08:00
d091547212 fix(gf/gen): Fixed a problem that could cause duplication when generating wit… (#4268)
Fixed #4217

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-12-27 20:48:15 +08:00
6334ee1958 feat(cmd/gf): improve and enhance gen ctrl (#4325)
## 介绍
有时候某些项目没有达到要使用大仓模式的程度,使用单仓便可以完成业务。
但是`gf gen ctrl` 只能支持 `module/version` 这种目录,譬如
`user/v1`,像`api/app/user/v1`,`api/admin/admin/v1` 这种接口便无能为力。

**本`PR`改进了生成模式,现在使其可以更灵活的生成控制器,包括多级目录生成。**

## 例子
在 `api` 下定义了 `app` 和 `admin` 两个模块,其中 `app` 下又定义了 `/user/v1` 和
`/user/user_ext/v1`,最后生成如红框所示:


![image](https://github.com/user-attachments/assets/67db2f1c-8873-44c8-83ee-8620cfeb07e8)

这是一个复杂的例子,用来检测代码的健壮性。
在真实的项目中,应该类似 `api/app/user/v1`,`api/app/user_ext/v1`。

## 其他
- 规范了一些测试用例,譬如本来的测试文件放在 `/testdata/genctrl` 和 `/testdata/genctrl-merge`
中,现在更改为 `/testdata/genctrl/default` 和 `/testdata/genctrl/merge`;
- 替换掉废弃的方法 `gfile.Remove`。

增进来源:Issue和官网评论

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-12-27 19:50:21 +08:00
24939eb0d6 fix: update gf cli to v2.9.7 (#4579)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2025-12-27 19:46:09 +08:00
dd62b18877 feat: v2.9.7 (#4576)
This pull request primarily updates the GoFrame (`gf`) framework and its
related driver dependencies from version `v2.9.6` to `v2.9.7` across the
repository. Additionally, it removes the `examples` submodule and
updates the contributors image in the `README.MD` to reflect the new
version.

Dependency updates:

* Updated all references to `github.com/gogf/gf/v2` and related driver
dependencies from `v2.9.6` to `v2.9.7` in various `go.mod` files
throughout the repository, including core modules and contributed
drivers/configs.
[[1]](diffhunk://#diff-ee0abb9c50b9f91f424349123e31b7b1ba1e1e4f7497250422696c5bda2e74ceL6-R12)
[[2]](diffhunk://#diff-cef597d401b6dad225f9e2e431bdde7e53cb60bdf287624cef38a6a7bb9ae7a3L7-R7)
[[3]](diffhunk://#diff-970f7eacff9cd97a0d8a00d59ea8041eedaa21c7544c6669aaa58ca692c6b274L6-R6)
[[4]](diffhunk://#diff-c23d0ca80cd6588b7df84de8ef84713f0ce0555ba05d2d9e7f5d1e0324b1ed3aL6-R6)
[[5]](diffhunk://#diff-aa230a2b1198e6ef8afeb7f48335eb2e2f51d87d918d63c4d891fea612d18ff0L6-R6)
[[6]](diffhunk://#diff-86c2390edbede20803cd862908fe95e7207f7dbabd5089ddd4838e1f26e7fecaL6-R6)
[[7]](diffhunk://#diff-5e1af33d38ced461fc0e13981d7051e125876d1692efc3aa9cb4b7faa4c18addL7-R7)
[[8]](diffhunk://#diff-8c6247829130f219981483ccf25af699a63de99afedeb0dd5c1b7bd8ff0919bdL9-R9)
[[9]](diffhunk://#diff-accbd2d37d45e51db3fcb0468043b1e1fd53eeac9e3d3558467ef24444188d2fL7-R7)
[[10]](diffhunk://#diff-15fac9b8e76d2782594c91da72f6a6f42fc18e359c3be35bf6564ac3ca09f700L6-R7)
[[11]](diffhunk://#diff-8e1a76afd564b6073aac7b02ca59f296ae45a24da3dc4d5c40f18169f48ceba1L6-R6)
[[12]](diffhunk://#diff-00a9db26966c21305c72e8f659628dffaff0d6e9dc98a751406d2141d51a5d90L7-R7)
[[13]](diffhunk://#diff-2cbf2f66d5cb77d9f4d00e4c0ce45055620fff50c941a588da31729f09a81f1bL6-R7)
[[14]](diffhunk://#diff-20a21d07addeea398c4adb76d077875894a73b4b5b181b9df1fafe497d3fc843L6-R6)
[[15]](diffhunk://#diff-909670f1c29b0bba24faf1420504b9eacdff124c4cbbec1ddec5de60653ad007L6-R6)
[[16]](diffhunk://#diff-8eef5f0c081743f8002e0faba686e838b323cb53b749706ea42e0440aaa793f1L7-R7)
[[17]](diffhunk://#diff-82345842a29e8eaffa4f51aab96fa2aa78597e6639fe4b0ece797bc60edacea8L6-R6)
[[18]](diffhunk://#diff-23c6a84d45f3b30ae7ab1a95dec0b30329e702923cc74c5344b3606237ddd929L6-R7)

Repository maintenance:

* Removed the `examples` submodule entry from `.gitmodules`, indicating
that the examples are no longer included as a submodule in the
repository.

Documentation update:

* Updated the contributors image in `README.MD` to reference version
`v2.9.7` instead of `v2.9.6`.
2025-12-27 16:07:23 +08:00
cb4681ce3e feat(‎crypto/grsa): Add RSA encryption and decryption function (#4571)
补充RSA加密解密功能
This pull request improves documentation and developer onboarding for
the project, with a particular focus on the RSA cryptography package and
general installation instructions. The main changes include the addition
of a comprehensive README for the `grsa` RSA package, updated
installation steps in both English and Chinese documentation, and minor
clarifications to documentation links.

**Documentation improvements:**

* Added a detailed `README.md` for the `crypto/grsa` package, including
features, security considerations, usage examples, API descriptions, key
format explanations, and error handling guidance.
* Updated the English (`README.MD`) and Chinese (`README.zh_CN.MD`)
documentation to include a clear installation section with `go get`
instructions for easier onboarding.
[[1]](diffhunk://#diff-01e6d9ffed056a02cae8d8a0ec5d476a64d017bf85c0d5a94bb23ca21f33f5aaR27-R32)
[[2]](diffhunk://#diff-c93759cb9a9500f20e551c741eb167fc72825fd638d36121357feb8253ce6ac1R27-R41)
* Clarified and improved documentation links in both English and Chinese
README files, including the addition of a link to the documentation
source and improved naming for the GoDoc/Go package documentation.
[[1]](diffhunk://#diff-01e6d9ffed056a02cae8d8a0ec5d476a64d017bf85c0d5a94bb23ca21f33f5aaR41)
[[2]](diffhunk://#diff-c93759cb9a9500f20e551c741eb167fc72825fd638d36121357feb8253ce6ac1R27-R41)

**Developer tooling:**

* Added a commented-out `go install` command for `golangci-lint` in the
`Makefile` to assist developers in setting up linting tools.

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-12-26 18:18:30 +08:00
7daf916032 refactor(database/gdb): simplify order and group by alias quoting (bu… (#4555)
## What this PR does

Revert the auto table prefix behavior in `Order()` and `Group()`
introduced by #4521.

  ## Why

PR #4521 attempted to resolve column ambiguity in GROUP BY/ORDER BY with
MySQL JOIN by automatically adding table prefixes to unqualified
columns. However,
  this approach has issues:

1. When using `.As()` to set table alias, it uses the original table
name instead of the alias, causing errors in PostgreSQL and other
databases
2. The framework cannot reliably determine which table the user intends
when multiple tables have the same column
  3. Adds hidden behavior that users may not expect

  ## Example of the issue (#4554)

  ```go
  db.Model("demo_a").As("a").
      LeftJoin("demo_b", "b", "a.id=b.data_id").
      Order("sort").All()

  Expected (v2.9.5):
  ORDER BY "sort"

  Actual (v2.9.6):
  ORDER BY "demo_a".sort  -- Wrong! Should use alias "a" or no prefix

  Solution

Revert to v2.9.5 behavior: Order("sort") generates ORDER BY "sort"
without auto-prefixing. Users should explicitly specify table prefix
when needed:
  Order("a.sort").

  Closes #4554
  ```

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-12-26 16:43:19 +08:00
c82da1e57c feat(cmd/gf): improve gf run watching (#4573)
This pull request introduces a significant enhancement to the `gf run`
command, focusing on improving the directory watching mechanism for
hot-reload functionality. The main improvements include a more
intelligent and efficient algorithm for determining which directories to
watch (recursively or non-recursively), support for custom ignore
patterns, and a comprehensive set of unit tests to ensure correctness.
Additionally, some outdated database drivers were removed from the
dependencies.

**Key changes:**

### Directory Watching Improvements

* Refactored the directory watching logic in `cmd_run.go` to use a
DFS-based algorithm that minimizes the number of watched directories
while respecting ignored patterns. Directories and their descendants
without ignored subdirectories are watched recursively; otherwise,
non-recursive watches are set, and valid children are recursed into.
This results in more efficient and accurate hot-reload behavior.
(`cmd/gf/internal/cmd/cmd_run.go`)
* Added support for custom ignore patterns via the new
`-i`/`--ignorePatterns` flag, allowing users to specify directories to
be excluded from watching. Default ignored patterns include
`node_modules`, `vendor`, hidden directories, and directories starting
with an underscore. (`cmd/gf/internal/cmd/cmd_run.go`)
[[1]](diffhunk://#diff-406a97355fde87f9a6fc118877430c2720632eb94eb2aaba72025571e5fe5146R97)
[[2]](diffhunk://#diff-406a97355fde87f9a6fc118877430c2720632eb94eb2aaba72025571e5fe5146L61-R69)
[[3]](diffhunk://#diff-406a97355fde87f9a6fc118877430c2720632eb94eb2aaba72025571e5fe5146L104-R132)
* Improved parsing of comma-separated arguments for both watch paths and
ignore patterns to support flexible CLI usage.
(`cmd/gf/internal/cmd/cmd_run.go`)

### User Experience and Documentation

* Updated help messages, usage examples, and documentation to reflect
the new features and more intuitive CLI options for specifying watch
paths and ignore patterns. (`cmd/gf/internal/cmd/cmd_run.go`)
[[1]](diffhunk://#diff-406a97355fde87f9a6fc118877430c2720632eb94eb2aaba72025571e5fe5146L51-R58)
[[2]](diffhunk://#diff-406a97355fde87f9a6fc118877430c2720632eb94eb2aaba72025571e5fe5146R85)

### Testing

* Added a comprehensive unit test suite for the new `getWatchPaths`
logic, covering various scenarios including custom ignore patterns,
deeply nested structures, multiple roots, non-existent directories, and
edge cases. (`cmd/gf/internal/cmd/cmd_z_unit_run_test.go`)

### Dependency Cleanup

* Removed unused database driver dependencies from `go.mod` to
streamline the project dependencies. (`cmd/gf/go.mod`)

These changes collectively make the hot-reload feature more robust,
configurable, and efficient, while ensuring maintainability through
thorough testing.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
2025-12-26 16:42:06 +08:00
90564f9fb0 feat(os/gfile): add MatchGlob function with globstar support (#4570) (#4574)
This pull request introduces a new glob pattern matching utility to the
`gfile` package, adding support for advanced glob patterns including the
"**" (globstar) operator, which matches across directory boundaries,
similar to bash and gitignore. It also includes a comprehensive set of
unit tests to verify the correctness and cross-platform compatibility of
the new functionality.

**Glob pattern matching feature:**

* Added `MatchGlob` function to `gfile`, which extends `filepath.Match`
with support for the "**" (globstar) pattern, enabling recursive
directory matching and more flexible file pattern matching.
* Implemented internal helpers (`matchGlobstar` and `doMatchGlobstar`)
to handle normalization of path separators and recursive matching logic
for patterns containing "**".

**Testing and validation:**

* Added `gfile_z_unit_match_test.go` with extensive unit tests covering
basic glob patterns, globstar usage, prefix/suffix combinations,
multiple globstars, edge cases, and Windows path compatibility to ensure
robust and cross-platform behavior.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
2025-12-26 16:37:45 +08:00
4d6c7e3d3a feat(cmd/gf): init update (#4572)
This pull request introduces a significant enhancement to the `gf init`
command by adding support for initializing GoFrame projects from remote
templates, including interactive and advanced options for template
selection. The changes include new interactive flows, support for remote
repositories (including git subdirectories), and modularization of the
template initialization logic into a new `geninit` package.

The most important changes are:

### New Features & Interactive Initialization

* Added support for initializing projects from remote templates via the
`--repo/-r` flag, interactive mode (`--interactive/-i`), and version
selection (`--select/-s`). Users can now select built-in or remote
templates, specify custom repositories, and interactively choose project
configuration. (`cmd/gf/internal/cmd/cmd_init.go`)
[[1]](diffhunk://#diff-1213f1d7ea9ec0979d1b7aafaf9c84d53846c95f541e0252ab976cca90c677bdR50-R55)
[[2]](diffhunk://#diff-1213f1d7ea9ec0979d1b7aafaf9c84d53846c95f541e0252ab976cca90c677bdL68-R161)
[[3]](diffhunk://#diff-1213f1d7ea9ec0979d1b7aafaf9c84d53846c95f541e0252ab976cca90c677bdR267-R398)
* Introduced interactive prompts for template and project configuration,
including project name, module path, and dependency upgrade options.
(`cmd/gf/internal/cmd/cmd_init.go`)

### Code Organization & Modularization

* Extracted remote template initialization logic into a new package,
`geninit`, with a clear API for processing templates, handling
Go/gomod/git environments, and managing project generation.
(`cmd/gf/internal/cmd/geninit/geninit.go`)
* Added helper modules for Go and Git environment checks
(`geninit_env.go`), template downloading (`geninit_downloader.go`), and
AST-based Go import path replacement (`geninit_ast.go`).
[[1]](diffhunk://#diff-6238f52cc62f1e0dd569c7b1eacec609337e6e9eb9faf8604dcfc82149d907d1R1-R90)
[[2]](diffhunk://#diff-bbc29bf9a77f7097721185062041ff8ef622176bfb2c3886a94e68485773b5e6R1-R99)
[[3]](diffhunk://#diff-269925976ae0929279513615dbafc06f8560859ff0830ce82702735a5a7d6c61R1-R127)

### Usability Improvements

* Updated help and usage documentation to reflect new flags and
initialization modes, making it easier for users to discover and use the
new features. (`cmd/gf/internal/cmd/cmd_init.go`)

These changes greatly improve the flexibility and user experience of
project initialization in GoFrame, enabling both simple and advanced
workflows.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-26 12:01:32 +08:00
18e77de02f fix(net/ghttp): fix #4567 (#4569)
fix:  #4567
2025-12-18 15:21:57 +08:00
bf6238e178 feat(contrib/drivers/gaussdb): add gaussdb driver support (#4563)
This pull request introduces a new database driver for openGauss
(GaussDB), integrating it into the GoFrame framework. The implementation
includes connection handling, SQL execution, type conversion, and other
driver-specific logic. Additionally, the CI workflow is updated to
include an openGauss server for testing. The main themes are: new driver
implementation, SQL and type handling, and CI integration.

**GaussDB Driver Implementation:**

* Added a new driver in `contrib/drivers/gaussdb` to support
openGauss/GaussDB databases, including initialization, connection
handling, and registration with GoFrame's database abstraction.
(`gaussdb.go`, `gaussdb_open.go`)
[[1]](diffhunk://#diff-4f0d2a9160a039ccdf1dc98205ed7cd9f3bb8d606fed57c5a4813937eecca81fL11-R49)
[[2]](diffhunk://#diff-a0534a00c87159a3a3d2ea20a9779ead115cc7e38ab274484cfd4b2aa86b6055R1-R69)
* Implemented custom SQL execution and result handling to support
GaussDB's PostgreSQL-based features, including primary key handling on
insert and custom result types. (`gaussdb_do_exec.go`,
`gaussdb_result.go`)
[[1]](diffhunk://#diff-528b2ec06651f4af022e0550526794a606bf257d59bc18b6bce58373c784a2f2R1-R110)
[[2]](diffhunk://#diff-ad33dffe3bbccae20b113e3865aa491ef3b54c68ef586a89cf09a581a1c2abedR1-R24)

**SQL and Type Handling:**

* Added SQL filtering and placeholder conversion to support
PostgreSQL-style parameterization and GaussDB-specific SQL quirks, such
as handling `INSERT IGNORE` and JSONB syntax. (`gaussdb_do_filter.go`)
* Implemented comprehensive type conversion logic for mapping
PostgreSQL/GaussDB types to Go types, including arrays, UUIDs, and
custom handling for JSON and numeric types. (`gaussdb_convert.go`)
* Provided a function for random ordering (`ORDER BY RANDOM()`) and
explicitly disabled upsert/ON CONFLICT support, as GaussDB does not
support this feature. (`gaussdb_order.go`, `gaussdb_format_upsert.go`)
[[1]](diffhunk://#diff-510fc9393899057fddacc7dd6d14f0ca2fff145b52341dd3cfa5db48c960e5c1R1-R12)
[[2]](diffhunk://#diff-c89496520a15032be867e26861b248f11557cc45d683b5216ca1756949a7b9adR1-R94)

**CI Integration:**

* Updated the CI workflow to start an openGauss server in Docker,
enabling automated tests against the new driver.
(`.github/workflows/ci-main.yml`)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-16 21:42:29 +08:00
887a776441 fix(cmd/gf): fix gf gen dao with removeFieldPrefix (#4243)
Fixed: #4113 
when use "removeFieldPrefix" config to generate entity, also delete
prefix in json tag

Co-authored-by: zhang <zhangtao@changxinsec.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-12-13 17:37:45 +08:00
7274a7399a feature(crypto): add gsha256 (#4558)
This pull request introduces a new package, `gsha256`, providing SHA256
encryption utilities for both arbitrary data and file contents. It also
adds comprehensive unit tests to ensure the correctness of these new
APIs.

**New SHA256 encryption utilities:**

* Added the `gsha256` package with three main functions:
-
[`Encrypt`](diffhunk://#diff-664839ae1ff382c08d451abed4ad531eabffa7ef294becde4a0c580be482a9cfR1-R52):
Hashes any variable using SHA256, converting input to bytes via `gconv`.
-
[`EncryptFile`](diffhunk://#diff-664839ae1ff382c08d451abed4ad531eabffa7ef294becde4a0c580be482a9cfR1-R52):
Hashes the contents of a file at a given path, returning the SHA256
digest as a hex string. Errors are wrapped for clarity.
-
[`MustEncryptFile`](diffhunk://#diff-664839ae1ff382c08d451abed4ad531eabffa7ef294becde4a0c580be482a9cfR1-R52):
Like `EncryptFile`, but panics on error for convenience in situations
where failure is unexpected.

**Unit tests for new functionality:**

* Added `gsha256_z_unit_test.go` to test the new APIs:
- Verifies correct hash output for string and struct input to `Encrypt`.
- Validates file hashing and error handling for non-existent files in
`EncryptFile`.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joy999 <5414344+joy999@users.noreply.github.com>
2025-12-12 15:15:08 +08:00
b59824e9dc feat(database/gdb): Optimize SoftTime feature (#4559)
本次PR主要针对GoFrame ORM中的软删除`SoftTime`功能进行了优化
   - 新增`SoftTimeFieldType`枚举类型,用于区分创建、更新、删除三种不同的软时间字段
   - 替代之前使用的魔数方式,提高类型安全性
   - 将原有的6个方法精简为4个方法, 合并了三个几乎相同的`GetFieldNameAndTypeFor*`方法为统一的方法


This pull request refactors and simplifies the "soft time"
(created/updated/deleted timestamp) handling logic in the database
layer, making the codebase more maintainable and extensible. The changes
consolidate multiple similar methods into general-purpose ones, improve
cache key generation, and clarify the logic for generating and applying
soft time field values and conditions.

Key changes include:

**Soft Time API Refactoring and Simplification**
- Consolidated multiple methods (`GetFieldNameAndTypeForCreate`,
`GetFieldNameAndTypeForUpdate`, `GetFieldNameAndTypeForDelete`) into a
single, parameterized method `GetFieldInfo`, reducing code duplication
and making it easier to support new soft time field types. The interface
and implementation for soft time maintenance (`iSoftTimeMaintainer`,
`softTimeMaintainer`) have been updated accordingly.
[[1]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L46-R66)
[[2]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L105-R180)
- Combined and renamed methods for generating soft time field values and
delete conditions, such as merging
`GetValueByFieldTypeForCreateOrUpdate` into `GetFieldValue`, and
`GetWhereConditionForDelete` into `GetDeleteCondition`. Related usages
throughout the codebase have been updated to use the new methods.
[[1]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L255-R206)
[[2]](diffhunk://#diff-97beb485550e4381182a04bbb857a25b7f4ecd4a594dff8ac884cfaae38f3046L34-R35)
[[3]](diffhunk://#diff-97beb485550e4381182a04bbb857a25b7f4ecd4a594dff8ac884cfaae38f3046L55-R55)
[[4]](diffhunk://#diff-88304ddb7791aedbd83dafb68374aecab286d1356a7f2f149a8e57ac1a7f40b4L265-R267)
[[5]](diffhunk://#diff-88304ddb7791aedbd83dafb68374aecab286d1356a7f2f149a8e57ac1a7f40b4L298-R311)
[[6]](diffhunk://#diff-d4f6e0370e049dea52f3db9a13c64e2cfb2f7ef012433186e21179149b626d0fL944-R944)

**Soft Delete Logic Improvements**
- Refactored the logic for building soft delete WHERE conditions and
generating update data, with clearer and more robust handling of field
types and prefixes. Introduced helper methods like
`buildDeleteCondition`, `GetDeleteData`, and improved error logging for
invalid field types.
[[1]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L287-R234)
[[2]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L313-R395)

**Cache Key Generation Enhancements**
- Added dedicated helper functions for generating cache keys for table
names, table fields, select queries, and soft time field/type lookups,
improving cache consistency and code readability.
[[1]](diffhunk://#diff-d57d57e6f9b342ba6fa30c4bb413e2f4f3514a8cd5ad36949eef126e5f8b7ac9R969)
[[2]](diffhunk://#diff-d57d57e6f9b342ba6fa30c4bb413e2f4f3514a8cd5ad36949eef126e5f8b7ac9R980)
[[3]](diffhunk://#diff-d57d57e6f9b342ba6fa30c4bb413e2f4f3514a8cd5ad36949eef126e5f8b7ac9R993-R1002)
[[4]](diffhunk://#diff-b1bbe5e3995261813e4e0ac6ffee8a37c236eaa2759f2bd82e211711695a70bcL790-R790)

**General Code Cleanup**
- Removed redundant code, clarified comments, and improved naming
throughout the affected files, making the code easier to follow and
maintain.
[[1]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L105-R180)
[[2]](diffhunk://#diff-6c1d606032d981a7b8aecd3a7167823f76b69407a29eb9a244175a82f59965d8L255-R206)

Let me know if you'd like a walkthrough of any specific part of the
refactored soft time logic!
2025-12-12 15:14:21 +08:00
5cbe421aaa feat(contrib/drivers): more database drivers (#4553)
This pull request adds first-class support for MariaDB, TiDB, OceanBase,
and GaussDB as separate database drivers in the GoFrame ecosystem,
rather than relying solely on MySQL compatibility. It introduces new
driver packages for each database, updates documentation to reflect
these additions, and adjusts dependency management files accordingly.
The changes also deprecate the MariaDB-specific logic in the MySQL
driver in favor of the new dedicated MariaDB driver.

**New Database Driver Support**

* Added new driver packages for MariaDB, TiDB, OceanBase, and GaussDB
under `contrib/drivers/`, each with their own Go module files and driver
implementation that wraps the MySQL driver for protocol compatibility
and future extensibility.
[[1]](diffhunk://#diff-0dd9dca0fb712c3691a95186853d1fc38a30a74ba34cbdc9aa6facee5457d681R1-R48)
[[2]](diffhunk://#diff-23c6a84d45f3b30ae7ab1a95dec0b30329e702923cc74c5344b3606237ddd929R1-R44)
[[3]](diffhunk://#diff-a8a6766c0d5b9c0788d0276b41b33fdbe786e0584fda19fd26db715bcf46fbcdR1-R48)
[[4]](diffhunk://#diff-2cbf2f66d5cb77d9f4d00e4c0ce45055620fff50c941a588da31729f09a81f1bR1-R44)
[[5]](diffhunk://#diff-4f0d2a9160a039ccdf1dc98205ed7cd9f3bb8d606fed57c5a4813937eecca81fR1-R47)
[[6]](diffhunk://#diff-accbd2d37d45e51db3fcb0468043b1e1fd53eeac9e3d3558467ef24444188d2fR1-R44)
[[7]](diffhunk://#diff-15fac9b8e76d2782594c91da72f6a6f42fc18e359c3be35bf6564ac3ca09f700R1-R44)
* Registered these new drivers in the main module's `go.mod` and
`go.work` files for proper dependency resolution and local development.
[[1]](diffhunk://#diff-ee0abb9c50b9f91f424349123e31b7b1ba1e1e4f7497250422696c5bda2e74ceR12-R15)
[[2]](diffhunk://#diff-a70c108de96ca9b56b7768254143b2b9f20ce1dcab51d92ce083fdfcba2efd6cR17-R20)

**Documentation Updates**

* Expanded the `contrib/drivers/README.MD` to include installation and
import instructions for the new drivers, and clarified the supported
drivers section with dedicated code examples for each.
[[1]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299R12-R24)
[[2]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299L46-R80)

**MariaDB Driver Enhancements**

* Implemented a MariaDB-specific `TableFields` method and SQL query in
the new driver, improving the accuracy of table field retrieval for
MariaDB databases.
* Added unit test initialization code for MariaDB to ensure driver
functionality.

**Deprecation and Refactoring**

* Marked the MariaDB-specific logic and SQL in the MySQL driver as
deprecated, with a note to remove it in the next version, directing
users to the new MariaDB driver instead.
[[1]](diffhunk://#diff-9892cdfb158af82d92f3bfe9e418011bd47a0596638428e61c70993dd72b9c47R18-R20)
[[2]](diffhunk://#diff-9892cdfb158af82d92f3bfe9e418011bd47a0596638428e61c70993dd72b9c47R74-R75)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Lance Add <1196661499@qq.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-09 16:33:55 +08:00
852c3dda62 feat(contrib/drivers/dm&pgsql&mssql&oracle): add Replace/LastInsertId features support for dm/pgsql/mssql/oracle (#4547)
This pull request introduces significant improvements to the handling of
the `Replace` and `Save` operations for multiple database drivers,
especially for MSSQL and PostgreSQL. The changes ensure that these
operations now auto-detect primary keys when conflict columns are not
explicitly provided, improving usability and aligning behavior across
drivers. Additionally, the pull request updates related tests to reflect
these enhancements and includes some minor documentation and code
cleanup.

**Key changes:**

### Enhanced Replace/Save Logic for Database Drivers

* **MSSQL Driver:**
- `Replace` and `Save` operations now auto-detect primary keys if
`OnConflict` is not specified, using the `MERGE` statement for upsert
functionality. If no primary key is found in the data, a detailed error
is returned.
[[1]](diffhunk://#diff-87815aa559a927e2de09bd05148f9841dfc06a1b5f3ecc5e3d5fcb80323a87f8L23-R61)
[[2]](diffhunk://#diff-87815aa559a927e2de09bd05148f9841dfc06a1b5f3ecc5e3d5fcb80323a87f8L43-L59)
- Updated tests to verify that `Replace` correctly updates or inserts
records, and that missing conflict columns are properly handled.
[[1]](diffhunk://#diff-bdbde9d7d6ee14c795343767b414740c4396f4dd3e97788b1f9d4e615405a42dL141-R151)
[[2]](diffhunk://#diff-26338e93e473300b1313936eb0f6826546473793442f24715fa294b595f7a805L2661-R2707)

* **PostgreSQL Driver:**
- Similar to MSSQL, `Replace` and `Save` now auto-detect primary keys
for conflict resolution if `OnConflict` is not set, and treat `Replace`
as a `Save` operation.
- Adjusted tests to ensure `Save` and `Replace` work as expected,
including verifying data replacement and insertion.
[[1]](diffhunk://#diff-c22703c37ebb6836c332f7cd2ada570577ba4564fe39886db02f7c2d0e7a2048L93-R93)
[[2]](diffhunk://#diff-c22703c37ebb6836c332f7cd2ada570577ba4564fe39886db02f7c2d0e7a2048R102)
[[3]](diffhunk://#diff-c22703c37ebb6836c332f7cd2ada570577ba4564fe39886db02f7c2d0e7a2048L110-R130)

* **DM Driver:**
- Improved conflict detection: now checks that at least one primary key
exists in the provided data when `OnConflict` is not specified, and
provides clearer error messages.
- Refactored to use the core method for primary key detection and
removed redundant code.

### Minor Improvements and Documentation

* Added clarifying comments to `DoInsert` methods for ClickHouse, DM,
MSSQL, Oracle, and PostgreSQL drivers, specifying that the input list
must have at least one validated record.
[[1]](diffhunk://#diff-f2e003895041ed3c52b91bb8c270696adc3528d77c39d2f7137af3396267444cR19)
[[2]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eR23)
[[3]](diffhunk://#diff-87815aa559a927e2de09bd05148f9841dfc06a1b5f3ecc5e3d5fcb80323a87f8L23-R61)
[[4]](diffhunk://#diff-f61dac3fcfd5df4a3936cd8743499c8c0fc45f4f5d0f5398ed84a0cb1603202cR24)
[[5]](diffhunk://#diff-c1dfed79aaa3a432057d2bd74d270e4b4094ebcf72984f1161d4972bea009410R16-R72)
* Minor code and comment cleanups, including improved formatting and
error handling.
[[1]](diffhunk://#diff-f61dac3fcfd5df4a3936cd8743499c8c0fc45f4f5d0f5398ed84a0cb1603202cR37)
[[2]](diffhunk://#diff-f61dac3fcfd5df4a3936cd8743499c8c0fc45f4f5d0f5398ed84a0cb1603202cL96-R98)
[[3]](diffhunk://#diff-f61dac3fcfd5df4a3936cd8743499c8c0fc45f4f5d0f5398ed84a0cb1603202cL106-L116)
[[4]](diffhunk://#diff-a17b44c76aaac53d1f164a2bb9440a5531659f4355e7ccfabdadff8dc8633c09L170-R171)
[[5]](diffhunk://#diff-56189fa9ae1df51716b50d34d7fe56bfe67a330e8ac2c6b0de7b958db6817ed5R83-R98)

### Workflow and Documentation Updates

* Updated example Docker commands in the CI workflow for consistency and
clarity.
[[1]](diffhunk://#diff-a1a3cb9bdeb5541d148091d973cf266aa3b317e6415a86630e816cbe27cf8b9cL57-R57)
[[2]](diffhunk://#diff-a1a3cb9bdeb5541d148091d973cf266aa3b317e6415a86630e816cbe27cf8b9cL78-R78)
[[3]](diffhunk://#diff-a1a3cb9bdeb5541d148091d973cf266aa3b317e6415a86630e816cbe27cf8b9cL92-R92)
[[4]](diffhunk://#diff-a1a3cb9bdeb5541d148091d973cf266aa3b317e6415a86630e816cbe27cf8b9cL106-R106)
[[5]](diffhunk://#diff-a1a3cb9bdeb5541d148091d973cf266aa3b317e6415a86630e816cbe27cf8b9cL153-R153)
[[6]](diffhunk://#diff-a1a3cb9bdeb5541d148091d973cf266aa3b317e6415a86630e816cbe27cf8b9cL164-R164)
* Removed outdated note about `Replace` support from the SQLite driver
documentation.

These changes improve the consistency, reliability, and developer
experience when performing upsert operations across different database
backends.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Lance Add <1196661499@qq.com>
2025-12-09 15:46:41 +08:00
d8b857f930 fix(net/ghttp): Fix specification routing custom parameter recognition exception (#4549)
fix #4442
2025-12-09 08:13:11 +08:00
d353bf0fbc feat(contrib/drivers/pgsql): more field types converting support (#3737)
This pull request significantly improves PostgreSQL array type handling
and conversion in the `pgsql` driver, providing more accurate type
mapping and conversion logic, especially for array types. It introduces
comprehensive documentation, refactors conversion logic to use the `pq`
package for array types, and adds extensive unit tests to ensure
correctness and error handling. Additionally, minor enhancements and
clarifications are made to upsert formatting and table field queries.

### PostgreSQL Array Type Handling and Conversion

* Refactored `CheckLocalTypeForField` and `ConvertValueForLocal` methods
in `contrib/drivers/pgsql/pgsql_convert.go` to accurately map PostgreSQL
array types (such as `_int2`, `_int4`, `_int8`, `_float4`, `_float8`,
`_bool`, `_varchar`, `_text`, `_char`, `_bpchar`, `_numeric`,
`_decimal`, `_money`, `_bytea`) to their corresponding Go types, using
the `pq` package for conversion. Added detailed documentation and
mapping tables for supported types.
[[1]](diffhunk://#diff-a3b1e68bfa29fbcfda7c703bbe875fa82e958f6c3ad942ef82193a9dd8ad67e2R46-R63)
[[2]](diffhunk://#diff-a3b1e68bfa29fbcfda7c703bbe875fa82e958f6c3ad942ef82193a9dd8ad67e2L56-R103)
[[3]](diffhunk://#diff-a3b1e68bfa29fbcfda7c703bbe875fa82e958f6c3ad942ef82193a9dd8ad67e2R112-R209)

* Added comprehensive unit tests in
`contrib/drivers/pgsql/pgsql_z_unit_convert_test.go` to verify type
mapping and conversion for all supported array types, including error
cases for invalid input.

### Utility and API Improvements

* Added a new `Bools()` method to the `gvar.Var` type in
`container/gvar/gvar_slice.go` for converting values to `[]bool`, with
corresponding unit tests in `container/gvar/gvar_z_unit_slice_test.go`.
[[1]](diffhunk://#diff-32e887e540e0170f785508d105cb794e4d54d854b53b6950973c80022973c490R11-R15)
[[2]](diffhunk://#diff-01453eca4d4b3e35d07ca105cb924c6441d0cd9df6cbcc337a89832c8d53057fR24-R41)

### SQL Formatting and Documentation

* Improved documentation and formatting in the upsert logic of
`contrib/drivers/pgsql/pgsql_format_upsert.go` to clarify the use of
`EXCLUDED` in PostgreSQL's `ON CONFLICT DO UPDATE`.
* Enhanced readability of the table field query in
`contrib/drivers/pgsql/pgsql_table_fields.go` by reformatting SQL and
clarifying field extraction.

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: houseme <housemecn@gmail.com>
2025-12-08 11:18:45 +08:00
baf30a0e99 feat(contrib/drivers/dm): add Replace/InsertIgnore support and field type/length enhancements for dm database (#4541)
This pull request introduces significant improvements to the DM database
driver, especially around insert operations, and refines documentation
and tests to reflect these changes. The main focus is enabling support
for "replace" and "insert ignore" operations using DM's `MERGE`
statement, improving type reporting for table fields, and updating
documentation for clarity and accuracy.

### DM Driver Insert Operations

* Added support for `Replace` and `InsertIgnore` operations in the DM
driver by internally mapping them to DM's `MERGE` statement. This
enables upsert and insert-ignore behavior for DM databases, improving
compatibility with other drivers.
* Implemented helper methods (`doMergeInsert`, `doInsertIgnore`, and
`getPrimaryKeys`) to generate correct `MERGE` SQL statements and
automatically detect primary keys when needed.
[[1]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eL31-R94)
[[2]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eL115-R212)
* Updated the logic for building update values and SQL generation to
ensure correct behavior for both upsert and insert-ignore cases.
[[1]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eL61-R109)
[[2]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eL89-R132)
[[3]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eL100-R144)
[[4]](diffhunk://#diff-f51b30e3f0b0f1284b905385a89992efd0de2fe9ff8c5a4062344dfab17d428eL115-R212)

### Table Field Type Reporting

* Improved the DM driver's `TableFields` method to report column types
with length/precision (e.g., `VARCHAR(128)` instead of just `VARCHAR`),
aligning with expectations and other drivers.
[[1]](diffhunk://#diff-40a365112421ae1967bd960f8acefcc91ddb8180865b78bc49cd090fbf4883daL26-R26)
[[2]](diffhunk://#diff-40a365112421ae1967bd960f8acefcc91ddb8180865b78bc49cd090fbf4883daR88-R105)
* Updated related unit tests to expect the new type format for DM table
fields.

### Documentation Updates

* Removed outdated or redundant documentation in both English and
Chinese driver README files, and clarified supported features and
limitations for DM and other drivers.
[[1]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299L1)
[[2]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299L47-R46)
[[3]](diffhunk://#diff-d49f5bc3a34b11a6ccb82cc54675b06a7dea5f0a943ae91c4ca0d28bd5003299L119-L122)
[[4]](diffhunk://#diff-05411a14e9c7ca235f7f436bfde732853aa93b364361fe80d65ac768f4e4d613L1-L126)

### Test Suite Enhancements

* Refactored and restored unit tests for DM driver insert operations,
including tests for `Save`, `Insert`, and the new `InsertIgnore`
functionality to ensure correct behavior and compatibility.
[[1]](diffhunk://#diff-2b1a59b8b2adaa1ca3074629374ab122929e4d4fbb4cc794b8e1db60ebf8d4c2L143-L245)
[[2]](diffhunk://#diff-2b1a59b8b2adaa1ca3074629374ab122929e4d4fbb4cc794b8e1db60ebf8d4c2R512-R632)
* Minor adjustments to DM test initialization for improved clarity.

### Core Insert Logic Minor Refactoring

* Minor variable renaming for clarity in the core insert logic
(`gdb_core.go`), improving code readability.
[[1]](diffhunk://#diff-b1bbe5e3995261813e4e0ac6ffee8a37c236eaa2759f2bd82e211711695a70bcL449-R452)
[[2]](diffhunk://#diff-b1bbe5e3995261813e4e0ac6ffee8a37c236eaa2759f2bd82e211711695a70bcL466-R474)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 20:12:12 +08:00
6e0ba551f9 ci(release): disable go module caching in release workflow (#4539)
Resolves TODO comment requesting cache to be disabled for the
`actions/setup-go` step in the release workflow.

- Add `cache: false` to `actions/setup-go@v5` configuration
- Remove the now-completed TODO comment

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 处理 TODO: 禁用缓存 (来自 .github/workflows/release.yml)


</details>

Created from VS Code via the [GitHub Pull
Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
extension.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <29968474+hailaz@users.noreply.github.com>
2025-12-04 14:27:01 +08:00
1650aab340 fix: update gf cli to v2.9.6 (#4538)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2025-12-04 11:44:05 +08:00
bb9133ab9d fix: v2.9.6 (#4537) 2025-12-04 11:35:32 +08:00
48845c3473 fix(contrib/drivers/mssql): update tables SQL query for better compatibility (#4170)
修复gf gen在sqlserver上的异常问题:

1. https://github.com/gogf/gf/issues/1722
2. https://github.com/gogf/gf/issues/1761

```powershell
> gf gen dao
fetching tables failed: SELECT NAME FROM SYSOBJECTS WHERE XTYPE='U' AND STATUS >= 0 ORDER BY NAME: mssql: 对象名 
'SYSOBJECTS' 无效。
1. SELECT NAME FROM SYSOBJECTS WHERE XTYPE='U' AND STATUS >= 0 ORDER BY NAME
2. mssql: 对象名 'SYSOBJECTS' 无效。
```

在SqlServer 2022已测试通过:


![image](https://github.com/user-attachments/assets/9f6b7326-c790-4458-93dd-04782b617692)

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-12-03 23:42:16 +08:00
ea956189bf feat(contrib/drivers/dm): add WherePri support (#4157)
The Dameng database supports the wherepri method.
eg: `dao.User.Ctx(ctx).WherePri(id)`

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: John Guo <claymore1986@gmail.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-12-03 17:52:05 +08:00
3912d97811 fix(contrib/drivers/dm): support muti-line sql statement (#4163) (#4164)
Co-authored-by: hailaz <739476267@qq.com>
2025-12-03 16:18:47 +08:00
50fb349bc9 docs: update Chinese documentation and add README.zh_CN.MD (#4534)
Enhance the Chinese documentation by adding a new README file and
updating existing database driver instructions with the latest `go get`
commands. Additionally, provide Chinese explanations for the `gf`
command documentation.

fix https://github.com/gogf/gf/issues/4533
2025-12-01 09:35:06 +08:00
777d7aabb5 feat(container/gtree): add generic tree feature (#4522)
add generic tree feature
improve gmap.TreeMap

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-11-29 21:09:43 +08:00
5a67aac85d feat(container/gmap): add generic list map feature (#4520)
add the generic list map: ListKVMap[K,V] and let ListMap base on it.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-29 20:57:41 +08:00
132a5ab9a3 feat(container/gmap): add generic map feature (#4484)
add hash kvmap and let other hash map base on it.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-28 21:41:30 +08:00
8575f01273 feat(container/gqueue): add generic queuefeature (#4497)
add TQueue

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-28 12:42:12 +08:00
ac75026716 feat(container/gring): add generic ring feature (#4496)
add TRing

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-28 11:50:09 +08:00
485a9637cc feat(container/gpool): add generic pool feature (#4493)
add TPool[T] and let Pool base on it.

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-11-27 18:18:37 +08:00
b57b49ecca fix(ci): Free Disk Space (#4529)
改用新的方法,清理其他不必要的目录以获取更多可用空间
2025-11-27 16:47:10 +08:00
cdead46c79 fix(ci): update script permissions and add docker cleanup functionality (#4523) 2025-11-25 14:55:56 +08:00
a4883e6e3d feat(container/gset): add generic set feature (#4492)
Add generic set featrue: TSet[T]

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-24 17:47:36 +08:00
fe8ba5e35f fix(database/gdb): Resolve column ambiguity in GROUP BY/ORDER BY with MySQL JOIN (#4521)
When using JOIN queries in MySQL with the `Group()` method, column names
in GROUP BY clauses become ambiguous if multiple tables contain columns
with the same name (commonly `id`). This results in MySQL errors like
"Column 'id' in group statement is ambiguous".

**Example Issue:**
```go
model := t.Ctx(ctx).Fields("t_inf_job.*, t_inf_job_attr.*").
    LeftJoin("t_inf_job_attr", "t_inf_job.id = t_inf_job_attr.job_id").
    Where(t.Columns().Deleted, 0)

// This would fail with "Column 'id' in group statement is ambiguous"
err = model.Group(t.Columns().Id).Scan(&jobs)
```


### **Key Changes**

1. **Modified function signature**: `Group(groupBy ...string)` →
`Group(groupBy ...any)` to support Raw SQL expressions
2. **Auto-prefixing logic**: When JOINs are detected (by checking for "
JOIN " in the tables string), unqualified column names are automatically
prefixed with the primary table name
3. **Preserved existing behavior**: Already qualified columns
(containing ".") and Raw expressions are handled as before
4. **Added comprehensive test**: `Test_Model_Group_WithJoin` verifies
the fix works correctly with JOIN queries

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-11-24 15:57:20 +08:00
54b7c249fd fix(os/gcfg): ignore fsnotify event error to avoid package gcfg totally failing (#4400)
问题描述: Windows 11
文件夹映射的网络驱动器里面的go项目在启动的时候会因为系统没有映射磁盘的文件事件监听而报错,从而导致整个项目启动失败,目前我临时的修复是将该错误改为警告进行打印

---------

Co-authored-by: anno <anno@anno.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-21 22:51:42 +08:00
99d69857fa refactor(database/gdb): add quote for FieldsPrefix (#4485)
Code example:
``` go
	var res *BasicInfo
	err := g.DB().Model("basic_info").
		FieldsPrefix("basic_info", basicInfoColumns).
		Where("id", 35813305356386305).Scan(&res)
	if err != nil {
		panic(err)
	}
	g.Dump(res)
```

SQL generated before modification :
``` sql
SELECT basic_info.id,basic_info.full_name,basic_info.contact FROM `basic_info` WHERE (`id`=35813305356386305) AND `delete_time` IS NULL LIMIT 1
```

SQL generated after modification:
``` sql
SELECT `basic_info`.`id`,`basic_info`.`full_name`,`basic_info`.`contact` FROM `basic_info` WHERE (`id`=35813305356386305) AND `delete_time` IS NULL LIMIT 1
```

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-11-21 17:27:09 +08:00
1b26013a66 fix: update copyright notice in multiple files to specify correct file reference (#4518)
修复注释
2025-11-21 14:12:56 +08:00
6c2155bd26 feat(container/glist): add generic list feature (#4483)
It is wrote with glist.List's and list.List's source codes and improve
to support T type.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-20 18:20:19 +08:00
9018a3d4ac feat(container/garray): enhance generic array implements (#4482)
Remove the t array of wrapper array. Now it's a real one. Other normal
array will base on it.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-19 18:11:04 +08:00
362d4202c4 fix(contrib/drivers/pgsql): Fixed the problem of overlapping fields in the same table name in pgsql multiple schema mode (#4375)
Co-authored-by: hailaz <739476267@qq.com>
2025-11-19 18:03:52 +08:00
a85b221d32 fix(contrib/config/apollo):where gcfg config apollo failed to retrieve configurations for multiple namespaces, where watch apollo change resulted in missing configurations. (#4509)
Fixed an issue where `gcfg config apollo` failed to retrieve
configurations for multiple namespaces; fixed an issue where `watch
apollo change` resulted in missing configurations.

---------

Co-authored-by: DAWN <xiongchao@cdfsunrise.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-11-19 16:18:55 +08:00
cb8594eb80 refactor(contrib/clickhouse): optimization clickhouse (#4499)
1. close stmt
2.  fix assert  *gtime.Time
2025-11-19 16:03:07 +08:00
ac88e640d1 fix(net/goai): swagger $ref replace (#4512)
修复swagger泛型导致的 []/三个特殊字符不支持

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-11-19 16:00:39 +08:00
2d307c5dd1 feat(contrib/drivers/pgsql): add array type numeric[] and decimal[] converting to Go []float64 support #4457 (#4511)
Co-authored-by: hailaz <739476267@qq.com>
2025-11-19 14:35:30 +08:00
54453c8e8f fix(ci): add cache cleaning step to prevent 'no space left on device' errors (#4513)
修复ci runner免费的磁盘空间不足导致无法完成单元测试的问题
1. 移动example单测到ci sub中
2. 使用go clean -cache清理避免短期内再次出现空间不足的问题
2025-11-19 12:54:51 +08:00
Ray
072b962b81 fix(‎encoding/gjson): fix gjson data race (#4510) 2025-11-17 15:21:38 +08:00
a80f58b7f6 fix: update gf cli to v2.9.5 (#4507)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2025-11-10 21:45:57 +08:00
1e3aa5f080 fix: v2.9.5 (#4503) 2025-11-10 21:40:35 +08:00
fde47e8981 fix(cmd/gf): The problem of the command 'gen dao' becoming very slow (#4498)
fixed #4479

修复gf gen dao执行严重变慢的问题

主要调整,降级两个依赖库
`go get golang.org/x/tools@v0.26.0` // 直接依赖
`go get golang.org/x/text@v0.25.0` // 间接依赖

至于为什么这两个库会导致慢,还需要深入排查
2025-11-10 17:38:50 +08:00
c02148cd6b feat(‎container/garray): Sorted T Array (#4470)
Add the sorted T array

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-10-17 18:10:31 +08:00
XG
1d4e684949 refactor(cmd/gf): Optimize run command to reload only on file write events (#4476)
优化run命令使得只在文件有写入事件时才触发reload:
gf run 的文件监控逻辑之前会对所有文件系统事件做出响应,包括非内容修改的事件(如文件access
time变化),这会导致开发过程中不必要的频繁重载。本次修改在文件监控回调中增加了event.IsWrite()的判断,确保只有在文件内容被实际写入时才触发重载逻辑,优化了开发体验。
2025-10-16 16:20:24 +08:00
8ff0de88b8 build(contrib): upgrade nacos registry&config (#4473)
RT
2025-10-16 11:29:44 +08:00
ac3efe5a00 feat(os/gcfg): Add file watcher with custom callback support (#4446)
为`gcfg`添加配置文件变更自定义回调,实现了`WatcherAdapter`接口,以下是`AdapterFile`的用法
test.yaml
```
b: "b"

```
```
package main

import (
	"fmt"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gcfg"
	"github.com/gogf/gf/v2/os/gctx"
)

func main() {
	ctx := gctx.New()
	file, _ := gcfg.NewAdapterFile("test.yaml")
	file.Data(ctx)
	file.AddWatcher("test", func() {
		value := file.MustGet(ctx, "b")
		fmt.Println(value.String())
	})
	server := g.Server()
	server.Run()
}
```
使用`g`和默认配置文件
```
	file := g.Cfg().GetAdapter().(*gcfg.AdapterFile)
	file.AddWatcher("test", func() {

	})
	file := g.Cfg().GetAdapter().(*gcfg.AdapterFile)
	file.RemoveWatcher("test")
```

注意:由于`gf`的`AdapterFile`使用的监听到文件变化删除缓存下一次重新初始化的懒加载方案,所有除了默认加载的`config.xxx`文件外,自定义的配置文件像`test.yaml`之类的都需要在`AddWatcher`前主动读取一次数据进行初始化监听(
`g.Cfg("test").Data(ctx)`)

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hunk Zhu <hunk@joy999.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-15 16:59:52 +08:00
613
2744fe2212 fix(net/gclient): fix content-type 'application/json;charset=utf-8' … (#4369)
fix(net/gclient): fix content-type 'application/json;charset=utf-8' can
not match `application/json`

---------

Co-authored-by: houseme <housemecn@gmail.com>
2025-10-15 16:14:33 +08:00
1682cc98bb feat(gdb): Allow to set table field metadata and allow to generate table fields registration code when generating dao (#4460)
`gdb`在第一次查询时会拉取一次`table`的`fields meta`信息,为后续orm的字段过滤和时间特性服务,`gen
dao`时已经获得了`table`的所有`fields
meta`,提供一个生成`table`的功能,允许客户自行决定是否生成,是否注入已知表结构缓存到指定`db`实例。
1. 能解决部分兼容`mysql`的二开数据库在获取`fields meta`时无法和`mysql`保持一致的问题。
2.
可以模拟表字段信息而不需要真实的数据库连接,对于已知的表结构,可以直接设置缓存,在无法连接数据库的情况下,仍然可以使用表字段信息,使用gdb构建sql时不需要受限于实际数据库即可使用`gdb.ToSQL()`方法。
4. 提升访问速度

生成的示例目录
<img width="389" height="670" alt="SCR-20251010-ntne"
src="https://github.com/user-attachments/assets/ebb08e70-cce1-4b73-9128-6ff784e4df3b"
/>

生成的示例代码
```golang
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================

package table

import (
	"context"

	"github.com/gogf/gf/v2/database/gdb"
)

// RolePermissions defines the fields of table "role_permissions" with their properties.
// This map is used internally by GoFrame ORM to understand table structure.
var RolePermissions = map[string]*gdb.TableField{
	"role_id": {
		Index:   0,
		Name:    "role_id",
		Type:    "bigint unsigned",
		Null:    false,
		Key:     "PRI",
		Default: nil,
		Extra:   "",
		Comment: "",
	},
	"permission_id": {
		Index:   1,
		Name:    "permission_id",
		Type:    "bigint unsigned",
		Null:    false,
		Key:     "PRI",
		Default: nil,
		Extra:   "",
		Comment: "",
	},
	"created_at": {
		Index:   2,
		Name:    "created_at",
		Type:    "timestamp",
		Null:    false,
		Key:     "",
		Default: "CURRENT_TIMESTAMP",
		Extra:   "DEFAULT_GENERATED",
		Comment: "",
	},
	"updated_at": {
		Index:   3,
		Name:    "updated_at",
		Type:    "timestamp",
		Null:    false,
		Key:     "",
		Default: "CURRENT_TIMESTAMP",
		Extra:   "DEFAULT_GENERATED on update CURRENT_TIMESTAMP",
		Comment: "",
	},
	"deleted_at": {
		Index:   4,
		Name:    "deleted_at",
		Type:    "timestamp",
		Null:    true,
		Key:     "",
		Default: nil,
		Extra:   "",
		Comment: "",
	},
}

// SetRolePermissionsTableFields registers the table fields definition to the database instance.
// db: database instance that implements gdb.DB interface.
// schema: optional schema/namespace name, especially for databases that support schemas.
func SetRolePermissionsTableFields(ctx context.Context, db gdb.DB, schema ...string) error {
	return db.GetCore().SetTableFields(ctx, "role_permissions", RolePermissions, schema...)
}

```
2025-10-15 15:50:16 +08:00
613
2742c98c06 fix(os/gcron): unit testing case of package gcron occasionally failed (#4419)
fix https://github.com/gogf/gf/issues/3999

1. fix  jobWaiter   sync.WaitGroup  data race
2. fix logger      glog.ILogger data race

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-15 15:17:05 +08:00
4226a23a39 feat(container/garray): add TArray (#4466)
Add TArray[T] for wrapping Array

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-15 15:08:26 +08:00
613
b8e414e125 fix(os/gcache): defaultcache lazy init (#4468)
defaultcache更改为懒加载,在用户使用redis缓存时,避免了程序启动时不必要的初始化开销。


<img width="2638" height="806" alt="image"
src="https://github.com/user-attachments/assets/96bb0097-8463-4303-971c-ee1a9ef671a6"
/>

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-15 15:01:47 +08:00
08c34b5ed7 feat(gf/build): Add support for the Loongson architecture (loong64) (#4467)
添加对龙芯架构(loong64)的支持

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-10-15 14:38:42 +08:00
416f314390 fix(contrib/drivers/pgsql): Merge duplicated fields, especially for key constraints. (#4465)
pgsql 执行TableFields 或者字段信息时需要合并key信息
2025-10-13 18:16:09 +08:00
98f0c36a1d fix: update gf cli to v2.9.4 (#4463)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2025-10-11 15:10:30 +08:00
2b7b4c8581 fix: v2.9.4 (#4461)
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-10-11 14:58:01 +08:00
613
b8844f3d40 fix(net/ghttp): attachment filename support utf8 (#4459) 2025-10-10 10:32:02 +08:00
3e2176d799 fix:(cmd/gf): matching for table ex fix bug (#4458)
fix the bug: sometimes it won't remove all broad matching talbenames.

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-10-09 12:08:28 +08:00
2f9225057f fix(contrib/drivers/mysql): Fix unit test issue for batch insert in MySQL driver (#4456)
Resolve a temporary issue in the unit tests for batch insertion by
adjusting user IDs.

因为底层的插入随机性,会导致单元测试偶发失败。
2025-09-30 14:33:46 +08:00
7b373446dc feat(cmd/gf): add broad matching to gf gen dao's tableEx attribute. (#4453)
Add "*" and "?" to tableEx for "gf gen dao".

The "*" will match none or some char. And the "?" only match one char.

Co-authored-by: hailaz <739476267@qq.com>
2025-09-30 11:27:03 +08:00
0f6d47c7a8 fix(container/gqueue): Optimize queue length calculation and loop structure in test cases (#4455)
fixed #4376
2025-09-29 17:26:39 +08:00
f24729206b fix(database/gdb): Resolved the schema error in the database output log when using the database sharding feature (#4319)
error log
```
2025-06-18T15:36:08.315+08:00 [DEBU] {10a3b0cfd9124a186b89b07f50e67ce6} [  0 ms] [default] [db_0] [rows:1  ] SELECT `id`,`custom_name` FROM `custom` WHERE `id`=1 LIMIT 1

2025-06-18T15:36:09.259+08:00 [DEBU] {10a3b0cfd9124a186b89b07f50e67ce6} [  1 ms] [default] [db_0] [rows:1  ] SELECT `id`,`custom_name`,`remark`FROM `custom` WHERE `id`=2 LIMIT 1

```
right log
```
2025-06-18T15:36:08.315+08:00 [DEBU] {10a3b0cfd9124a186b89b07f50e67ce6} [  0 ms] [default] [db_0] [rows:1  ] SELECT `id`,`custom_name` FROM `custom` WHERE `id`=1 LIMIT 1

2025-06-18T15:36:09.259+08:00 [DEBU] {10a3b0cfd9124a186b89b07f50e67ce6} [  1 ms] [default] [db_1] [rows:1  ] SELECT `id`,`custom_name`,`remark`FROM `custom` WHERE `id`=2 LIMIT 1
```

```

type DbShardingRule struct {
}

func (d *DbShardingRule) SchemaName(ctx context.Context, config gdb.ShardingSchemaConfig, value any) (string, error) {
	if name, ok := value.(string); ok && (len(name) > 0) && gstr.HasPrefix(name, config.Prefix) {
		return name, nil
	}
	return "default", nil
}

func (d *DbShardingRule) TableName(ctx context.Context, config gdb.ShardingTableConfig, value any) (string, error) {
	return "", nil
}
```

```
config := gdb.ShardingConfig{
		Schema: gdb.ShardingSchemaConfig{
			Enable: true,
			Prefix: "db_",
			Rule:   &DbShardingRule{},
		},
	}
dao.Custom.Ctx(ctx).Sharding(config).ShardingValue("db_0").Where("id", 1).One()
dao.Custom.Ctx(ctx).Sharding(config).ShardingValue("db_1").Where("id", 2).One()
```
我有两个完全一样的数据库db_0和db_1,两个custom表里都只有一条数据,id是1和2,执行上面两条查询得的结果是正确的,
输出日志中应该分别是`[default] [db_0]`和`[default] [db_1]`,但是实际输出的都是`[default]
[db_0]`,

查看具体代码实现,该日志由Core实例中获取group和schema构成,而实际执行sql时如果使用了分库特性那么执行sql的link会使用当前面schema重新生成,但是没有重新赋给Core实例,所以输出日志的时候还是错的,只需要在生成link后生成日志前把schema赋给Core就行,方法执行完成后defer将schema重置回去,防止有人重复使用同一个gdb对象造成困扰

![SCR-20250618-ovoc](https://github.com/user-attachments/assets/815c364e-939f-4a2c-9669-d5b7d2742511)

![SCR-20250618-ovvk](https://github.com/user-attachments/assets/e7d0e375-78e6-4748-90ac-d02dba18720f)

![SCR-20250618-ozsu](https://github.com/user-attachments/assets/faa6d69b-331e-476b-8bf8-f62e564b04d3)

![SCR-20250618-ozwj](https://github.com/user-attachments/assets/15c524dc-dc19-4499-a3d3-32bf1d918a3a)
2025-09-28 17:57:27 +08:00
7e9715ab1d feat(contrib/drivers/mssql): mssql support LastInsertId (#4051)
修复mssqlserver的InsertAndGetId方法;插入记录如果是自增主键则返回ID

---------

Co-authored-by: 林孝义 <linxy@3755.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-09-28 17:55:08 +08:00
f565a347c4 fix(database/gdb): Fix GetArray return type and add Bools method (#4452)
Change the return type of the GetArray method to Array for consistency
in data structure. Introduce a new Bools method to convert Vars to a
slice of bools, along with corresponding test cases to validate the
functionality.

```go
// 改进前
res, _ := db.Model(table).Fields("id").Array()
ids := make([]int64, 0, len(res))
for _, v := range res {
ids = append(ids, v.Int64())
}
g.Dump(ids)
// 改进后
res, _ := db.Model(table).Fields("id").Array()
ids := res.Int64s()
g.Dump(ids)
```
2025-09-28 17:08:37 +08:00
f172e61585 fix(net/ghttp): Server Domain if is empty str, bind handler pattern will add @ which is not expect #4100 (#4101)
fix https://github.com/gogf/gf/issues/4100

---------

Co-authored-by: elonnzhang <elonnzhang@tencent.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-09-26 18:49:36 +08:00
22d873f6bd fix(gerror): Fixed serialization failure issue when gerror.Error text field contains quote symbols (#4449)
如果调用internal 下的json.Marshal时 参数如果是gerror.Error 并且 字段中带有符号" 会导致序列化失败
原因是原gerror.Error 的MarshalJson方法只对字符串做了简单的处理 如果err.Error 返回的字符串中有符号"
这个符号会在序列化的时候被认为是字符串的终止导致序列化失败
<img width="854" height="186" alt="image"
src="https://github.com/user-attachments/assets/9a1e6d72-943f-41ad-a487-8a3c0f28f9f0"
/>

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-09-26 16:07:47 +08:00
613
b60b04e27a fix(database/gdb): performance improvement in fields grouping when in… (#4440)
fix https://github.com/gogf/gf/issues/3906

<img width="2604" height="980" alt="image"
src="https://github.com/user-attachments/assets/50852928-7ff5-4676-8ecf-6960c184e805"
/>

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-09-26 11:11:14 +08:00
613
d2bc5d812b fix(cmd/gf): run AddSigHandlerShutdown cannot work well (#4441)
https://github.com/gogf/gf/issues/3752

Sending [Interrupt] on Windows is not implemented.

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-09-23 10:58:24 +08:00
613
0648fd688e fix(cmd/gf): add extra option to controller the behavior downloading … (#4435)
https://github.com/gogf/gf/issues/3938
2025-09-22 17:30:06 +08:00
d0cfcce85b ci: Add CodeQL analysis workflow configuration (#4436) 2025-09-18 17:55:19 +08:00
2518d490c3 ci: Add Scorecard workflow for supply-chain security (#4437) 2025-09-18 17:55:03 +08:00
edc96a8c16 feat(database/gdb): Add the function of obtaining all configurations to facilitate business operations such as verification after addition. (#4389)
…ss operations such as verification after addition.

---------

Signed-off-by: sxp20008 <81209245@qq.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-09-18 16:21:02 +08:00
22427a08ad docs(i18n/gi18n): deleting the duplicate package documents (#4251)
Avoid in https://pkg.go.dev/github.com/gogf/gf/v2/i18n/gi18n display
duplicate content.

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-09-05 10:09:45 +08:00
41a5484620 fix(database/gredis): gredis support get raw client (#4306)
Fixes https://github.com/gogf/gf/issues/4298
Fixes https://github.com/gogf/gf/issues/2196
Fixes https://github.com/gogf/gf/issues/2135
```go
import goredis "github.com/redis/go-redis/v9"

func ExampleUsage(ctx context.Context, redis *Redis) error {
	client := redis.Client()
	universalClient, ok := client.(goredis.UniversalClient)
	if !ok {
		return errors.New("failed to assert to UniversalClient")
	}

	// Use universalClient for advanced operations like Pipeline
	pipe := universalClient.Pipeline()
	pipe.Set(ctx, "key1", "value1", 0)
	pipe.Set(ctx, "key2", "value2", 0)
	results, err := pipe.Exec(ctx)
	if err != nil {
		return err
	}
	// ... handle results
	return nil
}
```

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-09-03 16:09:43 +08:00
325ee45a55 fix: update gf cli to v2.9.3 (#4418)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2025-09-03 12:53:52 +08:00
627aa5d27f fix: Update version to v2.9.3 (#4417)
Change all references from v2.9.2 to v2.9.3 and update the release name
accordingly.
2025-09-03 12:48:06 +08:00
47db44843e fix(os/gtime): fix gtime time string handle logic (#4409)
1、gtime的StrToTime方法优化对时间字段格式兼容处理,并且针对时间越界抛出异常。
2、移除部分无用代码:
<img width="697" height="282" alt="image"
src="https://github.com/user-attachments/assets/92a88140-37c0-4ee1-aef7-c6418e9edd06"
/>

Fixes #4394

---------

Signed-off-by: Zjmainstay <hzgdys@163.com>
Co-authored-by: hailaz <739476267@qq.com>
2025-09-03 12:19:27 +08:00
a39498f74f fix: update gf cli to v2.9.3-rc4 (#4416)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: hailaz <hailaz@users.noreply.github.com>
2025-09-03 11:51:14 +08:00
80b866e11c fix: Update dependencies and exclude test data from go.mod processing (#4415)
Update dependencies and ensure that go.mod files in the test data
directory are excluded from processing during the tag creation for the
CLI tool.
2025-09-03 11:42:44 +08:00
2a77d3203e fix: Improve the typeMap check logic of "gf gen dao" (#4410)
Let it can support such as "Array(UInt256)", "Array(FixedString(25))".
Now we can typeMap as:
"array(uint256)": []big.Int
"array(fixedstring(25))": [25]string
"array(fixedstring)": []string
"array": []any

Now it will first match more precise rules. So it will match
array(uint256) and array(fixedstring(25)) first. Then the
"array(fixedstring)", the last is "array"
2025-09-03 11:16:38 +08:00
3c451bef82 fix: path ./cmd/gf (#4414) 2025-09-03 10:53:50 +08:00
5073f25691 chore: chmod +x update_version.sh (#4413) 2025-09-03 10:36:56 +08:00
40e97f1325 fix: #4269 (#4412)
fixed #4269
2025-09-02 22:49:05 +08:00
502d158bc0 fix: version 2.9.2 (#4405) 2025-09-01 15:33:50 +08:00
f08897a114 chore(tablewriter): upgrade to v1.0.9 and refactor table rendering logic (#4352)
### What’s Changed

* Upgraded `github.com/olekukonko/tablewriter` from previous version to
**v1.0.9**.

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-09-01 12:20:22 +08:00
b6181e4bde fix: report coverage on the latest go version (#4398) 2025-08-29 16:10:37 +08:00
613
f8cdeae2d7 fix(net/goai): fix g.Meta is passed as parameters of a request (#4397)
fix https://github.com/gogf/gf/issues/4247

<img width="2860" height="2308" alt="image"
src="https://github.com/user-attachments/assets/755cfe8a-b3ae-4c5a-ba04-68cc1b188ca7"
/>
2025-08-29 15:30:28 +08:00
bea060af4c feat: update linter config and deprecation notice (#4399)
- Add `gofmt` rewrite-rules to `.golangci.yml` for code formatting
consistency.
- Update deprecation comment in `gpage.go` to specify removal in version
3.0.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-29 15:26:56 +08:00
94cc233325 fix: disable specific staticcheck rules and update lint config (#4396)
fix: disable specific staticcheck rules and update lint config

- Disabled staticcheck rules SA1029, SA1019, S1000, and related checks
in `.golangci.yml` to filter out unwanted linter errors.
- Updated staticcheck checks list for more precise linting control.
- Clarified configuration for easier maintenance and future updates.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-29 10:32:30 +08:00
fsl
71743e6903 chore: add OpenSSF Scorecard for README.md (#3696)
Why is this needed:

The OpenSSF Scorecard improves open-source project's security by
providing automated, transparent assessments of their security
practices. It will help you identify vulnerabilities, adhere to best
practices, and continuously enhance your security posture, increasing
user trust and reducing the risk of security exploits.

I'll be the one to create the PR to add the scorecard GitHub action, and
I will also work with you to remediate the identified vulnerabilities.
I'll go through each [scorecard
check](https://github.com/ossf/scorecard/blob/main/docs/checks.md) to
see where the score has dropped and how it can be improved.


Integrate [scorecard](https://github.com/ossf/scorecard) in CI, and
display a Scorecard badge on the gogf repository
You also need to manually create a project, refer to
https://bestpractices.coreinfrastructure.org/en/projects
Manually create an gogf organization to report results, please see
https://sonarcloud.io/explore/projects?sort=-analysis_date

Signed-off-by: fsl <1171313930@qq.com>
2025-08-29 10:28:29 +08:00
f9ec3b19f7 fix(net/ghttp): wrong in-tag param parse for query param (#4227) (#4228)
Fixed issue #4227 and add unit test

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-08-29 09:46:48 +08:00
ee24da4e72 refactor: interface{} to any and reflect.Ptr to reflect.Pointer (#4395)
This pull request standardizes the use of the Go 1.18+ `any` type alias
instead of `interface{}` throughout the codebase. The change improves
code readability and aligns with modern Go best practices. The update
touches many files, including core data structures, code generation
templates, logging utilities, and test data, ensuring consistency across
all usages.

**Type alias migration to `any`:**

* Replaced all instances of `interface{}` with `any` in core data
structures such as `garray` and in generated model structs (e.g.,
`TableUser`, `User1`, `User2`) to modernize type usage.
[[1]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L31-R31)
[[2]](diffhunk://#diff-6c19859cb32c7516ea95ddc8f8235460818eb2f24d2204308e0d9e1b19e7d90fL15-R19)
[[3]](diffhunk://#diff-a15ba2f5e830b4833c47b902515a4f9e5a4f83a3707698f3229b307ec3776b41L15-R18)
[[4]](diffhunk://#diff-52e0837e84d49221d1b810d88fdf78221f36cffcd664fb42f8aba49a79b974dcL15-R19)
[[5]](diffhunk://#diff-11c3457d1a23a4ca6ecd00d6b856289774936b6a708384cf03aff164044e7546L15-R19)
[[6]](diffhunk://#diff-2cff9cf8e6a0cc34087326d8c8149c3bbaf74c76fdbdf5a73daed13cc04249e1L15-R19)
* Updated function signatures, method parameters, and return types from
`interface{}` to `any` in various parts of the codebase, including code
generation, service logic, and logging utilities (e.g., `mlog`).
[[1]](diffhunk://#diff-175edfeea54490b8fe4e18ffcbea5835efaf8f0b8acf623359073987cae7eb76L48-R55)
[[2]](diffhunk://#diff-2b1953fb78cf3593d8c2c7d911e95b65fd0b847c30ed0b4d167d16fe6d781235L54-R74)
[[3]](diffhunk://#diff-e001b7a4b63603b9b14f00de78a4d570bb76c5f57d856a24643f071032e12356L66-R73)
[[4]](diffhunk://#diff-5582954e8a9983988dc8854ad82067fb2ac6269b988e07357ad8db1dfec5f1a0L39-R41)
[[5]](diffhunk://#diff-c5d51d56f487779a2b6207c7ad26c7a20bbadcc846ce094fe60ab4cabff58c51L107-R107)
[[6]](diffhunk://#diff-f96e6a9fdb416eb1804ceaba1fe0ac637bff22c43837f8bb849c2366ce72d4a1L116-R121)
[[7]](diffhunk://#diff-f94c83a1b08ae060d9346f4a6031fc4a7b9a0b894e02d9afaa09018b6598eac0L112-R112)
[[8]](diffhunk://#diff-748b11dbe8828dd4c040ec23cae0b8fe57ecf0a2d1b7694ea39102294e633c64L36-R36)
[[9]](diffhunk://#diff-748b11dbe8828dd4c040ec23cae0b8fe57ecf0a2d1b7694ea39102294e633c64L74-R74)
[[10]](diffhunk://#diff-748b11dbe8828dd4c040ec23cae0b8fe57ecf0a2d1b7694ea39102294e633c64L96-R96)

**Generated code and templates:**

* Adjusted generated files and code generation templates to output `any`
instead of `interface{}` for relevant struct fields and function
signatures, ensuring that new code generation aligns with the updated
convention.
[[1]](diffhunk://#diff-6c19859cb32c7516ea95ddc8f8235460818eb2f24d2204308e0d9e1b19e7d90fL15-R19)
[[2]](diffhunk://#diff-a15ba2f5e830b4833c47b902515a4f9e5a4f83a3707698f3229b307ec3776b41L15-R18)
[[3]](diffhunk://#diff-52e0837e84d49221d1b810d88fdf78221f36cffcd664fb42f8aba49a79b974dcL15-R19)
[[4]](diffhunk://#diff-11c3457d1a23a4ca6ecd00d6b856289774936b6a708384cf03aff164044e7546L15-R19)
[[5]](diffhunk://#diff-2cff9cf8e6a0cc34087326d8c8149c3bbaf74c76fdbdf5a73daed13cc04249e1L15-R19)
[[6]](diffhunk://#diff-175edfeea54490b8fe4e18ffcbea5835efaf8f0b8acf623359073987cae7eb76L48-R55)
[[7]](diffhunk://#diff-e001b7a4b63603b9b14f00de78a4d570bb76c5f57d856a24643f071032e12356L66-R73)
[[8]](diffhunk://#diff-5582954e8a9983988dc8854ad82067fb2ac6269b988e07357ad8db1dfec5f1a0L39-R41)

**Container and utility updates:**

* Refactored the `garray` container implementation and related
constructors/methods to use `[]any` instead of `[]interface{}`, along
with corresponding function signatures.
[[1]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L31-R31)
[[2]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L52-R52)
[[3]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L62-R62)
[[4]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L73-R86)
[[5]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L96-R97)
[[6]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L107-R114)
[[7]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L124-R124)
[[8]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L135-R143)
[[9]](diffhunk://#diff-3a1259e160a4dfa5fe49dfe739fbdb986c0d0a2220a709882ea48d3ae1b8f911L167-R167)

These changes collectively modernize the codebase and prepare it for
future Go developments by using the idiomatic `any` type.
2025-08-28 16:53:19 +08:00
26f20787ba perf(net/gclient): optimize default http.Transport connection pool configuration (#4390) 2025-08-28 15:08:25 +08:00
1371b3bad5 fix: revert #4388 (#4392) 2025-08-28 13:00:08 +08:00
1da73451b9 fix: spacing in min value validation message (#4388)
Fix spacing in min value validation message
2025-08-27 19:05:55 +08:00
94b623e126 fix: update dependencies to version v2.9.1 for various contrib modules and drivers (#4386)
Fixes #4385
2025-08-27 12:21:38 +08:00
4262aa254d chore(deps): Update dependent versions to enhance compatibility and security (#4380)
#4344

---------

Co-authored-by: houseme <housemecn@gmail.com>
2025-08-23 14:53:49 +08:00
8cff64915b fix(tracing): set database span kind to client (#4334)
In [OpenTelemetry
spec](https://opentelemetry.io/docs/specs/semconv/database/database-spans/),
the span kind of database should be `client`.
2025-08-22 22:49:13 +08:00
bec98e8de0 fix(database/gdb): clickhouse can not support int128/int256/uint128/uint256 (#4370)
When use clickhouse and use field type int128/int256/uint128/uint256. It
can not work well and it will return 0 value.
Add the new field types to let it work well.

By the way, the data struct field need be set to big.Int when use the
types.
2025-08-22 22:05:15 +08:00
a6dbf4b7eb feat: upgrade workflow checkout version v5 (#4381)
feat: upgrade workflow checkout version v5

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-22 21:58:00 +08:00
0c2f60468b chore(deps): bump github.com/redis/go-redis/v9 from 9.7.0 to 9.12.1 in /contrib/nosql/redis (#4215)
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis)
from 9.7.0 to 9.7.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/redis/go-redis/releases">github.com/redis/go-redis/v9's
releases</a>.</em></p>
<blockquote>
<h2>v9.7.3</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: handle network error on SETINFO (<a
href="https://redirect.github.com/redis/go-redis/issues/3295">#3295</a>)
(<a
href="https://github.com/redis/go-redis/security/advisories/GHSA-92cp-5422-2mw7">CVE-2025-29923</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/redis/go-redis/compare/v9.7.1...v9.7.3">https://github.com/redis/go-redis/compare/v9.7.1...v9.7.3</a></p>
<h2>v9.7.1</h2>
<h1>Changes</h1>
<ul>
<li>Recognize byte slice for key argument in cluster client hash slot
computation (<a
href="https://redirect.github.com/redis/go-redis/issues/3049">#3049</a>)</li>
<li>fix(search&amp;aggregate):fix error overwrite and typo <a
href="https://redirect.github.com/redis/go-redis/issues/3220">#3220</a>
(<a
href="https://redirect.github.com/redis/go-redis/issues/3224">#3224</a>)</li>
<li>fix: linter configuration (<a
href="https://redirect.github.com/redis/go-redis/issues/3279">#3279</a>)</li>
<li>fix(search): if ft.aggregate use limit when limitoffset is zero (<a
href="https://redirect.github.com/redis/go-redis/issues/3275">#3275</a>)</li>
<li>Reinstate read-only lock on hooks access in dialHook to fix data
race (<a
href="https://redirect.github.com/redis/go-redis/issues/3225">#3225</a>)</li>
<li>fix: flaky ClientKillByFilter test (<a
href="https://redirect.github.com/redis/go-redis/issues/3268">#3268</a>)</li>
<li>chore: fix some comments (<a
href="https://redirect.github.com/redis/go-redis/issues/3226">#3226</a>)</li>
<li>fix(aggregate, search): ft.aggregate bugfixes (<a
href="https://redirect.github.com/redis/go-redis/issues/3263">#3263</a>)</li>
<li>fix: add unstableresp3 to cluster client (<a
href="https://redirect.github.com/redis/go-redis/issues/3266">#3266</a>)</li>
<li>Fix race condition in clusterNodes.Addrs() (<a
href="https://redirect.github.com/redis/go-redis/issues/3219">#3219</a>)</li>
<li>SortByWithCount FTSearchOptions fix (<a
href="https://redirect.github.com/redis/go-redis/issues/3201">#3201</a>)</li>
<li>Eliminate redundant dial mutex causing unbounded connection queue
contention (<a
href="https://redirect.github.com/redis/go-redis/issues/3088">#3088</a>)</li>
<li>Add guidance on unstable RESP3 support for RediSearch commands to
README (<a
href="https://redirect.github.com/redis/go-redis/issues/3177">#3177</a>)</li>
</ul>
<h2>🚀 New Features</h2>
<ul>
<li>Add guidance on unstable RESP3 support for RediSearch commands to
README (<a
href="https://redirect.github.com/redis/go-redis/issues/3177">#3177</a>)</li>
</ul>
<h2>🐛 Bug Fixes</h2>
<ul>
<li>fix(search): if ft.aggregate use limit when limitoffset is zero (<a
href="https://redirect.github.com/redis/go-redis/issues/3275">#3275</a>)</li>
<li>fix: add unstableresp3 to cluster client (<a
href="https://redirect.github.com/redis/go-redis/issues/3266">#3266</a>)</li>
<li>fix(aggregate, search): ft.aggregate bugfixes (<a
href="https://redirect.github.com/redis/go-redis/issues/3263">#3263</a>)</li>
<li>SortByWithCount FTSearchOptions fix (<a
href="https://redirect.github.com/redis/go-redis/issues/3201">#3201</a>)</li>
<li>Recognize byte slice for key argument in cluster client hash slot
computation (<a
href="https://redirect.github.com/redis/go-redis/issues/3049">#3049</a>)</li>
</ul>
<h2>Contributors</h2>
<p>We'd like to thank all the contributors who worked on this
release!</p>
<p><a
href="https://github.com/ofekshenawa"><code>@​ofekshenawa</code></a>, <a
href="https://github.com/Cgol9"><code>@​Cgol9</code></a>, <a
href="https://github.com/LINKIWI"><code>@​LINKIWI</code></a>, <a
href="https://github.com/shawnwgit"><code>@​shawnwgit</code></a>, <a
href="https://github.com/zhuhaicity"><code>@​zhuhaicity</code></a>, <a
href="https://github.com/bitsark"><code>@​bitsark</code></a>, <a
href="https://github.com/vladvildanov"><code>@​vladvildanov</code></a>,
<a href="https://github.com/ndyakov"><code>@​ndyakov</code></a></p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/redis/go-redis/compare/v9.7.0...v9.7.1">https://github.com/redis/go-redis/compare/v9.7.0...v9.7.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a29d91d9ca"><code>a29d91d</code></a>
release 9.7.3, retract 9.7.2 (<a
href="https://redirect.github.com/redis/go-redis/issues/3314">#3314</a>)</li>
<li><a
href="ce3034c7b3"><code>ce3034c</code></a>
bump version to 9.7.2</li>
<li><a
href="0af2b32f93"><code>0af2b32</code></a>
fix: handle network error on SETINFO (<a
href="https://redirect.github.com/redis/go-redis/issues/3295">#3295</a>)
(CVE-2025-29923)</li>
<li><a
href="3d041a1dd6"><code>3d041a1</code></a>
release: 9.7.1 patch (<a
href="https://redirect.github.com/redis/go-redis/issues/3278">#3278</a>)</li>
<li>See full diff in <a
href="https://github.com/redis/go-redis/compare/v9.7.0...v9.7.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/redis/go-redis/v9&package-manager=go_modules&previous-version=9.7.0&new-version=9.7.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/gogf/gf/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-22 17:11:09 +08:00
656ae070da fix(cmd/gf): fix gen sharding dao in multiple shardingPattern tables … (#4379)
fix #4378 
fix #4330

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-22 16:46:23 +08:00
2d5fcd73cb chore: upgrade dependencies to latest versions and fix security vulne… (#4237)
This PR includes the following updates and fixes:

- **Dependency upgrades**: Updated all dependencies in `go.mod` to their
latest versions to ensure compatibility and leverage the latest features
and fixes.
- **Security fixes**:
- Resolved known vulnerabilities in `golang.org/x/net` by upgrading to
the latest secure version.
- Addressed security issues in `golang.org/x/crypto` by upgrading to the
latest secure version.

These changes improve the overall security and stability of the project.
Please review the changes and ensure compatibility with the updated
dependencies.

---------

Co-authored-by: hailaz <739476267@qq.com>
2025-08-22 15:29:16 +08:00
82043856f4 chore(polaris): Bump github.com/polarismesh/polaris-go from v1.5.8 to v1.6.1 (#4241)
- Updated `github.com/polarismesh/polaris-go` dependency to v1.6.1 in
`go.mod`.
- Ensured compatibility with the latest changes in the Polaris Go SDK.
- Verified that all related functionality works as expected after the
upgrade.
- Resolved any potential breaking changes introduced in the new version.

This upgrade includes performance improvements, bug fixes, and new
features provided by the Polaris Go SDK.
2025-08-22 15:07:34 +08:00
7ffdff37e4 chore: upgrade golangci-lint configuration and optimize codebase (#4236)
This PR includes the following changes:

- **Upgrade `.golangci.yml`**: Updated the configuration file to align
with the latest golangci-lint version, ensuring compatibility and
leveraging new features.
- **Refactor GitHub Action workflow**: Modified `golangci-lint.yml` in
the GitHub Actions workflow to reflect the updated configuration and
improve CI performance.
- **Codebase optimization**: Refactored code to address issues and
warnings raised by the updated golangci-lint rules, including:
  - Improved function length and complexity.
  - Enhanced error handling and variable naming conventions.
- Fixed minor issues such as unused imports and formatting
inconsistencies.

These changes aim to maintain code quality, ensure compatibility with
the latest tools, and improve overall maintainability.
2025-08-22 13:29:09 +08:00
613
24083b865d fix(internal/utils): fix +.1 is pass checks numeric (#4374) 2025-08-21 15:44:26 +08:00
8cb64c9f88 fix(cmd/gf): "unknown time zone" when using "gf gen dao" for clickhouse on windows platform (#4368)
fix bug: could not load time location: "unknown time zone Asia/Shanghai"

The bug will appear when I use gf in windows to do "gf gen dao" for
clickhouse.
2025-08-15 13:35:59 +08:00
5fa656d1cc fix(os/gtime): add handling for nil time pointers to avoid causing panic (#4323)
from https://github.com/gogf/gf/pull/4322
Fixes https://github.com/gogf/gf/issues/4307
2025-06-24 15:53:47 +08:00
09ec90746a chore: bump golang.org/x/tools to v0.34.0 for Go 1.25 compatibility (#4313)
chore: bump golang.org/x/tools to v0.34.0 for Go 1.25 compatibility

```
   # golang.org/x/tools/internal/tokeninternal
  /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/golang.org/x/tools@v0.21.1-0.20240508182429-e35e4ccd0d2d/internal/tokeninternal/tokeninternal.go:64:9: invalid array length -delta * delta (constant -256 of type int64)
```

relates to https://github.com/Homebrew/homebrew-core/pull/226636
2025-06-20 21:21:03 +08:00
c0d1e44526 fix(database/gdb): support multiple order fields in gdb_model_with and merged #4272 fix scanning functionality for deep slice types (#4320)
Fix:#4311
Merged: #4272
2025-06-20 21:09:41 +08:00
b323862b4c Merge pull request #1 from fainc/master
Update util/gconv/gconv_z_unit_scan_test.go
2025-06-20 19:23:04 +08:00
3d9cdb8997 fix(gdb): support multiple order fields in "with" 2025-06-20 19:11:01 +08:00
7180d895ea Update util/gconv/gconv_z_unit_scan_test.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-20 18:17:40 +08:00
afb1595fbe Merge branch 'gogf:master' into master 2025-06-20 18:07:15 +08:00
6637add9ca fix(net/ghttp): improve GetMetaTag method to handle nil and type checks (#4284)
修复没有做handler参数数量判断导致可能出现的数组越界问题
2025-06-19 09:43:24 +08:00
bc862cf97b chore: bump golang.org/x/tools to v0.34.0 for Go 1.25 compatibility
Signed-off-by: Rui Chen <rui@chenrui.dev>
2025-06-14 13:34:25 -04:00
9033ca087b fix(net/ghttp): improve GetMetaTag method to handle nil and type checks 2025-05-16 17:55:00 +08:00
b985fd978c Merge branch 'master' into master 2025-05-07 20:02:12 +08:00
88c4471500 fix(ci): change base image from expired ubuntu-22.04 to ubuntu-latest (#4273) 2025-05-07 19:06:00 +08:00
b73e2047db fix(gconv): fix scanning functionality for deep slice types 2025-05-06 13:37:45 +08:00
1534abdb05 feat(util/gpage): marked deprecated (#4230) 2025-04-02 19:56:28 +08:00
fee38b4531 feat(net/ghttp): enhance GetHeader method to support default values (#4210) 2025-03-25 20:42:30 +08:00
69e3362d0d feat: new version v2.9.0 (#4204) 2025-03-17 15:52:26 +08:00
9a61a6970f fix(database/gdb): fix transaction propagation feature (#4199) 2025-03-17 14:50:07 +08:00
abf77fac50 fix(cmd/gf): invalid binary suffix after installing binary using custom renamed file name that has suffix with . character (#4207) 2025-03-17 13:48:54 +08:00
07696fc779 feat(net/ghttp): add GetMetaTag function to retrieve metadata value for HandlerItem (#4206) 2025-03-17 09:21:00 +08:00
bc1e1019c5 refract(util/gconv): change Converter interface definition for more convenient usage (#4202) 2025-03-14 18:23:07 +08:00
bb696bb281 refract(net/ghttp): move Request.GetMetaTag to HandlerItemParsed.GetMetaTag (#4191) 2025-03-12 21:55:35 +08:00
029f324c5c feat: version v2.9.0-beta (#4189) 2025-03-09 22:31:20 +08:00
f8331bad6e feat(net/ghttp): add Request.GetMetaTag to retrieve specific meta tag value (#4185) 2025-03-09 11:17:41 +08:00
bcda48bf82 fix(net/ghttp):check parameter existence to determine using default or front-end value. (#4182) 2025-03-08 20:56:27 +08:00
a8a055f122 fix(util/gvalid): lots of memory consumed when required validation on big binary field (#4097) 2025-03-07 13:52:12 +08:00
dfe088f5cd refactor(util/gconv): add Converter feature for more flexable and extensible type converting (#4107) 2025-03-06 23:04:26 +08:00
f4074cd815 fix(net/gclient): remove default discovery for gclient when Discovery feature enabled (#4174) 2025-03-03 16:43:21 +08:00
4a65e7a629 feat: v2.9.0 (#4057) 2025-02-27 15:53:19 +08:00
ac653d3dee Merge branch 'master' into feat/v2.9.0 2025-02-27 14:36:05 +08:00
2d3ab4f9fb feat: add submodule examples (#4137) 2025-02-27 14:35:00 +08:00
bda42d18ee feat(cmd/gf): add controller comment support for command gf gen ctrl (#4169) 2025-02-27 14:21:40 +08:00
63cb3285f8 fix(net/ghttp): update response message handling in MiddlewareHandlerResponse (#4162) 2025-02-27 11:59:26 +08:00
2fa03556ef chore(util/gvalid): using 64 instead of 10 bitsize parameter for function strconv.ParseFloat although it treats 10 as 64 internally (#4154) 2025-02-20 16:32:01 +08:00
01593ad8b6 fix(ci): golangci-lint failed after upgrading go version to 1.24 (#4158) 2025-02-14 22:24:18 +08:00
42d8845d35 feat(cmd/gf): add gopackage option for command gf gen pbentity to specify go_package for generated proto files (#4141) 2025-02-14 13:39:13 +08:00
1ef1c442d3 test(os/gproc): add unit test for os/gproc (#4140) 2025-02-14 13:36:17 +08:00
7d3b055d3e fix(net/ghttp): MakeBodyRepeatableRead takes not effective when called after ParseForm (#4143) 2025-02-11 18:02:26 +08:00
a3b3c656d9 feat(database/gdb): enable transaction propagation when using tx.GetCtx() after Begin (#4121) 2025-02-11 16:09:27 +08:00
0eb229a887 feat(os/glog): add default time format 2006-01-02T15:04:05.000Z07:00 (#4134) 2025-02-11 15:59:27 +08:00
20b1987828 feat(test/gtest): add map type support for AssertNI/AssertIN (#4135) 2025-01-23 17:58:32 +08:00
e12768207e feat(cmd/gf): beautify progress bar of cli binary downloading for command gf up (#4094) 2025-01-22 19:22:36 +08:00
f9c7eae23b fix(net/ghttp): remove unused code snippet (#4131) 2025-01-22 19:22:02 +08:00
1f8845291a fix(contrib/config/polaris): it only supports json format for configuration contents, add more content formats support (#4126) 2025-01-22 19:20:21 +08:00
6bd15b0796 merge master 2025-01-22 19:17:16 +08:00
99f0fb14a1 fix(net/ghttp): BufferWriter.Flush writes additional information after custom response wrote (#4116) 2025-01-22 09:28:06 +08:00
e0f734851e fix(net/ghttp): MiddlewareHandlerResponse writes additional information after custom response wrote (#4109) 2025-01-14 09:28:19 +08:00
3f24b4da2e feat(os/gcmd): add default value display for an argument (#4083) 2025-01-13 09:26:59 +08:00
fc9093a1aa feat(cmd/gf): add ShardingPattern option for command gf gen dao to support generating dao files sharding tables (#4081) 2024-12-26 23:21:03 +08:00
Gin
f66e09717c feat(contrib/metric/otelmetric): add metrics option WithExemplarFilter support (#4061) 2024-12-26 18:30:21 +08:00
80f57d1c24 fix(database/gdb): gdb.Counter not work in OnDuplicate (#4073) 2024-12-26 18:18:35 +08:00
9ce2409659 fix(util/gpage): html.EscapeString for pagination HTML generation and URL parsing (#4079) 2024-12-26 16:21:30 +08:00
6ea1526b75 fix(ci/golangci): fix golangcl-lint git push and apply format code on Push (#4077) 2024-12-26 10:19:01 +08:00
89e5285d95 feat(net/ghttp): move plugin remove logic to Shutdown() && call Shutdown() when Run() exits (#4072) 2024-12-26 10:18:47 +08:00
e6bee78be4 Apply gci import order changes 2024-12-26 02:18:19 +00:00
96e833db6e feat(gf/gen/pbentity): add a TablesEx configuration to exclude the specified table names (#4060) 2024-12-26 10:17:51 +08:00
3a19ee9268 fix: securiry update CVE-2024-45338 for package golang.org/x/net (#4070) 2024-12-25 21:43:55 +08:00
594979c5af fix(net/ghttp): nil pointer panic error when server logger set nil (#4055) 2024-12-19 22:31:17 +08:00
4c2a78b7bf fix(database/gdb): regular expression pattern for link configuration to be compitable with tidbcloud (#4064) 2024-12-19 21:44:36 +08:00
817ac36ce2 ci: use latest go version for unit testing cases of contribution components (#4062) 2024-12-19 10:11:55 +08:00
2c1fcec88c Merge branch 'feat/v2.9.0' of github.com:gogf/gf into feat/v2.9.0 2024-12-18 20:48:05 +08:00
92eab81926 fix(database/gdb): add compatibility for old configiration with both Type and part of Link configurations (#4058) 2024-12-18 15:54:27 +08:00
a5c8b966e2 feat(util/gconv): add basic types conversion support for function Scan (#3991) 2024-12-18 10:41:09 +08:00
233295be07 fix(os/gview): search file faild from resource manager of package gres (#4024) 2024-12-18 10:39:01 +08:00
67a9db9e3e perf(contrib/drivers/pgsql): improve conversion performace for slice string (#4046) 2024-12-17 21:45:38 +08:00
e7fdf82dd8 test(net/gipv4): add unit tests (#4052) 2024-12-17 21:17:27 +08:00
f79aef6669 fix(database/gdb): fix context canceled error in transaction due to usage of TransTimeout configuration (#4037) 2024-12-17 21:15:54 +08:00
0c2d5cac19 feat: new version v2.8.3 (#4048) 2024-12-17 09:24:13 +08:00
5104f01b69 chore: update FUNDING.yml (#4049) 2024-12-17 09:23:59 +08:00
a09454accf feat(contrib/drivers/mssql): enable unit testing (#4043) 2024-12-16 11:17:47 +08:00
ac53170884 feat(contrib/registry/etcd): add retry machenism when keepalive lease expires (#4035) 2024-12-13 11:09:07 +08:00
e3e82c7351 feat(contrib/config/nacos): add OnChange callbacks configuration support (#4038) 2024-12-13 09:57:28 +08:00
ced4b57991 fix(contrib/drivers/pgsql): incompatible placeholder replacement with old version (#4036) 2024-12-13 09:29:34 +08:00
5af342adc3 fix(net/ghttp): json omitempty takes no effect in BuildParams, which is not compatible with old version (#4041) 2024-12-13 09:29:19 +08:00
5c45d3533f fix(ci/golangci): fix golangcl-lint git push (#4032) 2024-12-11 15:42:36 +08:00
d748fb6564 fix(contrib/registry/consul): update dependence of gf to v2.8.2 with relative path specified (#4029) 2024-12-11 10:28:29 +08:00
00e2f6b5dc chore: improve golangci-lint.yml, upgrade dependencies, and optimize code and comments (#4025) 2024-12-11 10:14:12 +08:00
b7c74c9a35 fix(contrib/drivers/pgsql): add unix socket connection support (#4028) 2024-12-11 09:58:26 +08:00
69969b1723 fix(contrib/registry/etcd): remove default configuration of AutoSyncInterval (#4027) 2024-12-10 20:59:44 +08:00
38bffc77e2 fix(net/ghttp): occasional ci failed by unit testing cases using gctp.GetFreePort (#3982) 2024-12-10 09:52:48 +08:00
2e788be1d3 feat(contrib/registry/consul): add consul registry support (#4016) 2024-12-09 23:12:29 +08:00
13bc192e36 feat(database/gdb): add sharding feature for schema and table (#4014) 2024-12-09 23:12:20 +08:00
bae78fbf5b feat(net/ghttp): add middleware MiddlewareGzip for compressing response content using gzip (#4008) 2024-12-09 23:12:09 +08:00
80e73da416 feat(errors/gerror): add As support (#4002) 2024-12-09 23:11:56 +08:00
5e47590165 feat(database/gdb): add WhereExists/WhereNotExists (#4015) 2024-12-09 09:24:48 +08:00
3cffa4d5d6 fix(database/gdb): CRUD typos (#4017) 2024-12-09 09:22:52 +08:00
e18331aa2c docs(cmd/gen): improve comments for command gen dao (#4007) 2024-12-07 14:19:36 +08:00
b0b84a3937 ci(gci/import): improve golangci.yml and add gci linter (#4010) 2024-12-07 14:17:33 +08:00
2066aa4803 feat(database/gdb): add transaction propagation&isolation level&readonly features (#4013) 2024-12-07 14:01:31 +08:00
b8142bf1fc feat(os/gsession): add RegenerateId/MustRegenerateId support (#4012) 2024-12-06 14:16:03 +08:00
ba968949f7 fix(database/gdb): orm tag from embedded struct is missing in with feature (#4011) 2024-12-05 22:02:47 +08:00
c9b0237fc7 feat: version v2.8.2 (#4009) 2024-12-05 20:21:19 +08:00
4ad061faff feat(contrib/drivers/pgsql): add array type varchar[] and text[] converting to Go []string support (#4000) 2024-12-05 15:50:59 +08:00
5fa33411fc chore: add example for openapi/swagger authentication (#4004) 2024-12-05 15:49:50 +08:00
c0f2ef7348 feat(gctx): rename and remove gctx functions to prevent ambiguity (#3892) 2024-12-05 14:47:39 +08:00
77cb7fb412 test(drivers/mssql): add unit testing cases of transaction (#3818) 2024-12-05 14:44:40 +08:00
7cd672d22c feat(cmd/gf): add interface functions generating for embedded struct of logic struct in command gen service (#3802) 2024-12-05 14:44:21 +08:00
e2cafa35e0 fix(cmd/gf): custom tags repeatedly added using command gf gen pb with -a option (#3966) 2024-12-05 14:42:30 +08:00
532e665841 fix(database/gdb): move Raw parameter from args to sql statement before committed to db driver (#3997) 2024-12-03 15:24:49 +08:00
2d0cd7b770 refactor(cmd/gf): change default src value to api, path to internal/packed/packed_enums.go for command gen enums (#3996) 2024-12-02 21:39:04 +08:00
2c916f8222 fix(database/gdb): issue where the Count/Value/Array query logic was incompatible with the old version when users extended the returned result fields using the Select Hook (#3995) 2024-12-01 23:47:51 +08:00
42eae41599 fix(util/gutil): code scanning alert no. 17: Potentially unsafe quoting (#3993) 2024-12-01 23:44:48 +08:00
5aa7504bb2 fix(util/gpage): code scanning alert no. 9: Potentially unsafe quoting (#3992) 2024-12-01 23:43:44 +08:00
ec6e091882 chore: fix some function names in comment (#3967) 2024-12-01 11:29:09 +08:00
c1850d4ab5 feat(net/goai): support OpenAPIv3.1 in description field for schema object (#3978) 2024-12-01 11:27:35 +08:00
9923975b1c feat(net/gipv4): add enhanced the conversion between uint32 and string (#3988) 2024-12-01 10:16:03 +08:00
e572ed01b3 fix(net/ghttp): get origin through referer (#3990) 2024-12-01 10:05:46 +08:00
16d73b5bdf fix(utils/gvalid): missing pkg path for enums pointer (#3983) 2024-11-29 18:25:13 +08:00
5521d768ff feat(cmd/gf): add typeMapping and fieldMapping feature support for command gf gen genpbentity (#3970) 2024-11-27 21:09:42 +08:00
81aed06643 feat: README updates (#3974) 2024-11-27 21:03:31 +08:00
455830b842 test(database/gdb): add more unit testing cases for Raw feature (#3962) 2024-11-23 18:35:02 +08:00
e56371e7c9 fix(cmd/gf): incorrect environment variables printing before cli does some environment changes (#3961) 2024-11-23 17:54:20 +08:00
eb8024913d feat(net/goai): add min, max, length, min-length, max-length and between support for OpenAPIv3 (#3914) 2024-11-23 15:38:52 +08:00
ee3eb8d48c fix(net/goai): embedded struct with tags also expand as properties of the parent struct (#3956) 2024-11-23 15:38:14 +08:00
15f94975db feat(net/goai): add enhanced response status interface (#3896) 2024-11-23 15:37:46 +08:00
3797d0eee4 feat: new version v2.8.1 (#3950) 2024-11-21 20:51:46 +08:00
e9ce1bde87 fix(database/gdb): incompatitable statement like Order("id", "dasc") (#3949) 2024-11-21 15:08:29 +08:00
9c8b21af7b fix(cmd/gf): incorrect make command in project template (#3946) 2024-11-20 21:47:32 +08:00
90851881cc fix(registry/zookeeper): watch service name path error with extra suffix - (#3948) 2024-11-20 20:39:05 +08:00
3090fe7f4e fix(database/gdb): recognize tinyint(1)/int(1) as bool (#3943) 2024-11-20 20:21:33 +08:00
0d1aed0741 fix(os/gcache): function Remove returns value not *gvar.Var as previous version (#3936) 2024-11-19 23:30:29 +08:00
910703ec3a chore(database/gdb): comment update for function Model.Order (#3933) 2024-11-18 18:33:59 +08:00
ec6c537def feat(cmd/gf): project template updates for command gf init (#3928) 2024-11-17 10:57:17 +08:00
bcfcda793c chore(errors/gerror): add examples (#3927) 2024-11-16 18:14:40 +08:00
138dea0f3a feat(cmd/gf): change document source from repo gf to gf-site (#3926) 2024-11-15 14:33:23 +08:00
3d4904eb3d feat(net/ghttp): remove Req/Res suffix limitation for input/output parameters of strict router handler (#3848) 2024-11-14 17:58:39 +08:00
955a76cf35 feat: new version v2.8.0 (#3924) 2024-11-14 13:26:23 +08:00
ffa6081471 fix(util/gconv): fix missing minus in string to int64 conversion (#3920) 2024-11-13 23:25:24 +08:00
6baf4338b0 fix(database/gdb): recognize field type tinyint(1) to golang type bool (#3921) 2024-11-13 23:09:01 +08:00
8c6db247b2 chore: readme updates (#3919) 2024-11-13 20:48:02 +08:00
fff2f8a24c build: downgrade fsnotify from v1.8.0 to v1.7.0 to solve data race error (#3916) 2024-11-13 12:22:23 +08:00
475e8bbae0 chore: README.md updates (#3912) 2024-11-12 21:30:46 +08:00
070efecc6e style(gtest/test): improve code (#3891) 2024-11-12 20:20:13 +08:00
a63af5d5f8 build: upgrade fsnotify from v1.7.0 to v1.8.0 to solve occasional ci failure (#3910) 2024-11-12 10:25:39 +08:00
bd2e8408e8 chore: update README.MD (#3911) 2024-11-12 09:25:37 +08:00
6c6fd7902a feat(database/gdb): remove unnecessary blank character requirement in tag for With feature of gdb.Model (#3875) 2024-11-11 21:59:26 +08:00
1b7b536d6c fix(cmd/gf): protoc file comments contain backticks and double quotes, resulting in syntax errors in the generated file of go (#3890) 2024-11-11 21:37:30 +08:00
9cc1cf1b53 fix(cmd/gf): remove dir after process done if given build file parameter is not a file but a dir name (#3908) 2024-11-11 21:32:58 +08:00
76948d93d6 test(drivers/mysql): use asserts function to replace if statement (#3849) 2024-11-11 20:54:57 +08:00
5ba165a3c0 fix(cmd/gf): go back current working directory after gf gen pb (#3895) 2024-11-11 20:42:25 +08:00
f4db846633 fix(contrib/drivers/pgsql): connection fails when postgres database password is empty (#3900) 2024-11-11 20:27:07 +08:00
e7cc2c3d9c chore: update the contributors in README.MD (#3907) 2024-11-06 22:11:23 +08:00
01cd0103e4 fix(net/gclient): Client Clone with allocated header/cookie (#3902) 2024-11-06 22:09:28 +08:00
d1872f17f7 fix(util/gconv): assigned the same value to struct field and its same name field in embedded struct failed (#3905) 2024-11-06 21:12:01 +08:00
e4c4fb591e feat(database/gdb): add Exist support for checking records existance for certain condition (#3854) 2024-10-24 15:29:03 +08:00
656668f444 feat: new version v2.8.0-beta (#3878) 2024-10-24 14:51:03 +08:00
555bb3fa6b feat(net/goai): enhance openapi doc with responses and examples (#3859) 2024-10-21 21:16:45 +08:00
e179e1d4fe fix(database/gdb): unix socket connection support for mysql (#3872) 2024-10-21 09:22:53 +08:00
7dd38a1700 feat(database/gdb): add Raw support for Fields function of gdb.Model (#3873) 2024-10-21 09:22:31 +08:00
b1d875a31f fix(util/gconv): incorrect fuzzy converting logic (#3874) 2024-10-21 09:16:50 +08:00
c18339b1a9 feat(contrib/drivers/pgsql): add InsertIgnore support (#3855) 2024-10-16 07:32:33 +08:00
5288b70567 fix(util/gconv): one parameter to same tag in multiple struct attributes mapping failed (#3822) 2024-10-14 21:34:39 +08:00
4b5f637651 feat(trace): add trace for Custom trace client and provider (#3847) 2024-10-14 21:30:27 +08:00
e3e5c89ba7 fix(os/gcmd): cannot retrieve all args if no subcommand defined for a root command (#3850) 2024-10-10 09:17:34 +08:00
4d29939f87 fix(net/goai): cannot customize OpenAPIv3 type for request parameters (#3845) 2024-10-09 13:15:46 +08:00
ae3ae8b177 test(cmd/gf): add unit testing case generating dao/do/entity files for sqlite in command gen dao (#3808) 2024-10-08 22:06:07 +08:00
7a6889817f feat(encoding/ghtml): add parameter validation for function SpecialCharsMapOrStruct (#3841) 2024-10-08 20:46:06 +08:00
a72a9ff13e fix(container/gtree): deadlock in Map/MapStrAny functions, comments update (#3840) 2024-10-08 20:45:23 +08:00
91884e7c93 fix(database/gdb): remove support of Array/Value/Count operations for result that has multiple record fields (#3839) 2024-10-08 20:42:06 +08:00
7cbc9e8533 test(os/gcache): fix unit testing occasionally failed due to too short expration duration set (#3842) 2024-10-08 13:06:11 +08:00
2301de6e8c fix(util/gutil): invalid empty parameter value check for function GetOrDefaultAny (#3844) 2024-10-08 13:05:59 +08:00
183395f0a0 fix(cmd/gf): gen service error when there's version number at the end of package import path (#3836) 2024-10-05 12:25:43 +08:00
d4fa2c82bf feat(contrib/rpc/grpcx): use grpc.NewClient instead of grpc.Dial (#3684) 2024-09-30 20:41:14 +08:00
459c8ce84e feat(os/gfsnotify): add recursive watching for created subfolders and sub-files under folders that already watched (#3830) 2024-09-30 11:24:27 +08:00
38622f966f refactor(contrib/trace/jaeger): remove trace jaeger, please use the OpenTelemetry SDKs(otlphttp&otlpgrpc) (#3825) 2024-09-29 20:31:16 +08:00
499f755d3a build(deps): bump google.golang.org/grpc from 1.51.0 to 1.56.3 in /contrib/config/polaris (#3831) 2024-09-29 17:06:02 +08:00
3f1439ac4c build(deps): bump google.golang.org/grpc from 1.51.0 to 1.56.3 in /contrib/registry/polaris (#3828) 2024-09-29 15:48:28 +08:00
0ca2ed5979 chore(contrib/config/polaris): upgrade dependent polaris library version to v1.5.8 and go version to v1.21 (#3827) 2024-09-29 11:08:07 +08:00
ee5284a1b2 chore(contrib/registry/polaris): upgrade dependent polaris library version to v1.5.8 and go version v1.21 (#3826) 2024-09-29 10:59:48 +08:00
8e7f1180c4 fix(contrib/drivers/mssql): fix mssql paging sql generate statement error (#3782) 2024-09-29 10:18:34 +08:00
3abb9477c4 ci: fix mssql docker service starting failed (#3824) 2024-09-28 21:46:23 +08:00
ab3fbddfc7 build(go.mod): upgrade minimum required go version from 1.18 to 1.20 (#3688) 2024-09-28 20:58:04 +08:00
55b92151f4 refactor(net/ghttp): enhance ghttp.StartPProfServer (#3555) 2024-09-28 18:10:53 +08:00
9589384b36 refactor(encoding/gjson): change data parameter from type any to []byte (#3542) 2024-09-28 18:10:00 +08:00
cf742233e8 refactor(net/gudp): improve implements (#3491) 2024-09-28 18:08:46 +08:00
1c97b7a982 fix(os/gcache): memory leak for LRU when adding operations more faster than deleting (#3823) 2024-09-28 18:07:11 +08:00
ea09457d84 fix(os/gcmd): argument index calculating error in multilevel command (#3807) 2024-09-28 18:02:34 +08:00
66ee52c96a fix(database/gdb): invalid order by statement generated when multiple order inputs (#3803) 2024-09-28 12:06:22 +08:00
f45f64897a fix(cmd/gf): creating logic.go empty folder when there is no correct logic service (#3815) 2024-09-28 11:28:06 +08:00
8708dc7940 test(drivers/mysql): loose unit testing for transaction (#3819) 2024-09-28 11:19:14 +08:00
79451e4624 fix(net/ghttp&gclient,contrib/rpc/grpcx): remove request and response contents in opentelemetry tracing attributes (#3810) 2024-09-26 09:50:07 +08:00
a716c6bfab feat: new version v2.7.4 (#3809) 2024-09-25 19:53:23 +08:00
5aa321dbde fix(util/gconv): unstable converting when there is an external attribute with the same name as the internal structure (#3799) 2024-09-25 19:22:15 +08:00
3f2b1cb329 feat(database/gdb): add year field type support for ORM operations (#3805) 2024-09-25 16:33:52 +08:00
ab2c3b02ac fix(cmd/gf): table and field names converted to its lower case before CamelCase converting in command gen dao (#3801) 2024-09-25 10:59:00 +08:00
76783fd72b fix(net/gclient): panic when containing @file: parameter value in json post request (#3775) 2024-09-25 10:37:32 +08:00
fsl
a1ce97ec9b feat(contrib/registry/etcd/): add DialTimeout and AutoSyncInterval option (#3698) 2024-09-24 17:01:10 +08:00
c13004e230 fix(database/gdb): support OrderRandom feature in different databases (#3794) 2024-09-24 11:58:34 +08:00
9af8393758 fix(net/goai): change default value of RequestBody.Required from true to false, add required tag support for RequestBody (#3796) 2024-09-24 11:51:53 +08:00
e15b543a5b fix(util/gvalid): retrive empty slice parameter in custom validation rule function failed (#3795) 2024-09-23 19:59:48 +08:00
8a1c97f518 fix(util/gconv): cached field indexes append issue caused incorrect field converting (#3790) 2024-09-23 19:05:32 +08:00
d8e3e9d713 fix(utils/utils_str): recognize '+' as a valid numeric sign (#3778) 2024-09-23 16:45:55 +08:00
777c2e7117 ci: fix mssql docker service failed in ci (#3792) 2024-09-23 11:50:48 +08:00
c4327f62e7 fix(net/ghttp): server shutdown not graceful using admin api /debug/admin/shutdown (#3777) 2024-09-19 14:10:16 +08:00
fd33dcb97b ci: add go version 1.23 support (#3733) 2024-09-19 10:38:20 +08:00
d8b06d056e fix(os/gcache): a little memory leak for removed timestamp key (#3779) 2024-09-14 11:05:47 +08:00
e186eab1a5 fix(debug/gdebug): incorrect package name handling in function CallerPackage (#3771) 2024-09-13 16:51:39 +08:00
6a99931798 fix(database/gdb): #3755 error parsing database link without port number (#3772) 2024-09-13 16:50:59 +08:00
4ee5bf5c45 fix(database/gdb): #3754 FieldsEx feature conflicts with soft time feature in soft time fields updating (#3773) 2024-09-13 16:50:38 +08:00
e4669387b5 fix(encoding/gxml): XML special character encoding error (#3740) 2024-09-13 10:37:15 +08:00
0e471eab38 fix(util/gconv): #3764 fix bool converting issue (#3765) 2024-09-12 21:59:38 +08:00
3d63ebfe81 fix(net/ghttp): skip common response body in common response handler for streaming content types (#3762) 2024-09-12 17:50:43 +08:00
9b318bb57f perf(database/gdb): performance improvement for struct scanning when with feature disabled (#3677) 2024-09-12 15:38:18 +08:00
6b3fb607cf fix(net/goai): fix openapi miss required tag of BizRequest when set CommonRequest (#3724) 2024-09-10 18:00:21 +08:00
bb9a3b83eb feat(database/gdb): add time field type for value converting for/from field (#3712) 2024-09-10 17:51:22 +08:00
baea1c7a7a feat: version v2.7.3 (#3763) 2024-09-09 16:39:02 +08:00
1b4ebc0812 perf(util/gconv): add cache logic to enhance performance (#3673) 2024-09-09 16:17:01 +08:00
803cb5a0bc fix(contrib/drivers/pgsql): fix insert error when data struct field has nil in PgSQL (#3679) 2024-09-09 16:16:20 +08:00
448df14860 fix(util/gconv): #3731 map type name mismatch in switch case statement (#3732) 2024-09-09 14:54:40 +08:00
467a5c1093 fix(contrib/drivers/pgsql): #3671 fix invalid pgsql insert json type (#3742) 2024-09-09 14:32:14 +08:00
26d2a98fb1 refactor(nacos-registry): use official nacos sdk instead of the third-party nacos sdk (#3745) 2024-09-09 14:27:21 +08:00
6e5ce98d23 fix(database/gdb): fix #3649 when constructing query param, gdb.Row value not directly write to Buffer (#3718) 2024-08-14 21:16:17 +08:00
a6c361dcf7 fix(os/gtime): fix gtime.Value() when time only, add time only example (#3714) 2024-08-14 21:00:39 +08:00
dc8bb809a8 fix(contrib/registry/file/v2): fix the panic caused by channel closing after resolver closed (#3691) 2024-08-14 20:44:05 +08:00
9143b26182 fix(contrib/nosql/redis): missing err nil check in function ScriptExists (#3713) 2024-07-29 20:32:59 +08:00
fsl
cd2d51ea30 build: bump google.golang.org/protobuf to v1.33.0 (#3697) 2024-07-24 19:27:28 +08:00
fsl
144ad5f263 ci: add Scorecard workflow (#3702) 2024-07-24 19:24:14 +08:00
4fdafa4517 feat(cmd/gf): project templates update for command gf init (#3704) 2024-07-24 19:15:54 +08:00
ba322ba0ac fix(cmd/gf): fix command gf up with -u option upgrading packages indirectly required would fail with higher version of go required (#3687) 2024-07-17 20:21:26 +08:00
559ae0e77e chore(.github/template): update document for github pull requests (#3666) 2024-07-02 20:56:20 +08:00
3e54839aa8 refractor(container/gtree): refactor code with gods package for rbtree (#3655) 2024-07-02 20:36:43 +08:00
2565bb3d07 refractor(container/gtree): improve function order of btree (#3656) 2024-07-02 20:35:53 +08:00
54423b6d84 refractor(container/gtree): refactor code with gods package for avltree (#3647) 2024-07-01 20:37:11 +08:00
c3cfc01cf6 refactor(container/gring): mark deprecated, package container/gring will not be maintained in future (#3665) 2024-06-27 21:12:51 +08:00
31a6ae2a19 fix(cmd/gf): remove dm driver for command gen dao as it causes building failed for some platforms (#3667) 2024-06-27 21:12:06 +08:00
b11caba5b0 version v2.7.2 (#3663) 2024-06-26 10:08:04 +08:00
8824b8b0fe os/gcron: add graceful shutdown support (#3625) 2024-06-25 21:13:51 +08:00
f8272bc5f4 database/gdb: remove duplicated SQL records in tracing events (#3659) 2024-06-25 21:11:36 +08:00
e8a2629b19 net/goai: fix: #3660, support multiple file upload parameters for OpenAPIv3 (#3662) 2024-06-25 21:01:58 +08:00
dba6c08548 net/ghttp: fix Content-Type for jsonp response from application/json to application/javascript (#3651) 2024-06-24 21:37:49 +08:00
7d464d4de2 net/ghttp: fix args issue for forkRestartProcess in graceful restarting of ghttp.Server (#3661) 2024-06-24 20:53:37 +08:00
4abb32e11b contrib/drivers/pgsql: support slice type to insert into array for pgsql (#3645) 2024-06-18 19:36:07 +08:00
74d0945fa1 gerror: fix #3633 Is performs the same as errors.Is from go stdlib (#3640) 2024-06-13 21:55:32 +08:00
ffbe9a7197 container/gtree: refactor code with gods package (#3595) 2024-06-13 21:26:53 +08:00
fba878f47a net/ghttp: update error message for duplicated routes registering (#3603) 2024-06-13 21:16:11 +08:00
88f188d0f9 cmd/gf: use automatic generating package names for go files of dao/do/entity instead of constant package names (#3639) 2024-06-13 21:13:05 +08:00
2ccbb02c71 fix: #3613 ignore automatic handling for creating/updating time if it has been specified (#3615) 2024-06-12 21:41:44 +08:00
01408f1a87 cmd/gf: delete binary file when gf run end process (#3628) 2024-06-12 21:32:24 +08:00
dea0ffcfb3 cmd/gf: add command gf doc (#3634) 2024-06-12 21:29:56 +08:00
d5825ab51c drivers/pgsql:pgsql returning id should use quotation marks,when primary key is capital (#3638) 2024-06-12 21:22:39 +08:00
753965b9a9 example: password encrypt-decrypt for database using custom implement driver (#3610) 2024-06-04 22:04:36 +08:00
ee211dbdac cmd/gf: improve gf gen ctrl using ast (#3616) 2024-06-04 21:13:23 +08:00
4d916ae73e os/gres: fix #3611 add custom prefix / support for resource packing (#3621) 2024-06-04 20:38:59 +08:00
59a775aad4 util/gvalid: add 171 number support for virtual phone number validation (#3622) 2024-06-04 20:36:28 +08:00
e3a00d7f56 cmd/gf: fix missing configuration file support for cli command pack/run/tpl/up (#3629) 2024-06-04 19:59:05 +08:00
bd8d046b83 cmd/gf: add DaMeng database driver support (#3606) 2024-05-30 21:20:46 +08:00
57583a98bc .github/workflows: remove code coverage report for folder example (#3608) 2024-05-30 21:05:35 +08:00
f8175e7113 drivers/mssql: change driver from github.com/denisenkom/go-mssqldb to github.com/microsoft/go-mssqldb (#3612) 2024-05-30 20:58:51 +08:00
6b84a37794 .github/workflows: fix warning info from node16 on timezone setting (#3614) 2024-05-30 20:55:06 +08:00
457f7abcf5 contrib/drivers: add README.zh_CN.MD (#3604) 2024-05-27 21:02:02 +08:00
9e9e42b45c cmd/gf: test gen ctrl comments (#3575) 2024-05-27 20:42:26 +08:00
8f4d5f7d74 cmd/gf: refactor gf gen service with AST (#3488) 2024-05-27 20:41:05 +08:00
b675d01418 database/gdb: add unscoped tag support for orm struct (#3464) 2024-05-22 21:52:21 +08:00
17385eeaef database/gdb: fix confusing error message in Insert/Update operations when table not exist or the table contains no fields (#3553) 2024-05-22 21:26:53 +08:00
23df83cb0b database/gdb: fix deadlock when orm operations perform in cache function from gcache (#3585) 2024-05-22 21:14:43 +08:00
2e471662f4 os/gcfg: fix file searching issue always returning the configuration file of pwd (#3592) 2024-05-22 21:14:16 +08:00
1e8f4287af contrib/registry/zookeeper: fix invalid searching prefix (#3598) 2024-05-22 21:12:21 +08:00
21c83670d6 os/gtime: fixed gtime ci fail (#3596) 2024-05-22 20:45:39 +08:00
1b23bf495a container/gmap&gset: fix deadlock when removing values during iterating (#3572) 2024-05-21 22:07:28 +08:00
15b60462a2 driver/pgsql: optimize regex for version matching (#3583) 2024-05-21 21:51:43 +08:00
1455440efa os/gcfg: fix gcfg adaptfile dogetfilepath (#3587) 2024-05-20 20:23:38 +08:00
737da954a0 util/gconv: remove unnecessary logic for function doScanList (#3588) 2024-05-20 19:42:51 +08:00
a9a0785252 util/gconv: refactor code unit testing (#3591) 2024-05-20 19:40:30 +08:00
d5561aa323 cmd/gf: add gf init app/mono-app -a (#3550) 2024-05-15 20:25:43 +08:00
cf37731d5f version: v2.7.1 (#3573) 2024-05-14 21:20:22 +08:00
0765741d99 os/gtime: fix #3558 time zone issues (#3561) 2024-05-10 17:44:45 +08:00
74338c498e ci: fix code coverage not sync to CodeCov (#3570) 2024-05-10 17:44:01 +08:00
ff28d88572 cmd/gf: fix gen enums failed in go version v1.22.1 (#3565) 2024-05-07 20:40:35 +08:00
94c7185826 util/gvalid: fix slice enums verification failed (#3566) 2024-05-07 20:36:55 +08:00
8e075fba53 contrib/sdk/httpclient: add custom response handler support, fixe #3539 (#3540) 2024-04-29 20:37:25 +08:00
3b1d1d33b8 other: update some issue templates (#3544) 2024-04-29 19:37:57 +08:00
ac6604730a cmd/gf: fix pbentity generate fail in mono-repo (#3547) 2024-04-29 19:27:15 +08:00
3cdd9ef36e cmd/gf: fix command gf gen dao for fieldMapping feature (#3549) 2024-04-29 19:22:02 +08:00
9aa426a105 database/gdb/gdb_model_soft_time: fix soft-time support fieldType:LocalTypeUint64 in Insert/Update perations (#3551) 2024-04-29 19:00:51 +08:00
5b7cae78bc feat: add custom field type mapping support for command gf gen dao (#3498) 2024-04-25 19:19:09 +08:00
cc98e5759c fix: #3200 empty content in glog handler after structure logging feature supported (#3475) 2024-04-25 19:13:50 +08:00
12ff9af431 test/gtest: add support for string type in AssertIN and AssertNI (#3537) 2024-04-24 21:04:54 +08:00
aa6d83fe1c other: enhance Issues and Pull Requests template (#3533) 2024-04-24 19:20:34 +08:00
f48ca959f7 chore: fix function names in comment (#3536) 2024-04-24 19:14:42 +08:00
59a959a361 fix: #3459 gf gen dao should ignore link configuration from file as it is passed from arguments (#3531) 2024-04-23 21:43:45 +08:00
ce57b26769 cmd/gf: fix unit testing cases for compatibility with windows (#3532) 2024-04-23 21:39:11 +08:00
adc94fd97a fix: uint testing case for signal feature of package gproc occasionally failed (#3529) 2024-04-23 21:30:33 +08:00
1013df1627 enhance: improve performance of struct converting for package gconv (#3412) 2024-04-23 21:30:06 +08:00
646ed5ea14 enhance: upgrade version of dependencies (#3526) 2024-04-22 19:59:59 +08:00
a39e6a2c62 enhance: gf gen ctrl with -merge option (#3490) 2024-04-18 20:12:02 +08:00
fa4f31f3dd chore: fix function names in comments for package otelmetric (#3493) 2024-04-18 20:04:23 +08:00
adb813fbad enhance: upgrade version of dependencies (#3494) 2024-04-18 20:02:27 +08:00
ebe567dab2 fix: missing file closding when printing downloading percent of gf cli file for command gf up (#3483) 2024-04-16 19:49:09 +08:00
bbcf49db98 fix: #3238 first column might be overwritten in interal context data in multiple goroutines querying (#3476) 2024-04-16 19:31:06 +08:00
75763735c4 enhance: improve command gf gen ctrl using AST for parsing DstFolder (#3478) 2024-04-15 20:16:44 +08:00
285e5a0580 fix: file name example/pack/packed/paked.go → example/pack/packed/packed.go (#3479) 2024-04-15 20:11:01 +08:00
2ee0c2bdac fix: sqlitecgo to support 32-bit architecture (#3480) 2024-04-15 10:03:49 +08:00
ae58dc846a fix: missing arguments on Windows platform for package gproc (#3482) 2024-04-15 09:59:35 +08:00
91f449dff8 feat: add new rule required-if-all for package gvalid (#3455) 2024-04-11 19:45:09 +08:00
2523889765 enhance: improve gf gen ctrl using AST (#3470) 2024-04-11 19:15:31 +08:00
4c6b146627 feat: add Scan method for incremental key retrieval in gredis (#3451) 2024-04-11 15:37:22 +08:00
6e2d238f56 emhace: unit testing cases update for package cmd/gf and contrib/drivers (#3453) 2024-04-10 20:55:09 +08:00
d7a0482146 fix: #3465 If the value of a string is null, the value of string is nil after the string is converted to []string (#3468) 2024-04-10 20:18:03 +08:00
b040654574 enhance: add ORM tag to the entity result of command gen dao to make entity assignment more faster (#3454) 2024-04-07 19:19:07 +08:00
505fc25a64 fix: fsnotify watcher panics when closing (#3399) 2024-04-07 14:12:03 +08:00
83ba887df7 fix: #3449 accept slice parameter as json.RawMessage for http request (#3452) 2024-04-07 14:09:52 +08:00
911f1cb1de enhance: use map iter to iterate the map instead of map keys and values (#3457) 2024-04-07 10:00:04 +08:00
1b7aea0ced feat: add metrics option and prometheus handler wraps (#3445) 2024-04-07 09:57:13 +08:00
x
db5eed17b1 fix: invalid cache key using pointer address of variable for soft time fields (#3448) 2024-04-02 20:10:16 +08:00
1ffb510a77 feat: add custom go module configuration support when initialize go project using command gf init (#3425) 2024-04-02 14:05:22 +08:00
f039393b2b fix: map converting in loop logic of validation for package gvalid (#3423) 2024-04-01 19:23:12 +08:00
00ba053ce6 enhance: use in-memory cache for soft field name and type (#3420) 2024-04-01 19:22:23 +08:00
dcf1f19ff7 enhance: Save operation support for mssql (#3365) 2024-04-01 19:18:54 +08:00
06826750ed enhance: improve Save feature for drivers oracle and dm (#3426) 2024-04-01 19:08:26 +08:00
e0a2645f4a fix: #3390 name&shor tag mapping failed to command input object for package gcmd (#3429) 2024-04-01 19:07:08 +08:00
509fdf45c6 feat: add auth support in address configuration for etcd registry (#3439) 2024-03-29 19:19:45 +08:00
1e7d897b66 fix: lost trace content in occasion when shutting down trace (#3418) 2024-03-29 10:08:58 +08:00
6df0a9ca66 fix: the cron job with precise second time pattern might be executed twice in the same time (#3437) 2024-03-28 22:09:11 +08:00
1c12f3a30d fix: http superfluous response.WriteHeader call in some scenario (#3428) 2024-03-28 22:08:54 +08:00
3a9e0e34ca fix: #3432 Add Access-Control-Expose-Headers: Content-Disposition header in ServeFileDownload (#3433) 2024-03-28 20:07:56 +08:00
8669512f42 feat: add metric feature support in goframe (#3138) 2024-03-24 21:18:30 +08:00
313d9d138f fix: unit testing cases of contrib/drivers occasionally failed by using now time assertion (#3410) 2024-03-21 21:57:33 +08:00
040118b7c6 fix: #3370 fixed process parameter parsing failed on Windows for package gproc (#3386) 2024-03-20 19:58:42 +08:00
b3f48212f1 fix: #3362 IsEmpty panics when some interface implement panics with nil receiver (#3367) 2024-03-20 19:52:12 +08:00
cade0775e8 enhance: Save operation support for contrib/drivers/dm (#3404) 2024-03-20 19:18:25 +08:00
164aad48c3 fix: unit test of dm failed occasionally (#3382) 2024-03-19 19:40:52 +08:00
04756d05a7 fix: fix lost log directory path for grapc log (#3387) 2024-03-18 19:14:31 +08:00
409041b965 enhance: support save for Oracle (#3364) 2024-03-13 20:11:45 +08:00
11f7187367 fix: unit test of dm failed occasionally (#3369) 2024-03-13 19:29:41 +08:00
4feda4c395 enhance: do not ignore error from gdb.FormatMultiLineSqlToSingle func (#3368) 2024-03-13 19:22:17 +08:00
a8713da97f enhance: cut tracing content as unicode for safety (#3342) 2024-03-13 19:21:16 +08:00
199737cd0f fix: for typo in comments for package contrib/drivers and gdb (#3366) 2024-03-12 20:40:20 +08:00
3a8f246569 fix: unit test error in PgSQL and SQLite; Unified t.Assert(err, nil) to t.AssertNil(err) (#3356) 2024-03-12 20:05:03 +08:00
607f079b23 fix: cache value assertion panic if the cache adapter is not in-memory for soft time feature of package gdb; improve converting performance for gconv.Scan (#3351) 2024-03-07 11:36:42 +08:00
cab6b89446 enhance: update contrib/drivers/README.MD (#3355) 2024-03-07 11:34:49 +08:00
6ed3038312 feat: version v2.6.4 (#3352) 2024-03-07 10:12:58 +08:00
9b48da459e enhance: add sentinel auth config for redis (#3348) 2024-03-06 19:27:52 +08:00
fbd266fad0 enhance: add Save operation support for SQLite #2764 (#3315) 2024-03-06 19:22:58 +08:00
240dadff92 fix: WherePri function wrong in pgsql #3330 (#3339) 2024-03-06 19:19:07 +08:00
290f4a3e65 fix: recognize json_valid constraint as json field type for database mariadb #2746 (#3309) 2024-03-06 19:07:31 +08:00
97fcd9d726 enhance: improve FormatUpsert implements for pgsql (#3349) 2024-03-06 19:05:13 +08:00
df15d70466 enhance: change tracing span name from request uri to router uri for http request (#3338) 2024-03-05 21:11:27 +08:00
680ae8616b fix: generated dao go files forcely cleared by command gf gen dao if clear set true (#3337) 2024-03-05 20:49:19 +08:00
4feb8219fa feat: upgrade set-go version and add go 1.22 version (#3316) 2024-03-04 20:18:31 +08:00
509cc47d3f enhance: add Save operation support for pgsql #3053 (#3324) 2024-03-04 20:17:43 +08:00
849b104c31 enhance: gproc.signal enhance #3325 (#3326) 2024-03-04 20:10:05 +08:00
ce3ef13e6a fix: otel tracing content contains invalid UTF-8 (#3340) 2024-02-29 20:22:42 +08:00
rio
c8a73f8c25 nacos-sdk-go upgrade to v2 (#3334) 2024-02-28 21:52:32 +08:00
b71ee13ccd fix error code comment on i18n defaultLanguage value (#3335) 2024-02-28 21:51:43 +08:00
a347cdc30e fix github pages ci (#3331) 2024-02-28 19:20:37 +08:00
39a88ef650 fix typo (#3332) 2024-02-27 21:09:43 +08:00
8b156e25c4 enhance mysql_z_unit_model_test (#3329) 2024-02-27 21:07:31 +08:00
eb0c4b3824 fix #3226 (#3322) 2024-02-27 20:37:49 +08:00
56ef0c0735 fix issue command gf run -w takes no effect (#3321) 2024-02-27 20:33:57 +08:00
a1a9465e52 add ExampleCache_Clear (#3310) 2024-02-27 19:42:58 +08:00
d64a31fd1a new version v2.6.3 (#3308) 2024-02-07 17:11:36 +08:00
6cdf044320 fix issue #2616 (#3307) 2024-02-07 16:47:41 +08:00
5307f0742e add # for cron pattern that can ignore seconds, which makes the cron pattern running in minimum minute like linux crontab pattern (#3306) 2024-02-07 15:38:24 +08:00
51326f3d02 fix #3245 (#3298) 2024-02-06 11:47:25 +08:00
e1fa99013a use iota to unify the enums definition (#3305) 2024-02-06 11:44:29 +08:00
72014689e4 fix issue #2643 (#3304) 2024-02-06 10:21:44 +08:00
2acdf4bb47 add field type detection for soft time field like created_at/updated_at/deleted_at to support unix timestamp or bool deleting table field (#3293) 2024-02-06 10:21:23 +08:00
85c5b7f19e fix issue #2594 (#3303) 2024-02-05 20:40:03 +08:00
42ec1a0076 fix issue #2572 (#3301) 2024-02-05 19:20:05 +08:00
553cc45e54 fix empty pwd path read from gfile.Pwd() which could cause internal error logging for gview.New (#3302) 2024-02-05 16:49:44 +08:00
7415ec32c8 fix issue #2503 (#3299) 2024-02-05 10:30:03 +08:00
14568562e3 fix issue #2552 (#3300) 2024-02-05 10:29:43 +08:00
cc79d23334 fix issue #2457 (#3297) 2024-02-02 10:57:24 +08:00
ef2b47d180 fix issue #3292 (#3294) 2024-02-01 16:02:36 +08:00
adc056f547 feat: support running commands via non-command line arguments (#3290) 2024-01-30 20:14:13 +08:00
8266a16b4e fix issue #3286 (#3289) 2024-01-30 20:03:58 +08:00
c4a51f4c2f bugfix:fix gconv map deep option not effective (#3287) 2024-01-29 19:52:04 +08:00
4ddc9c3909 add offline document link in readme.md (#3284) 2024-01-25 20:47:21 +08:00
0a2f8abb40 Update annotation for redis.toml (#3282) 2024-01-24 20:37:41 +08:00
81de5d3f25 fix workflow script for cli building and release (#3279) 2024-01-24 20:36:50 +08:00
e6d61e6e14 fix error in gerror.HasCode (#3277) 2024-01-24 20:36:32 +08:00
4fb739615b version v2.6.2 (#3276) 2024-01-22 21:53:10 +08:00
ba39323d30 improve converter feature for package gconv (#3211) 2024-01-22 21:52:54 +08:00
383937fe69 add example for ctx keys feature of package glog (#3273) 2024-01-22 21:07:40 +08:00
Bob
f919f90bf5 rename gitee issue template (#3274)
rename gitee ISSUE_TEMPLATE.MD to ISSUE_TEMPLATE
2024-01-22 21:07:04 +08:00
b4f6f06ab5 no printing internal middleware for ghttp.Server (#3271) 2024-01-22 21:05:40 +08:00
73fbca40ca add internal error logging and update comments for gclient.RequestVar (#3270) 2024-01-18 10:21:38 +08:00
e8d3fcac6b feat: upgrade gitee sync Hub Mirror Action (#3272) 2024-01-18 10:21:14 +08:00
f87182d5b8 fix workflow for gitee sync (#3269) 2024-01-17 20:27:41 +08:00
951f8921cd fix #3237 (#3267) 2024-01-17 15:35:48 +08:00
d26b7c5437 fix some wrong comment (#3265) 2024-01-16 14:08:07 +08:00
9407fda197 add example for exporting prometheus metrics using ghttp.Server (#3266) 2024-01-16 14:07:49 +08:00
905913f7be Fix gf gen service bug. Fix the issue of significant differences in the generated code every … (#3260) 2024-01-15 20:35:14 +08:00
4b8eaac73f fix issue #3232 (#3247) 2024-01-15 20:33:30 +08:00
ca242ff401 fix #3251 (#3254) 2024-01-11 22:15:22 +08:00
42e3c5f39a fix #3253 (#3255) 2024-01-11 22:14:22 +08:00
4f4d2c2f8e add MiddlewareNeverDoneCtx for package ghttp (#3250) 2024-01-06 13:03:49 +08:00
Gin
5a01798481 fix: memory leak when gcache.NewAdapterMemory with lru (#3241) 2024-01-03 20:03:19 +08:00
8af1eb693e Update README.MD (#3243) 2024-01-03 19:49:06 +08:00
335ccb32af Update Github issue template (#3234) 2024-01-02 20:42:14 +08:00
e1f2666499 add example for serve file (#3193) 2024-01-02 20:19:40 +08:00
22fcfdf755 add configuration support for logger of grpcx.Server (#3223) 2024-01-02 20:19:05 +08:00
1e21b61a19 fix typo flie -> file (#3228) 2024-01-02 20:17:54 +08:00
6abd8bd864 comments update for package gstr (#3233) 2024-01-02 20:16:51 +08:00
cy
4876ae0e2b fix:gz files are compressed repeatedly every time tick (#3236) 2024-01-02 20:10:57 +08:00
63bdf41d40 fix #3191 (#3194) 2023-12-28 20:18:29 +08:00
984cca8b82 feat: update dependent redoc js for swagger ui (#3217) 2023-12-28 20:13:21 +08:00
9f7ce42c74 enhance #3221 (#3224) 2023-12-28 20:07:07 +08:00
16a43bcb6c Add comment for Format method so that you can know Layout method. (#3230) 2023-12-26 16:19:59 +08:00
85d95e3e27 version v2.6.1 (#3222) 2023-12-21 21:12:51 +08:00
4cce8557e6 fix: #2924 (#3177) 2023-12-21 10:16:14 +08:00
d60d7674d7 fix issues for package contrib/drivers/dm (#3157) 2023-12-20 20:33:58 +08:00
7f9467d1f8 fix: #2938 (#3178) 2023-12-20 20:25:23 +08:00
d08e3ef838 fix: #2689 change sessionId in cookie (#3203) 2023-12-20 20:21:15 +08:00
645c5ff5b5 fix issue #3218 #3204 (#3220) 2023-12-19 21:58:12 +08:00
7975e391f0 Version/v2.6.0 (#3213) 2023-12-18 20:59:09 +08:00
565790036e improve gen dao to support removeFieldPrefix (#3208) 2023-12-18 20:26:43 +08:00
44819b135e fix issue #3204 (#3212) 2023-12-18 20:19:18 +08:00
bb19877430 fix: #3197 (#3206) 2023-12-18 19:11:39 +08:00
fc02e06423 doc: update readme img (#3207) 2023-12-15 15:56:08 +08:00
dd8a5dcf32 fix: #3179 (#3195) 2023-12-14 21:51:28 +08:00
33584506ab fix issue: request body was closed while retrying in callRequest method (#3199) 2023-12-14 14:18:31 +08:00
ee2cf92479 Version/v2.6.0 beta (#3183) 2023-12-04 19:34:48 +08:00
0b6dd6fb13 improve initialization performance and logging content for cmd gf (#3174) 2023-11-30 18:59:49 +08:00
993467bb3c test: add date-format test for RFC3339 (#3181) 2023-11-29 19:12:21 +08:00
c7c9f0011a fix: #2967 (#3175) 2023-11-29 19:05:21 +08:00
9aa872e705 improve map converting feature using MapOption for package gconv (#3170) 2023-11-23 18:59:04 +08:00
ea5d52cb2f fix issue #3147 (#3161) 2023-11-22 21:05:39 +08:00
b1754f8254 script updates for version upgrading (#3169) 2023-11-22 20:49:07 +08:00
83f08b3135 fix issue in Join stements with prefix specified for package gdb (#3151) 2023-11-20 20:47:26 +08:00
d3d1f94e40 Upgrade nacos sdk to latest version (#3166) 2023-11-20 20:47:00 +08:00
fc8572e8dd version v2.5.7 (#3162) 2023-11-20 10:01:54 +08:00
85acd3d31d Fix the bug that ScanAndCount and AllAndCount report errors in sqlserver (#3155) 2023-11-16 20:15:48 +08:00
9694a68211 Optimize the information display of gf -v (#3145) 2023-11-16 20:10:45 +08:00
0be8b29e42 improve gen service code (#3140) 2023-11-14 20:53:41 +08:00
5580ac9475 fix issue in cross-building failed in windows (#3152) 2023-11-14 20:10:49 +08:00
84ed66018e fix issue: Windows Platform did not handle process signal (#3154) 2023-11-14 20:00:26 +08:00
4d7f9552fe fix: gdb unsupport aliyun hologres link (#3150) 2023-11-13 22:05:53 +08:00
d4b14fd717 add gen service unit testing (#3142) 2023-11-09 20:04:05 +08:00
0bd15bdab5 fix: "gf gen dao" utils.GetModPath Return empty string in windows (#3141) 2023-11-09 20:02:47 +08:00
0b407c5e6d fix "gf gen pb" api and ctrl not working well. (#3076) 2023-11-08 21:26:51 +08:00
5f5b82188c example: log rotate (#3137) 2023-11-08 21:23:39 +08:00
a17849bc39 improve struct converting in parameter name case sensitive scenario for package gconv (#3122) 2023-11-08 21:17:55 +08:00
f3e3a5af5a feat: improve code for shutdown of otel (#3136) 2023-11-08 21:16:23 +08:00
dc71c0d28f enhance #3129 (#3134) 2023-11-06 19:27:26 +08:00
eb99f5ebfe rename function name PKCS5UnPadding to PKCS7UnPadding (#3124) 2023-11-06 19:20:07 +08:00
007fe0ea1a enhance #3063 (#3115) 2023-11-06 09:59:45 +08:00
50b04c658c improve implements and fix issues for package contrib/drivers/dm (#3128) 2023-11-06 09:52:36 +08:00
cbea89e6f7 fix duplicated route dump for package ghttp (#3116) 2023-11-02 09:48:39 +08:00
e2e12fadb0 add function CaseConvert for package gstr (#3098) 2023-11-01 19:52:07 +08:00
47eaa513c0 add unit testing cases for command gen ctrl (#3090) 2023-11-01 19:23:03 +08:00
3bbc0fdd21 add Output configuration support for command gf build in cross-buildling binary scenario (#3120) 2023-11-01 19:18:44 +08:00
9393072745 improve TemplateGenCtrlController is comments and formats (#3065) 2023-10-31 20:21:18 +08:00
e42aa64d75 improve impelements for logging file rotation in windows (#3080) 2023-10-31 20:19:01 +08:00
b6935a7285 fix(goai): example value needs to be converted just like default value (#3085) 2023-10-31 20:18:39 +08:00
b0367e4a62 fix: gRPC-Go HTTP/2 Rapid Reset vulnerability (#3095) 2023-10-31 20:17:39 +08:00
0b71bc43a8 fix issue #3099 (#3107) 2023-10-31 20:02:20 +08:00
Gin
afeca8cf9d fix: nacos mod (#3103) 2023-10-31 10:04:51 +08:00
sam
33c396fb74 fix cmd gen pbentity for generating go orm files for database postgres (#3105) 2023-10-31 10:04:07 +08:00
4903ef7887 fix issue #3100 (#3106) 2023-10-30 20:27:48 +08:00
ab5ab4c675 Add the Protocol attribute to the Redis configuration (#3109) 2023-10-30 20:11:23 +08:00
3ea61d084e fix issue #3086 (#3089) 2023-10-26 10:04:21 +08:00
2433b2ce99 ignore cmd/gf/go.work.sum from version controll (#3087) 2023-10-25 21:17:21 +08:00
927758a2a9 fix separator issue in windows os for command gf gen (#3088) 2023-10-25 21:16:05 +08:00
cb0d018fa4 feat: upgrade version and improve consul action (#3078) 2023-10-24 20:36:01 +08:00
49f69f6ade Update README.MD (#3082) 2023-10-24 20:33:10 +08:00
bcb479aabb fix issue #3077 (#3081) 2023-10-24 10:02:04 +08:00
db59f4232f add README and example cases for nacos registry (#3075) 2023-10-23 20:04:39 +08:00
aa625d24bc add example for http rate llimit (#3072) 2023-10-23 20:02:37 +08:00
36cfbaaa22 README.MD updates for cli installation (#3071) 2023-10-23 20:00:10 +08:00
f8462b5218 split ci workflow into two workflows for short (#3069) 2023-10-23 19:28:26 +08:00
b2bd12a371 version v2.5.5 (#3068) 2023-10-20 10:21:04 +08:00
acf2307eb9 fix issue #2963 (#3062) 2023-10-19 19:58:19 +08:00
93964ee231 delete repeat code in ut for package ghttp (#3058) 2023-10-18 20:04:07 +08:00
943939ba2b improve cache duration from second to millisecond for redis adapter of package gcache (#3052) 2023-10-18 20:02:23 +08:00
f1b5a223bf add go workspace for cmd/gf, to enable go install for cmd/gf (#3040) 2023-10-18 20:01:16 +08:00
bb9cd37fab add SetNoUrlEncode/NoUrlEncode functions for gclient.Client (#3041) 2023-10-17 21:19:59 +08:00
972f8c3aff improve comments for package gconv (#3057) 2023-10-17 21:09:46 +08:00
34e522306d resolve response is gzip in internalMiddlewareServerTracing (#3055) 2023-10-17 20:35:56 +08:00
7c92c2f7e8 improve comments and variable names for gcfg.AdapterFile of package gcfg (#3046) 2023-10-17 20:12:07 +08:00
5204bdb60d add option merge controlling generating controller files into one single file for command gf gen ctrl (#3045) 2023-10-17 20:11:23 +08:00
6ab8d065d1 fix:incorrect parameter passing causes captured errors to be lost (#3048) 2023-10-16 21:20:21 +08:00
d4e686226b improve version checks for ci script (#3047) 2023-10-16 21:18:23 +08:00
19d7714503 fix security issue for golang.org/x packages (#3042) 2023-10-16 20:45:43 +08:00
f464f30e6f improve comment of router feature for ghttp.Server (#3014) 2023-10-16 20:41:10 +08:00
XG
0e7d7d1eee feat: add -w/--watchPaths for subcommand gf run (#3009) 2023-10-12 21:07:51 +08:00
6af66a0201 add service registry implements using nacos (#2995) 2023-10-12 21:06:37 +08:00
81f3ad043d ci: Update action script to remove inactive labels (#3013) 2023-10-11 21:39:20 +08:00
ca7450f595 enable go cache for ci, coverage of ut testing is only available after merge of pr (#3011) 2023-10-11 21:38:43 +08:00
65192a7f92 fix issue gconv struct slice/map of json.RawMessage (#3006) (#3008) 2023-10-11 21:35:27 +08:00
8c309ac9fe fix issue #2907 (#3005) 2023-10-11 21:34:17 +08:00
7f1ce2aff3 fix issue #2904 (#3004) 2023-10-11 21:33:51 +08:00
10b67fc7b0 fix issues #2980 (#2994) 2023-10-11 21:28:53 +08:00
3cd005911d fix issue reading resource from manage in function New of package gres (#2961) 2023-10-10 20:02:52 +08:00
d10d96800f temporaryly close the testing of package kubecm to avoid disk unavailable issue (#3007) 2023-10-10 14:09:58 +08:00
35e5f1f204 feat: Migrate the service call tracing to use otlphttp or otlpgrpc for reporting (#3001) 2023-10-09 20:09:20 +08:00
1efdb72990 add direct service address support for grpc client (#2991) 2023-10-09 20:03:45 +08:00
8d925d4741 fix issue #2890 (#3002) 2023-10-09 20:00:08 +08:00
d6362cad16 add List2/List3/ListAndTrim2/ListAndTrim3 functions for package gstr (#2986) 2023-10-09 19:58:14 +08:00
00e83fed3f add function Partition for Model of package gdb (#2989) 2023-10-08 09:49:21 +08:00
02f1cc7b40 allowing use printToStdout, printToFile and printToWriter at the same time for Logger of package glog (#2990) 2023-10-07 20:46:24 +08:00
32a60c2e96 Add consul config adapter usage example. (#2988) 2023-10-07 20:19:47 +08:00
30040332a7 improve address configuration for grpc server (#2982) 2023-09-27 14:40:32 +08:00
569cbb09bf fix: improve specification version (#2987) 2023-09-26 22:03:18 +08:00
130191f4ed add in:header tag cache for http request to enhance performance (#2923) 2023-09-25 21:34:58 +08:00
e6732039c6 add consul config adapter (#2964) 2023-09-25 21:02:55 +08:00
df92c483d0 fix isue #2976, to be compatible with bad response type definition for strict route function (#2977) 2023-09-25 20:40:32 +08:00
7c9eefef3d feat: Preserve original file permissions & Default copy permissions c… (#2969) 2023-09-19 20:20:13 +08:00
42de1c1dbe improve example cases for package gi18n (#2970) 2023-09-19 20:18:43 +08:00
395df940d7 fix(gutil): panic when field is []byte(BINARY in mysql) (#2957) 2023-09-18 20:16:59 +08:00
ef1e18df19 fix: gutil.IsMap judgment logic error (#2953) 2023-09-13 19:30:02 +08:00
e684eae878 Make GTime support multiple formats (#2933) 2023-09-13 19:29:25 +08:00
5219c5c37e add ut cases for command gen dao (#2958) 2023-09-12 22:00:35 +08:00
5059abd88e upgrade dependence github.com/apolloconfig/agollo/v4 version from v4.1.1 to v4.3.1 for package contrib/config/apollo (#2949) 2023-09-12 21:20:53 +08:00
e2ed058e3b feat: upgrade action/checkout to v4 (#2948) 2023-09-12 21:20:10 +08:00
ccc959a2d3 feat: jaeger package will be removed in v2.6.0. (#2946) 2023-09-12 21:17:47 +08:00
a5a7d23792 improve g.Go (#2956) 2023-09-12 20:00:01 +08:00
5bc9acdab3 version v2.5.3 (#2945) 2023-09-11 10:19:51 +08:00
ab1970e7d6 add new function g.Go (#2943) 2023-09-11 10:18:44 +08:00
1582714325 improve signal listening for package grpcx/ghttp/gproc (#2942) 2023-09-11 10:15:08 +08:00
7391a4d45a improve trace span generating for package gctx and http tracing content for package ghttp (#2937) 2023-09-11 10:14:00 +08:00
7e16d9b63e fix codes due to static codes analysis (#2935) 2023-09-07 20:22:20 +08:00
d49dccb147 test: add unit tests regarding issue 2901 (#2930) 2023-09-05 19:30:54 +08:00
6cddfdb313 improve join feature for package gdb (#2929) 2023-09-05 19:29:28 +08:00
912316d765 add cluster mode and tls configuration support for package gredis (#2936) 2023-09-05 19:23:17 +08:00
b9e2b05f04 change interface ConvertDataForRecord to ConvertValueForField for package gdb (#2916) 2023-09-04 21:23:54 +08:00
887803e495 add structure logging handler for package glog (#2919) 2023-09-04 21:23:46 +08:00
eb11061bd2 fix: gjson encode to string expect inconformity(issue 2520) (#2928) 2023-09-04 21:19:22 +08:00
000c7a92ed ORM add function: LeftJoinOnFields,RightJoinOnFields,InnerJoinOnFields (#2921) 2023-09-04 20:33:53 +08:00
097b26f318 fix: multiple interfaces cause the original type to be inaccessible (#2915) 2023-09-04 20:11:14 +08:00
3da5e5e865 fix: gutil.IsSlice judgment logic error (#2910) 2023-09-04 20:09:55 +08:00
e60262fec9 docs: fix code comment err in Model Join case (#2884) 2023-09-04 20:05:52 +08:00
74bf1b4bc3 fix(cmd): Fix gf build examples (#2917) 2023-08-31 15:32:49 +08:00
3f69e0db36 improve error stack configuration for package gerror, add framework error stack filter for package glog (#2918) 2023-08-31 15:31:55 +08:00
7d4c59ac5a fix: OpenAPI cannot correctly identify the file type under the canoni… (#2898) 2023-08-28 21:52:22 +08:00
3841f05e02 add AdapterContent implements for gcfg.Adapter (#2892) 2023-08-28 21:49:30 +08:00
bcd409ab1c fix typo "Upadte" -> "Update" (#2906) 2023-08-28 21:48:56 +08:00
4dd43aa018 improve packed project template for command init (#2885) 2023-08-23 19:28:09 +08:00
aed695313a rewrite gmutex with sync.RWMutex (#2883) 2023-08-23 19:27:57 +08:00
cf299273c4 version v2.5.2 (#2878) 2023-08-18 09:57:25 +08:00
53323f3cf9 improve support for generic router registering (#2877) 2023-08-17 21:16:19 +08:00
24ee5341ec Fix empty map or struct convert to another map will return error. (#2863) 2023-08-17 20:59:16 +08:00
ed4d1554ab improve converter feature for package gconv (#2869) 2023-08-17 20:33:12 +08:00
ac3481ed43 it returns error when Scan to a none empty slice with empty Result for package gdb (#2858) 2023-08-17 20:29:06 +08:00
3df5969348 fix generic check with slice for ghttp (#2850) 2023-08-16 21:42:36 +08:00
ea6a773d60 fix: marked gcode.CodeInternalPanic for panic (#2860) 2023-08-14 09:53:13 +08:00
35a326e169 fix(ghttp): fix access log info format (#2853) 2023-08-10 22:12:10 +08:00
4020eb9b4c fix issue in SliceMap/Maps for package gconv when nil value in map of slice item (#2857) 2023-08-10 21:59:21 +08:00
243fe73c57 improve comment replacement regex pattern for command gen service (#2846) 2023-08-08 20:39:38 +08:00
932f8c48ef Add gconv custom converter feature. (#2828) 2023-08-07 21:15:22 +08:00
7c1be3eb63 improve data converting for DB.DoInsert/DoUpdate (#2830) 2023-08-07 21:03:56 +08:00
5de2cfbfa1 improve command gen ctrl for api parsing and interface file generating (#2836) 2023-08-07 21:02:16 +08:00
b593c00d97 fix gf gen service remove all comments. (#2845) 2023-08-07 20:42:10 +08:00
7798e96190 add more ut case for package goai (#2843) 2023-08-07 20:39:01 +08:00
55ac18d90a Update README for minimum go version requirement (#2833) 2023-08-03 21:14:48 +08:00
a409db5540 Bump golang.org/x/net from 0.0.0-20211112202133-69e39bad7dc2 to 0.7.0 in /contrib/drivers/sqlitecgo (#2834) 2023-08-03 21:13:23 +08:00
dd5d56674e Bump golang.org/x/text from 0.3.8-0.20211105212822-18b340fc7af2 to 0.3.8 in /contrib/drivers/sqlitecgo (#2835) 2023-08-03 21:12:45 +08:00
79617570ca Feat:upgrade redis v9 (#2825) 2023-08-03 20:01:36 +08:00
a4e7cc4700 fix: psgql tx unsupport LastInsertId (#2815) 2023-08-03 19:59:22 +08:00
2fbe4125dd feat: Using sqlite CGO is for building a 32-bit Windows operating system (#2743) 2023-08-03 19:58:16 +08:00
47915816b5 fix: disable map tag summary and description from the OpenAPI Operation to PathItem (#2823) 2023-08-02 20:45:58 +08:00
0f53660453 fix issue #2570 (#2819) 2023-08-02 20:41:28 +08:00
f3437dc00f add generic support for http routes registering #2227 #2457 (#2807) 2023-08-02 20:35:58 +08:00
574d63b4fd fix issue #2803 (#2805) 2023-08-01 22:06:10 +08:00
53e5a04073 change minimum golang version from v1.15 to v1.18 (#2820) 2023-08-01 21:15:28 +08:00
XG
c51785125e refactor: add default client instance for contrib/sdk/httpclient (#2814) 2023-08-01 20:45:20 +08:00
XG
5230f8304e fix issue #2816 (#2817) 2023-08-01 20:11:52 +08:00
e0e00434cc expose iClient as IClient in generated sdk for command gen ctrl (#2804) 2023-07-26 21:27:58 +08:00
b95cb3180d fix gen ctrl import path (#2800) 2023-07-25 21:50:47 +08:00
dec66dbd05 add NeverDone function for package gctx that creates and returns a never done ctx (#2784) 2023-07-25 20:45:34 +08:00
cb44c40a9c fix issue #2482 (#2789) 2023-07-25 20:28:50 +08:00
2c22f4e17d feat: improve watch for polaris registrar (#2788) 2023-07-25 20:17:17 +08:00
83fa3593b1 fix: orm generate sql wrong, issues #2782 (#2787) 2023-07-25 20:13:17 +08:00
4ad508c04d feat: add Diff feature to gmap (#2774) 2023-07-20 20:07:43 +08:00
0d52386236 improve command init and gen ctrl (#2785) 2023-07-20 20:05:40 +08:00
16a5318d32 upgrade package gopkg.in/yaml.v3 to latest stable version v3.0.1 (#2783) 2023-07-20 09:57:04 +08:00
b1da02dff6 improve import path generating for command gen ctrl (#2781) 2023-07-20 09:56:48 +08:00
b99db92113 feat: gbuild add BuiltVersion (#2754) 2023-07-19 21:15:22 +08:00
c0dff1dc16 add default time check for converting functions of gtime.Time (#2755) 2023-07-19 21:11:54 +08:00
XG
ef6ef506d6 fix issue #2775 (#2777) 2023-07-19 20:55:44 +08:00
b71ac868b7 fix gf gen ctrl import (#2771) 2023-07-19 20:15:26 +08:00
d72997da04 fix g.Wait not support OS Signal #2752 (#2768) 2023-07-19 20:06:06 +08:00
41c0dde9bf add complicated map with custom type converting support for package gconv (#2769) 2023-07-17 10:06:06 +08:00
498b72f75a improve gctx.New for none default opentelemetry provider (#2756) 2023-07-14 14:26:24 +08:00
5e231f3d61 add example for package gvalid (#2767) 2023-07-14 14:25:25 +08:00
a2fec50500 remove sharding feature from gdb.Model (#2758) 2023-07-13 21:15:53 +08:00
6d7edb1479 fix issue #2760 (#2763) 2023-07-13 21:15:07 +08:00
ce72f9a84b fix typo (#2753) 2023-07-11 19:52:49 +08:00
4fc24e1391 add endpoints configuration for ghttp.Server (#2741) 2023-07-06 21:29:33 +08:00
160bddecd3 version v2.5.0 (#2747) 2023-07-06 21:28:38 +08:00
39810a520c add redis-config Auth Username (#2684) 2023-07-06 20:58:31 +08:00
0dc47609b5 feat: improve polaris register and discovery (#2739) 2023-07-06 20:41:24 +08:00
8fb4636cb4 improve command gen service for import alias and comments handling (#2745) 2023-07-06 20:36:33 +08:00
30cf3dbbe6 add custom endpoints configuration for package grpcx (#2625) 2023-07-05 09:54:57 +08:00
c90e9311e3 fix issue #2734 (#2740) 2023-07-05 09:49:25 +08:00
ba2a7e4417 add chaining function Discovery to disable/enable discovery feature for package gclient; fix issue #2737 (#2738) 2023-07-04 20:21:12 +08:00
740dfa58a6 add sharding feature on Model for package gdb (#2732) 2023-07-04 14:42:41 +08:00
9620b15ea1 fix length check issue (#2725) 2023-07-04 09:49:09 +08:00
3fab7a341d feat(glog): add log rotation support for short-running process (#2658) 2023-06-29 20:29:33 +08:00
5804547bc5 feat: add codecov.yml ignore cmd test (#2729) 2023-06-29 20:14:31 +08:00
70d0d20750 fix issue in converting value to nil when calling IsNil return ture for gdb.Core (#2720) 2023-06-28 22:06:51 +08:00
92e21c275c Update README to demonstrate how to configure polaris (#2724) 2023-06-28 21:33:11 +08:00
8aff08581f feat:add service comments. (#2714) 2023-06-28 21:10:47 +08:00
6eb0de42f8 update context of the original http request (#2717) 2023-06-28 21:04:49 +08:00
8c4a0b61b8 fix: cmd gen dao typeMapping.Name=>typeMapping.Type (#2723) 2023-06-28 10:55:08 +08:00
22696566d6 add type mapping feature for command gf gen dao (#2722) 2023-06-28 10:06:33 +08:00
c5c2938380 improve command gen ctrl and gen service (#2711) 2023-06-19 20:47:32 +08:00
d6433de4a6 add command gen ctrl for parsing api to generate controller and sdk go files (#2708) 2023-06-15 14:16:10 +08:00
15eaac35a8 bugfix : when using otel, calling gclient *Raw methods may result in null pointer exceptions (#2697) 2023-06-12 20:52:48 +08:00
46f3196297 Update gcompress_zip.go (#2694)
Fix index out of range when zipfile has dir __MAXOSX
2023-06-12 20:46:31 +08:00
842e5a6774 fix gdb_fun.go code comments (#2687) 2023-06-12 19:52:38 +08:00
2ece368810 add new validation rule "enums" (#2690) 2023-06-07 09:48:29 +08:00
1bbfc56121 improve key words transaction for package i18n (#2652) 2023-06-06 21:03:25 +08:00
835b252b5d fix issue in Where when used in field with prefix that not match struct attribute name (#2688) 2023-06-06 20:40:32 +08:00
9bc9fc4545 improve command make version (#2676) 2023-06-06 17:10:32 +08:00
8cc5338870 fix version retrieving of goframe for command version (#2682) 2023-06-02 18:02:24 +08:00
9191003391 feat: improve golangci-lint config (#2681) 2023-06-02 17:09:45 +08:00
99236fd93b version v2.4.2 (#2679) 2023-06-02 11:44:48 +08:00
b34d560bb7 add auto sync ci from github to gitee (#2680) 2023-06-02 10:05:42 +08:00
7bb4ddcfd5 ignore binary building if option Build is empty for command build (#2678)
ignore binary building if option Build is empty for command build
2023-06-01 21:52:59 +08:00
00190abad8 add method ScanAndCount and AllAndCount for Model package gdb (#2635) 2023-06-01 21:33:40 +08:00
aa8eabd853 fix issue #2439 (#2673) 2023-05-30 11:59:00 +08:00
4914517f6b template updates for command gf init (#2671) 2023-05-29 20:12:06 +08:00
0865dbbf75 improve command up for goframe version upgrade (#2670) 2023-05-29 16:29:42 +08:00
d3a3ad0228 add oltp(http&grpc) trace support (#2641) 2023-05-29 10:00:41 +08:00
e075432c40 comment update for package contrib/drivers/mysql (#2649) 2023-05-25 22:00:57 +08:00
e816ab05de refactor: code optimization (#2667) 2023-05-25 21:58:11 +08:00
a4762d0e02 fix issue in http proxy when repeatable reading request body content (#2666) 2023-05-25 11:56:12 +08:00
2329622564 add multiple methods support for united routes registering (#2664) 2023-05-25 10:58:06 +08:00
368312c816 add multiple methods support for object route (#2663) 2023-05-24 17:21:28 +08:00
f6dbe1a40c change parameter prefix of type string to prefixes of type slice for command enums (#2662) 2023-05-24 14:12:49 +08:00
032d085619 fix issue in building binary for command docker (#2660) 2023-05-24 14:12:22 +08:00
a6fff37be8 add DumpJson for package gutil (#2651) 2023-05-24 10:04:19 +08:00
879283685d fix(CLI): install cmd path choose empty not use default (#2655) 2023-05-23 21:59:47 +08:00
0f4f2a6672 fix issue in array border exceeded in RoundRobin of package gsel (#2642) 2023-05-23 21:30:47 +08:00
ff6f5ce237 update default logging time format using SetTimeFormat (#2611) 2023-05-23 20:59:58 +08:00
dc0467e934 add WhereOrNot/WhereOrPrefixNot functions for gdb.Model (#2661) 2023-05-23 17:35:47 +08:00
f0d22fe570 doc: correct level value comment (#2653) 2023-05-22 20:29:24 +08:00
05ee4d489a new logo (#2647) 2023-05-16 09:55:21 +08:00
3c1ded22fd cli command exits with code 1 if error (#2645) 2023-05-15 15:51:28 +08:00
bda5d252b2 fix host ip retrieving for package contrib/trace/jaeger when there is no intranet ip in host (#2640) 2023-05-12 11:59:05 +08:00
0c3e66d6a0 fix: genpbentity type error, []byte => bytes (#2633) 2023-05-12 10:17:07 +08:00
f31bf76f94 feat: modify readme doc address (#2638) 2023-05-11 20:44:56 +08:00
0afedee49d fix: genpbentity invalid proto3 (#2632) 2023-05-11 20:12:58 +08:00
43d439a1cd fix: When repairing protobuf to generate controllers, if the project … (#2630) 2023-05-11 20:11:04 +08:00
b8aeb4f0ee fix missing .exe suffix for cli file for windows downloading, unable replacing self cli binary (#2622) 2023-05-08 21:21:23 +08:00
1408385612 fix duplicated fields in function TableFields of driver pgsql (#2620) 2023-05-05 21:10:05 +08:00
d6471d7d51 v2.4.1 (#2615) 2023-05-05 14:15:01 +08:00
aa9d66c53c feat: improve polaris relation and add copyright for polaris example (#2607) 2023-05-05 10:04:32 +08:00
d9a7ee3e29 use first column name for Model.Array (#2609) 2023-04-28 14:55:53 +08:00
04c70f2037 fix empty string converted to none empty string type slice (#2612) 2023-04-28 14:55:37 +08:00
2198f0cefe fix issue #2561 #2431 (#2598) 2023-04-27 11:35:46 +08:00
c6b9b4d326 fix file registry that not works on windows (#2605) 2023-04-27 11:34:54 +08:00
4c6ebe7808 http context never done (#2602) 2023-04-26 20:20:47 +08:00
a9090e4a72 fix some comments (#2600)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-04-26 19:34:22 +08:00
0126eb5470 fix: polaris discouvery relation (#2603) 2023-04-26 19:31:28 +08:00
ed63617aa0 fix file permission error when overwriting directory containing .git … (#2599) 2023-04-25 21:36:37 +08:00
30f483a524 correct makefile (#2597) 2023-04-24 21:50:10 +08:00
894f202b75 version v2.4.0 (#2595) 2023-04-24 11:44:19 +08:00
9171585b2c improve auto retrieving of ip addresses for service registering (#2593) 2023-04-23 21:58:17 +08:00
23d8ef32a3 fix: fix typo and go-staticcheck S1002 warning (#2590) 2023-04-21 10:13:59 +08:00
a031e112e5 add command gen enums (#2591) 2023-04-20 16:30:42 +08:00
da8297d770 improve AddObject to support Command/*Command parameter for package gcmd (#2587) 2023-04-18 10:09:07 +08:00
3991eb053c fix issue #2584 (#2586) 2023-04-17 17:44:24 +08:00
6fb26c44d7 fix issue converting values to custom type pointers (#2585) 2023-04-17 16:34:36 +08:00
fdc027734c add command make version to in Makefile (#2579) 2023-04-14 10:09:19 +08:00
32a7f6a0f0 feature/v2.4.0-rc4 (#2578)
* v2.4.0-rc3

* v2.4.0-rc4
2023-04-12 22:01:24 +08:00
5bbec48679 v2.4.0-rc2 (#2575) 2023-04-12 21:14:03 +08:00
d4b9ee4c61 version updates to v2.4.0-rc (#2574)
version updates
2023-04-12 20:24:20 +08:00
50b5cd50bc fix issue in New when creating concurrent-safety var for package gvar (#2573) 2023-04-12 17:38:06 +08:00
53afbd0f05 uf case update for contrib/drivers/mysql (#2569) 2023-04-12 15:36:44 +08:00
b6874eb66d update cli build action (#2563) 2023-04-12 11:54:15 +08:00
7ff7de4643 inherit context from http.Request for ghttp.Request (#2550) 2023-04-12 11:54:06 +08:00
5f148632d2 fix missing trace id in gctx.GetInitCtx (#2562) 2023-04-12 10:35:24 +08:00
c1325ef9a3 Add Filter function to garray (#2541) 2023-04-12 10:15:11 +08:00
d788b7ff5e fix issue #2529 #2487 (#2548) 2023-04-12 10:14:14 +08:00
66d0663dc5 add clickhouse support in command gf gen dao (#2557) 2023-04-12 10:14:04 +08:00
a56524ee05 add RemoveValues for package garray (#2568)
add RemoveValues for package garray
2023-04-12 10:12:28 +08:00
1aa9f2809e improve stream response for http (#2564) 2023-04-12 10:12:11 +08:00
261672e84c feat: automatic update gf for contrib (#2551) 2023-04-11 21:13:29 +08:00
6a4e39e815 change temp dir to os.TempDir for package gfile (#2547) 2023-03-29 11:58:20 +08:00
4af9ce8a81 Bump golang.org/x/crypto from 0.0.0-20200622213623-75b288015ac9 to 0.1.0 in /cmd/gf (#2546) 2023-03-28 20:03:07 +08:00
5f146720fe fix: unified go.mod dependent version (#2452) 2023-03-28 09:25:29 +08:00
67e6772d88 comment updates for gdb.Builder (#2513) 2023-03-28 09:23:08 +08:00
12e9febe9e fix issue #2516 (#2531)
* fix issue #2516

* golang ci configuration updates

* add example for default value of http request
2023-03-22 20:14:57 +08:00
676022eeb6 fix issue #2509 (#2530) 2023-03-21 22:10:41 +08:00
XG
3a8fc1e70d optimize the handling of the SIGUSR1 signal (#2532)
optimize the handling of the SIGUSR1 signal
2023-03-21 21:26:49 +08:00
0b6798acb5 add Quick mode for gtimer (#2488) 2023-03-20 10:00:55 +08:00
e721124b6c support microseconds resolution for created_at/updated_at/deleted_at (#2512) 2023-03-20 09:57:37 +08:00
b32eb30212 feat: improve polaris register and upgrade polaris-go version v1.3.0 (#2524) 2023-03-20 09:52:58 +08:00
967a39ecbe feat:upgrade polairs-go sdk version v1.3.0 for config (#2525)
feat:upgrade polairs-go sdk version v1.3.0
2023-03-20 09:52:19 +08:00
dfb7f5abfb improve error message when the router hander definition is not standrad (#2528) 2023-03-20 09:51:43 +08:00
56f5d5125b fix quick exit when double click cli to install/upgrade (#2521) 2023-03-17 17:56:41 +08:00
5083174a92 fix goreport for gofmt (#2523) 2023-03-17 17:54:14 +08:00
4a278dfd79 improve grpcx (#2522) 2023-03-17 17:51:10 +08:00
80d57ed8f9 add postForm with multi data content type support (#2508) 2023-03-14 09:57:22 +08:00
b742e222d6 improve command gen pb by adding controller go files generating (#2518) 2023-03-14 09:47:42 +08:00
ae86f66545 fix issue #2499 #2515 (#2517) 2023-03-13 22:16:57 +08:00
45e4c9e16c add tag value of in support for api definition that has meta info (#2450) 2023-03-13 19:29:30 +08:00
XG
8c07f1a42c feat: support graceful shutdown (#2469) (#2475) 2023-03-13 19:21:56 +08:00
e6c97410ef fix: cli gen service:BUG #2310 (#2485) 2023-03-13 19:17:23 +08:00
b1a55c7a32 improvement for grpcx (#2510) 2023-03-13 18:56:19 +08:00
1cd1449085 add package contrib/rpc/grpcx (#2169) 2023-03-08 14:12:51 +08:00
55690f3738 improve unit testing cases coverage to 80%+ (#2480) 2023-03-07 21:27:23 +08:00
13f6fb1929 fix issue struct attribute converting when has no json name but with omitempty tag (#2486) 2023-03-07 21:26:32 +08:00
e8088a6563 improve command gen dao by removing all dao files if clear option is true (#2502)
* improve command  by removing all dao files if clear option is true

* version updates
2023-03-07 19:32:13 +08:00
e8051bad9a fix issue in empty json name along with omitempty tag in package oai (#2500) 2023-03-07 14:17:14 +08:00
d0d41a63a6 robot translator updates (#2491) 2023-03-07 11:01:01 +08:00
853b038a47 add issue translation robot (#2490) 2023-03-06 09:50:03 +08:00
34946f6105 fix configuration of Namespace for pgsql (#2481) 2023-03-01 19:30:40 +08:00
Gin
15d88c269d fix: gredis maxActive config and duplicate connection bug (#2479) 2023-02-27 22:08:37 +08:00
cbbfd85eeb Protect RemoveValue from race condition (#2472) 2023-02-23 19:47:57 +08:00
adf90c876f improve unit testing cases (#2468) 2023-02-23 10:07:40 +08:00
b4f76b8448 fix: use keyword(like: group) as table name in sqlite (#2461) 2023-02-20 22:03:26 +08:00
ed858ebd4b Bump golang.org/x/net from 0.1.0 to 0.7.0 in /cmd/gf (#2460) 2023-02-20 22:02:31 +08:00
272b9c7afd README update for cmd/gf (#2459) 2023-02-20 22:01:36 +08:00
8dc8dd9756 fix issue #2261 (#2458) 2023-02-20 21:57:49 +08:00
a64d1001e2 improve ci by using cache feature of setup-go (#2463) 2023-02-20 21:51:54 +08:00
ad737ded3c fix issue #2447 (#2448) 2023-02-15 14:13:32 +08:00
ac6b0c0980 fix issue #2427 (#2442) 2023-02-15 09:45:40 +08:00
b69e0ff9f7 fix issue #2338 (#2444) 2023-02-14 09:45:29 +08:00
0361f9f7de fix #2435 (#2437) 2023-02-13 19:18:30 +08:00
005668aca8 gdb error should wrap original underlying database error like MySQLError (#2402) 2023-02-08 19:38:11 +08:00
013f8b216a improve Timezone escape for driver dm/mysql (#2412) 2023-02-08 19:35:48 +08:00
8ecfa91e5d comment updates for with function of package gdb (#2418) 2023-02-08 19:10:03 +08:00
117fc6eda2 fix issue #2339 (#2433) 2023-02-08 19:08:10 +08:00
d66af122c7 fix issue #2331 (#2432) 2023-02-08 19:07:05 +08:00
a7467945ca fix issue #2355 (#2430) 2023-02-08 14:17:21 +08:00
81d8aa55cd fix issue #2371 (#2429) 2023-02-08 14:17:11 +08:00
4a6630138d fix issue 2356 (#2428) 2023-02-08 14:17:00 +08:00
3adae3a9aa fix type of default value in swagger ui for package goai (#2413) 2023-02-08 14:16:12 +08:00
21ebf48072 .gitignore updates (#2426) 2023-02-07 21:13:20 +08:00
2b90bcfab6 fix issue #2050: add -t option support for command gf docker to compatable with older version (#2423) 2023-02-07 17:41:43 +08:00
5f0641f348 fix issue #2015 (#2422) 2023-02-07 14:06:26 +08:00
38c9cac578 fix issue #2011 (#2421) 2023-02-07 11:37:39 +08:00
9ba49fa454 fix issue in gf run failed with arguments passed in windows platform (#2414) 2023-02-06 20:35:11 +08:00
39fede66e6 add label planned for ci to check issue inactive (#2408)
add label planned for ci to check issue inactive
2023-01-18 17:04:26 +08:00
d984f1a9d8 add auto go mod tidy after version upgraded for command up (#2407)
* add cli upgraded supported for command up

* improve unit case for package internal/mutex

* v2.3.1

* add auto  after version upgraded for command

Co-authored-by: houseme <housemecn@gmail.com>
2023-01-18 11:28:55 +08:00
Gin
28b8efe00c fix issue 2403 (#2404) 2023-01-18 10:17:16 +08:00
7b0fd6de9b add cli upgraded supported for command up (#2405)
* add cli upgraded supported for command up

* improve unit case for package internal/mutex

* v2.3.1

Co-authored-by: houseme <housemecn@gmail.com>
2023-01-18 10:12:00 +08:00
c0fa2e3a73 fix issue 2395 (#2399)
* v2.3.0

* fix #2391

* fix issue #2391

* fix issue #2395
2023-01-17 14:51:19 +08:00
3f6669e2b7 fix issue 2391 (#2398)
* v2.3.0

* fix #2391

* fix issue #2391
2023-01-16 16:00:18 +08:00
6ff4ed84e5 version v2.3.0 (#2392)
* v2.3.0

* up

* up

* up
2023-01-11 19:19:41 +08:00
5e72b03b0a feature/v2.3.0 (#2296)
* up

* rename function names for package gtcp/gudp; add proxy example for gtcp.Server (#2295)

* fix  router supported for handler of package ghttp; fix json tag name issue when it contains  for package goai

* add proxy example for http server

* rename function names for package gtcp/gudp; add proxy example for gtcp.Server

* move TX from struct to interface for package gdb (#2247)

* move TX from struct to interface for package gdb

* i updates

* up

* up

* fix comment

Co-authored-by: houseme <housemecn@gmail.com>

* move `go-redis` implements `Adapter` from package `gredis` to `contrib/nosql/redis`; add redis string operation functions for package `gredis` (#2240)

* unify configuration pattern of  for package gdb

* version updates

* improve implements `internal/rwmutex` and `internal/mutex`; add `TablesFields` cache implements in `gdb.Core` instead of `contrib/drivers`; add `ClearTableFields` and `ClearCache` functions for `gdb.Core` (#2128)

* add ClearTableFiels/ClearCache for Core of package gdb

* improve TableFields for contrib/drivers

* fix UT case for contrib/drivers/clickhouse

* remove unecessary attribute state for internal/rwmutex and internal/mutex

* add ClearTableFieldsAll/ClearCacheAll for gdb.Core

* improve clickhouse driver

* improve clickhouse driver

* fix ut

* feat: improve import

Co-authored-by: daguang <daguang830@gmail.com>
Co-authored-by: houseme <housemecn@gmail.com>

* refract builtin rules management mechanism, add `eq/not-eq/gt/gte/lt/lte/before/before-equal/after/after-equal/array/not-regex` rules for for package `gvalid` (#2133)

* refract builtin rules management for package gvalid

* refract builtin rules management for package gvalid

* refract builtin rules management for package gvalid

* add valiation rules  and  implements for package gvalid

* UT cases update for package gvalid

* improve error message of fields validation for package gvalid

* up

* add more validation rules for package gvalid

* add validation rule foreach for package gvalid (#2136)

* add ToSQL/CatchSQL funcions for package gdb (#2137)

* add ToSQL/CatchSQL funcions for package gdb

* Update gdb_core_underlying.go

* fix ci

Co-authored-by: houseme <housemecn@gmail.com>

* add redis interface for package gredis

* up

* remove `FilteredLink` function for DB and all driver implements and improve details for package gdb (#2142)

* fix: pgsql DoExec Transaction checks (#2101)

Co-authored-by: John Guo <john@johng.cn>

* improve package gdb

* up

* up

* up

* up

* up

* add DriverWrapper and DriverWarapperDB for package gdb

* add DriverWrapper and DriverWarapperDB for package gdb

* up

Co-authored-by: HaiLaz <739476267@qq.com>

* add new database driver `dm`

* add drivers dm

* upd go version

* add gf ci yaml

Co-authored-by: Xu <zhenghao.xu>

* move go-redis implements from package gredis to contrib/nosql/redis; add redis string operation functions for package gredis

* improve `contrib/drivers/dm` (#2144)

* improve contrib/drivers/dm

* format TODO list info

* 1) add config.Name is required
2) The upper layer no longer needs to specify the schema
3) Adjust unit tests

Co-authored-by: Xu <zhenghao.xu>
Co-authored-by: houseme <housemecn@gmail.com>

* move redis adapter related ut case from package gcache/gsession to package contrib/nosql/redis

* up

* up

* up

* up

* up

* improve comment

* add implements of `gcfg.Adapter` using kubernetes configmap (#2145)

* remove Logger from kubecm.Client

* README updates for package kubecm

* error message update for package gredis

* comment update for package gdb

* Feature/v2.2.0 gredis (#2155)

* improve package gredis (#2162)

* improve package gredis

* Update gredis_redis_group_list.go

* fix

* up

Co-authored-by: houseme <housemecn@gmail.com>

* up

* up

* up

* up

* up

* up

* add func Test_GroupScript_Eval

* ut cases for group string

* UT cases update for group script

* mv redis operation implements to contrib/nosql/redis from package gredis

* test: add redis group list unit test (#2248)

* test: add redis group list unit test

* improve comment

* test: fix redis group list unit test

Co-authored-by: houseme <housemecn@gmail.com>

* up

* add func Test_GroupGeneric_Copy, Test_GroupGeneric_Exists,Test_GroupGeneric_Type,Test_GroupGeneric_Unlink,Test_GroupGeneric_Rename,Test_GroupGeneric_Move,Test_GroupGeneric_Del

* add Redis GroupGeneric UnitTest (#2253)

add func Test_GroupGeneric_RandomKey,Test_GroupGeneric_DBSize,Test_GroupGeneric_Keys,Test_GroupGeneric_FlushDB,Test_GroupGeneric_FlushAll,Test_GroupGeneric_Expire,Test_GroupGeneric_ExpireAt

* hash test case completed (#2260)

Co-authored-by: junler <sunjun@bookan.com>

* add Redis GroupGeneric Unit Test part2 (#2258)

* up

* ci updates

* ci updates

* up

* Feature/contrib redis fsprouts (#2274)

* Feature/contrib redis starck (#2275)

* up

* up

* fix `/*` router supported for handler of package ghttp; fix json tag name issue when it contains `,` for package goai; add proxy example for http server (#2294)

* fix  router supported for handler of package ghttp; fix json tag name issue when it contains  for package goai

* add proxy example for http server

* fix: update szenius/set-timezone@v1.1 (#2293)

* add Tag* functions to retreive most commonly used tag value from struct field for package gstructs; use description tag as default value if brief is empty for gcmd.Argument (#2299)

* fix cache issue in Count/Value functions for gdb.Model (#2300)

* add Tag* functions to retreive most commonly used tag value from struct field for package gstructs; use description tag as default value if brief is empty for gcmd.Argument

* fix cache issue in Count/Value functions for gdb.Model

* add more ut case for package gdb

* version updates

* add minus of `start` parameter support for `gstr.Substr`, like the `substr` function in `PHP` (#2297)

* Make the substr like the substr in PHP

Make the substr like the substr in PHP

* Update gstr_z_unit_test.go

* Update gstr_z_unit_test.go

* Make the SubStrRune like the mb_substr in PHP

Make the SubStrRune like the mb_substr in PHP

* Update gstr_z_unit_test.go

* Update gstr_z_unit_test.go

* Update gins_z_unit_view_test.go

* Update gview_z_unit_test.go

* add ut cases for package gcode (#2307)

* add ut cases for package gerror (#2304)

* add ut cases for package gerror

* add ut cases for package gerror

* add ut cases for package gtime (#2303)

* add ut cases for package gtime

* add ut cases for package gtime

* add ut cases for package gtime

* add ut cases for package glog (#2302)

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* change result data type of function Count from int to int64 for package gdb (#2298)

* feat: modify model count value int64

* fix

* fix:modify int64

* fix

* feat: cmd gf prebuild suport oracle (#2312)

* add ut cases for package g (#2315)

* add ut cases for package gdebug (#2313)

* add ut cases for package gdebug

* add ut cases for package gdebug

* add ut cases for package gdebug

Co-authored-by: houseme <housemecn@gmail.com>

* add zookeeper registry support (#2284)

* add ut cases for package glog part2 (#2317)

* fix invalid UpdatedAt usage in soft deleting feature for package gdb (#2323)

* fix issue in failed installing when there's shortcut between file paths for command install (#2326)

* fix issue in failed installing when has shortcut between file paths for command install

* version updates

* template for command gf updates

* improve lru clearing for package gcache (#2327)

* add ut cases for package ghttp_middleware and ghttp_request (#2344)

* add ut cases for package ghttp_middleware

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request

* add ut cases for package ghttp_response (#2352)

* add ut cases for package ghttp_response

* add ut cases for package ghttp_response

* add ut cases for package ghttp_response

* add ut cases for package ghttp_request (#2351)

* add ut cases for package ghttp_middleware

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request - form

* add ut cases for package ghttp_request - query

* add ut cases for package ghttp_request - request

* add ut cases for package ghttp_request - router

* add ut cases for package gcache (#2341)

* gTcp Example Function:
1.NewConn 2.NewConnTLS 3.NewConnKeyCrt

* gTcp Example Function:
1.Send

* add example function ExampleConn_Recv and ExampleConn_RecvWithTimeout

* add example function
1. ExampleConn_SendWithTimeout
2. ExampleConn_RecvLine
3. ExampleConn_RecvTill

* add example function
1. ExampleConn_SendRecv
2. ExampleConn_SendRecvWithTimeout
3. ExampleConn_SetDeadline
4. ExampleConn_SetReceiveBufferWait

* add gtcp test function
1. Test_Package_Option_HeadSize4
2. Test_Package_Option_Error

* add gtcp example function
1. ExampleGetFreePorts
2. ExampleSend
3. ExampleSendRecv
4. ExampleSendWithTimeout
5. ExampleSendRecvWithTimeout
6. ExampleMustGetFreePort

* add gtcp example function
1. ExampleSendPkg
2. ExampleSendRecvPkg
3. ExampleSendPkgWithTimeout
4. ExampleSendRecvPkgWithTimeout

* add gtcp test function
1. Test_Pool_Send
2. Test_Pool_Recv
3. Test_Pool_RecvLine
4. Test_Pool_RecvTill
5. Test_Pool_RecvWithTimeout
6. Test_Pool_SendWithTimeout
7. Test_Pool_SendRecvWithTimeout

* fix

* add gtcp example function
1. ExampleGetServer
2. ExampleSetAddress
3. ExampleSetHandler
4. ExampleRun_NilHandle

* exec CI

* exec CI

* exec CI

* modify test server address

* modify and exec CI

* modify and exec CI

* modify and exec CI

* modify and exec CI

* modify and exec CI

* modify and exec CI

* add example funcion ExampleConn_Recv_Once and fix

* fix

* add some error case in example function

* add some error case in example function

* 1.add example function ExampleNewServerKeyCrt
2.add function SendRecvPkgWithTimeout unit test

* add function Test_Server_NewServerKeyCrt unit test

* revert

* add function Test_Package_Timeout, Test_Package_Option_HeadSize3, Test_Conn_RecvPkgError unit test

* fix

* add example function
1.ExampleClient_Clone
2.ExampleLoadKeyCrt

* add example function
1.ExampleNewNetConnKeyCrt

* fix

* add example function
1.ExampleClient_DeleteBytes
2.ExampleClient_HeadBytes
3.ExampleClient_PatchBytes
4.ExampleClient_ConnectBytes
5.ExampleClient_OptionsBytes
6.ExampleClient_TraceBytes
7.ExampleClient_PutBytes

* add example function
1.ExampleClient_Prefix
2.ExampleClient_Retry
3.ExampleClient_RedirectLimit

* add example function
1.ExampleClient_SetBrowserMode
2.ExampleClient_SetHeader
3.ExampleClient_SetRedirectLimit

* add example function
1.ExampleClient_SetTLSKeyCrt
2.ExampleClient_SetTLSConfig
modify example funcion
1.ExampleClient_SetProxy
2.ExampleClient_Proxy

* add example function
1.ExampleClient_PutContent
2.ExampleClient_DeleteContent
3.ExampleClient_HeadContent
4.ExampleClient_PatchContent
5.ExampleClient_ConnectContent
6.ExampleClient_OptionsContent
7.ExampleClient_TraceContent
8.ExampleClient_RequestContent

* add example function
1.ExampleClient_RawRequest

* add unit function
1.TestGetFreePorts
2.TestNewConn
3.TestNewConnTLS
4.TestNewConnKeyCrt
5.TestConn_SendWithTimeout

* add unit function
1.TestConn_Send
2.TestConn_SendRecv
3.TestConn_SendRecvWithTimeout

* modify

* modify

* add example function
1.TestConn_SetReceiveBufferWait
2.TestNewNetConnKeyCrt
3.TestSend

* add example function
1.TestSendRecv
2.TestSendWithTimeout

* add unit function
1.TestMustGetFreePort
2.TestSendRecvWithTimeout
3.TestSendPkg

* add client recevied server's response content assert

* modify

* modify

* add example function
1.TestSendRecvPkg
2.TestSendPkgWithTimeout
3.TestSendRecvPkgWithTimeout

* add GetAddress() function
add unit funciton
1.TestNewServer
2.TestGetServer
3.TestServer_SetAddress
4.TestServer_SetHandler
5.TestServer_Run

* modify

* modify

* add unit funciton
1.TestLoadKeyCrt

* modify

* delete function fromHex

* add gclient dump unit test

* add example function
1.ExampleClient_Put
2.ExampleClient_Delete
3.ExampleClient_Head
4.ExampleClient_Patch
5.ExampleClient_Connect
6.ExampleClient_Options
7.ExampleClient_Trace

* add example function
1.TestClient_DoRequest

* add example function
1.ExampleClient_PutVar
2.ExampleClient_DeleteVar
3.ExampleClient_HeadVar
4.ExampleClient_PatchVar
5.ExampleClient_ConnectVar
6.ExampleClient_OptionsVar
7.ExampleClient_TraceVar

* modify

* modify

* add CustomProvider function

* modify

* add unit funciton
1.Test_NewConn
2.Test_GetFreePorts

* add unit funciton
1.Test_Server

* garray_normal_any code converage

* garray_normal_int code converage

* garray_normal_str code converage

* garray_sorted_any code converage

* garray_sorted_int code converage

* garray_sorted_str code converage

* glist code converage

* gmap, gmap_hash_any_any_map code converage

* gmap_hash_int_any_map code converage

* gmap_hash_int_any_map code converage

* gmap_hash_int_int_map code converage

* gmap_hash_int_str_map code converage

* gmap_hash_str_any_map code converage

* gmap_hash_str_int_map code converage

* gmap_hash_str_str_map code converage

* gmap_list_map code converage

* gmap_list_map code converage

* revert gf.yml

* add gtest unit test function

* add ut cases for package gcache

* add ut cases for package gcache

* add ut cases for package gcache

* add ut cases for package gcache

* add ut cases for package gcache

* modify

Co-authored-by: John Guo <john@johng.cn>

* improve ut case for package internal/rwmutex (#2364)

* fix issue when only one file was uploaded in batch receiver attribute (#2365)

* fix fixed An error occurred when only one file was uploaded in batches and add unit testing(#2092)

* fix issue uploading files for ghttp.Server

Co-authored-by: yxh <yxh1103@qq.com>

* fix issue #2334 when accessing static files with cache time (#2366)

* Solve the problem of error when accessing static files with cache time.
Error message:
2022-11-29 19:40:11.090 [ERRO] http: superfluous response.WriteHeader call from github.com/gogf/gf/v2/net/ghttp.(*ResponseWriter).Flush (ghttp_response_writer.go:58)
Stack:

Verification method:
curl 'http://127.0.0.1:8000/' -H 'If-Modified-Since: Thu, 08 Dec 2022 03:13:55 GMT' --compressed

* Solve the problem of error when accessing static files with cache time.
Error message:
2022-11-29 19:40:11.090 [ERRO] http: superfluous response.WriteHeader call from github.com/gogf/gf/v2/net/ghttp.(*ResponseWriter).Flush (ghttp_response_writer.go:58)
Stack:

Verification method:
curl 'http://127.0.0.1:8000/' -H 'If-Modified-Since: Thu, 08 Dec 2022 03:13:55 GMT' --compressed

* Solve the problem of error when accessing static files with cache time.
Error message:
2022-11-29 19:40:11.090 [ERRO] http: superfluous response.WriteHeader call from github.com/gogf/gf/v2/net/ghttp.(*ResponseWriter).Flush (ghttp_response_writer.go:58)
Stack:

Verification method:
curl 'http://127.0.0.1:8000/' -H 'If-Modified-Since: Thu, 08 Dec 2022 03:13:55 GMT' --compressed

* fix issue #2334 when accessing static files with cache time

* up

Co-authored-by: 曾洪亮 <hongliang.zeng@i-soft.com.cn>
Co-authored-by: houseme <housemecn@gmail.com>

* fix issue in cycle dumping for g.Dump (#2367)

* fix issue in cycle dumping for g.Dump

* up

* up

* up

Co-authored-by: houseme <housemecn@gmail.com>

* 由于 clickhouse 的 position的初始值为 1,导致gdb_core_utility.HasField 中对 fieldsArray 初始化出错 (#2346)

* 由于 clickhouse 的 position的初始值为 1,导致gdb_core_utility.HasField 中对 fieldsArray 初始化出错

* 修复单元测试

* 修复单元测试

* 补充单元测试

* 增加CK防御性代码

Co-authored-by: longl <longlei@dealmap.cloud>
Co-authored-by: houseme <housemecn@gmail.com>

* fix: ghttp server static path config (#2335)

Co-authored-by: daguang <daguang830@gmail.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: ftl <1139556759@qq.com>
Co-authored-by: HaiLaz <739476267@qq.com>
Co-authored-by: zhonghuaxunGM <50815786+zhonghuaxunGM@users.noreply.github.com>
Co-authored-by: huangqian <huangqian1985@qq.com>
Co-authored-by: junler <827640651@qq.com>
Co-authored-by: junler <sunjun@bookan.com>
Co-authored-by: Starccck <28645972+starccck@users.noreply.github.com>
Co-authored-by: Jinhongyu <30454170+cnjinhy@users.noreply.github.com>
Co-authored-by: YuanXin Hu <huyuanxin1999@outlook.com>
Co-authored-by: yxh <yxh1103@qq.com>
Co-authored-by: 曾洪亮 <hongliang.zeng@i-soft.com.cn>
Co-authored-by: long <48313408+qq375251855@users.noreply.github.com>
Co-authored-by: longl <longlei@dealmap.cloud>

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: daguang <daguang830@gmail.com>
Co-authored-by: ftl <1139556759@qq.com>
Co-authored-by: HaiLaz <739476267@qq.com>
Co-authored-by: zhonghuaxunGM <50815786+zhonghuaxunGM@users.noreply.github.com>
Co-authored-by: huangqian <huangqian1985@qq.com>
Co-authored-by: junler <827640651@qq.com>
Co-authored-by: junler <sunjun@bookan.com>
Co-authored-by: Starccck <28645972+starccck@users.noreply.github.com>
Co-authored-by: Jinhongyu <30454170+cnjinhy@users.noreply.github.com>
Co-authored-by: YuanXin Hu <huyuanxin1999@outlook.com>
Co-authored-by: yxh <yxh1103@qq.com>
Co-authored-by: 曾洪亮 <hongliang.zeng@i-soft.com.cn>
Co-authored-by: long <48313408+qq375251855@users.noreply.github.com>
Co-authored-by: longl <longlei@dealmap.cloud>
2023-01-09 14:43:10 +08:00
4bb88027d8 improve function SetTimeZone for package gtime (#2389)
* improve logging feature, add LevelPrint configuration for glog.Logger; add package internal/instance

* improve command build

* add default logger for panic message printing if no logger set

* up

* fix scheduler when timer triggers in less than one second for package gcron

* up

* improve function SetTimeZone for package gtime

* improve function SetTimeZone for package gtime

* improve function SetTimeZone for package gtime

* up
2023-01-09 14:36:42 +08:00
ae4f14c2e2 add LevelPrint configuration for glog.Logger; add package internal/instance for grouped instance management feature; add default logger for panic message printing if no logger set in gcron.Cron (#2388)
* improve logging feature, add LevelPrint configuration for glog.Logger; add package internal/instance

* improve command build

* add default logger for panic message printing if no logger set

* up

* fix scheduler when timer triggers in less than one second for package gcron

* up
2023-01-06 14:15:30 +08:00
5a8b33fa09 fix gf.yaml (#2385)
* fix gf.yaml

* up
2023-01-03 14:33:41 +08:00
5884a0e05f fix issue #2381 (#2382)
* fix issue #2381

* up

* up
2023-01-03 11:00:23 +08:00
31e44062a8 revert from int64 to int for returning value of Count (#2378)
* revert from int64 to int for returning value of Count

* up

* up

* up
2022-12-30 16:54:43 +08:00
87cb1c9b8e add security tag support for openapi (#2377)
* support openapi path security

* add security path test case

* go format

* fix test case

* add doc for security
2022-12-29 20:56:20 +08:00
0266d24d0a fix Unknown setting charset for clickhouse driver (#2375) 2022-12-27 14:46:15 +08:00
0876e00eb8 fix issue in NewIntArrayRange function for package garray (#2374) 2022-12-26 19:28:01 +08:00
85c4794ceb fix BuildParams with urlEncode when len(v) <= 6 (#2308)
* fix: check urlEncode when len(v) <= 6

* fix BuildParams with urlEncode when len(v) <= 6

* fix BuildParams with urlEncode when len(v) <= 6

Co-authored-by: Prime Xiao <primexiao.dev@gmail.com>
2022-12-23 10:33:28 +08:00
e007bf35b2 parseConfigNodeLink support Chinese database name #2231 (#2238) 2022-12-22 17:33:51 +08:00
74e968e93b fix: ghttp server static path config (#2335) 2022-12-22 17:21:33 +08:00
18507fb836 由于 clickhouse 的 position的初始值为 1,导致gdb_core_utility.HasField 中对 fieldsArray 初始化出错 (#2346)
* 由于 clickhouse 的 position的初始值为 1,导致gdb_core_utility.HasField 中对 fieldsArray 初始化出错

* 修复单元测试

* 修复单元测试

* 补充单元测试

* 增加CK防御性代码

Co-authored-by: longl <longlei@dealmap.cloud>
Co-authored-by: houseme <housemecn@gmail.com>
2022-12-22 17:00:08 +08:00
3b245837b9 fix issue in cycle dumping for g.Dump (#2367)
* fix issue in cycle dumping for g.Dump

* up

* up

* up

Co-authored-by: houseme <housemecn@gmail.com>
2022-12-22 14:43:02 +08:00
a853984f52 fix issue #2334 when accessing static files with cache time (#2366)
* Solve the problem of error when accessing static files with cache time.
Error message:
2022-11-29 19:40:11.090 [ERRO] http: superfluous response.WriteHeader call from github.com/gogf/gf/v2/net/ghttp.(*ResponseWriter).Flush (ghttp_response_writer.go:58)
Stack:

Verification method:
curl 'http://127.0.0.1:8000/' -H 'If-Modified-Since: Thu, 08 Dec 2022 03:13:55 GMT' --compressed

* Solve the problem of error when accessing static files with cache time.
Error message:
2022-11-29 19:40:11.090 [ERRO] http: superfluous response.WriteHeader call from github.com/gogf/gf/v2/net/ghttp.(*ResponseWriter).Flush (ghttp_response_writer.go:58)
Stack:

Verification method:
curl 'http://127.0.0.1:8000/' -H 'If-Modified-Since: Thu, 08 Dec 2022 03:13:55 GMT' --compressed

* Solve the problem of error when accessing static files with cache time.
Error message:
2022-11-29 19:40:11.090 [ERRO] http: superfluous response.WriteHeader call from github.com/gogf/gf/v2/net/ghttp.(*ResponseWriter).Flush (ghttp_response_writer.go:58)
Stack:

Verification method:
curl 'http://127.0.0.1:8000/' -H 'If-Modified-Since: Thu, 08 Dec 2022 03:13:55 GMT' --compressed

* fix issue #2334 when accessing static files with cache time

* up

Co-authored-by: 曾洪亮 <hongliang.zeng@i-soft.com.cn>
Co-authored-by: houseme <housemecn@gmail.com>
2022-12-22 10:25:30 +08:00
00c544ee99 fix issue when only one file was uploaded in batch receiver attribute (#2365)
* fix fixed An error occurred when only one file was uploaded in batches and add unit testing(#2092)

* fix issue uploading files for ghttp.Server

Co-authored-by: yxh <yxh1103@qq.com>
2022-12-21 10:38:19 +08:00
e7b9e41a5e improve ut case for package internal/rwmutex (#2364) 2022-12-20 15:56:29 +08:00
e254b4f3c0 add ut cases for package gcache (#2341)
* gTcp Example Function:
1.NewConn 2.NewConnTLS 3.NewConnKeyCrt

* gTcp Example Function:
1.Send

* add example function ExampleConn_Recv and ExampleConn_RecvWithTimeout

* add example function
1. ExampleConn_SendWithTimeout
2. ExampleConn_RecvLine
3. ExampleConn_RecvTill

* add example function
1. ExampleConn_SendRecv
2. ExampleConn_SendRecvWithTimeout
3. ExampleConn_SetDeadline
4. ExampleConn_SetReceiveBufferWait

* add gtcp test function
1. Test_Package_Option_HeadSize4
2. Test_Package_Option_Error

* add gtcp example function
1. ExampleGetFreePorts
2. ExampleSend
3. ExampleSendRecv
4. ExampleSendWithTimeout
5. ExampleSendRecvWithTimeout
6. ExampleMustGetFreePort

* add gtcp example function
1. ExampleSendPkg
2. ExampleSendRecvPkg
3. ExampleSendPkgWithTimeout
4. ExampleSendRecvPkgWithTimeout

* add gtcp test function
1. Test_Pool_Send
2. Test_Pool_Recv
3. Test_Pool_RecvLine
4. Test_Pool_RecvTill
5. Test_Pool_RecvWithTimeout
6. Test_Pool_SendWithTimeout
7. Test_Pool_SendRecvWithTimeout

* fix

* add gtcp example function
1. ExampleGetServer
2. ExampleSetAddress
3. ExampleSetHandler
4. ExampleRun_NilHandle

* exec CI

* exec CI

* exec CI

* modify test server address

* modify and exec CI

* modify and exec CI

* modify and exec CI

* modify and exec CI

* modify and exec CI

* modify and exec CI

* add example funcion ExampleConn_Recv_Once and fix

* fix

* add some error case in example function

* add some error case in example function

* 1.add example function ExampleNewServerKeyCrt
2.add function SendRecvPkgWithTimeout unit test

* add function Test_Server_NewServerKeyCrt unit test

* revert

* add function Test_Package_Timeout, Test_Package_Option_HeadSize3, Test_Conn_RecvPkgError unit test

* fix

* add example function
1.ExampleClient_Clone
2.ExampleLoadKeyCrt

* add example function
1.ExampleNewNetConnKeyCrt

* fix

* add example function
1.ExampleClient_DeleteBytes
2.ExampleClient_HeadBytes
3.ExampleClient_PatchBytes
4.ExampleClient_ConnectBytes
5.ExampleClient_OptionsBytes
6.ExampleClient_TraceBytes
7.ExampleClient_PutBytes

* add example function
1.ExampleClient_Prefix
2.ExampleClient_Retry
3.ExampleClient_RedirectLimit

* add example function
1.ExampleClient_SetBrowserMode
2.ExampleClient_SetHeader
3.ExampleClient_SetRedirectLimit

* add example function
1.ExampleClient_SetTLSKeyCrt
2.ExampleClient_SetTLSConfig
modify example funcion
1.ExampleClient_SetProxy
2.ExampleClient_Proxy

* add example function
1.ExampleClient_PutContent
2.ExampleClient_DeleteContent
3.ExampleClient_HeadContent
4.ExampleClient_PatchContent
5.ExampleClient_ConnectContent
6.ExampleClient_OptionsContent
7.ExampleClient_TraceContent
8.ExampleClient_RequestContent

* add example function
1.ExampleClient_RawRequest

* add unit function
1.TestGetFreePorts
2.TestNewConn
3.TestNewConnTLS
4.TestNewConnKeyCrt
5.TestConn_SendWithTimeout

* add unit function
1.TestConn_Send
2.TestConn_SendRecv
3.TestConn_SendRecvWithTimeout

* modify

* modify

* add example function
1.TestConn_SetReceiveBufferWait
2.TestNewNetConnKeyCrt
3.TestSend

* add example function
1.TestSendRecv
2.TestSendWithTimeout

* add unit function
1.TestMustGetFreePort
2.TestSendRecvWithTimeout
3.TestSendPkg

* add client recevied server's response content assert

* modify

* modify

* add example function
1.TestSendRecvPkg
2.TestSendPkgWithTimeout
3.TestSendRecvPkgWithTimeout

* add GetAddress() function
add unit funciton
1.TestNewServer
2.TestGetServer
3.TestServer_SetAddress
4.TestServer_SetHandler
5.TestServer_Run

* modify

* modify

* add unit funciton
1.TestLoadKeyCrt

* modify

* delete function fromHex

* add gclient dump unit test

* add example function
1.ExampleClient_Put
2.ExampleClient_Delete
3.ExampleClient_Head
4.ExampleClient_Patch
5.ExampleClient_Connect
6.ExampleClient_Options
7.ExampleClient_Trace

* add example function
1.TestClient_DoRequest

* add example function
1.ExampleClient_PutVar
2.ExampleClient_DeleteVar
3.ExampleClient_HeadVar
4.ExampleClient_PatchVar
5.ExampleClient_ConnectVar
6.ExampleClient_OptionsVar
7.ExampleClient_TraceVar

* modify

* modify

* add CustomProvider function

* modify

* add unit funciton
1.Test_NewConn
2.Test_GetFreePorts

* add unit funciton
1.Test_Server

* garray_normal_any code converage

* garray_normal_int code converage

* garray_normal_str code converage

* garray_sorted_any code converage

* garray_sorted_int code converage

* garray_sorted_str code converage

* glist code converage

* gmap, gmap_hash_any_any_map code converage

* gmap_hash_int_any_map code converage

* gmap_hash_int_any_map code converage

* gmap_hash_int_int_map code converage

* gmap_hash_int_str_map code converage

* gmap_hash_str_any_map code converage

* gmap_hash_str_int_map code converage

* gmap_hash_str_str_map code converage

* gmap_list_map code converage

* gmap_list_map code converage

* revert gf.yml

* add gtest unit test function

* add ut cases for package gcache

* add ut cases for package gcache

* add ut cases for package gcache

* add ut cases for package gcache

* add ut cases for package gcache

* modify

Co-authored-by: John Guo <john@johng.cn>
2022-12-20 14:49:31 +08:00
b0c9c68c9c add ut cases for package ghttp_request (#2351)
* add ut cases for package ghttp_middleware

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request - form

* add ut cases for package ghttp_request - query

* add ut cases for package ghttp_request - request

* add ut cases for package ghttp_request - router
2022-12-12 10:28:58 +08:00
1030434ce6 add ut cases for package ghttp_response (#2352)
* add ut cases for package ghttp_response

* add ut cases for package ghttp_response

* add ut cases for package ghttp_response
2022-12-12 10:28:35 +08:00
2f08c4b00f add ut cases for package ghttp_middleware and ghttp_request (#2344)
* add ut cases for package ghttp_middleware

* add ut cases for package ghttp_request

* add ut cases for package ghttp_request
2022-12-07 20:02:46 +08:00
4553f90a83 improve lru clearing for package gcache (#2327) 2022-11-25 10:45:56 +08:00
ef7fec7e24 fix issue in failed installing when there's shortcut between file paths for command install (#2326)
* fix issue in failed installing when has shortcut between file paths for command install

* version updates

* template for command gf updates
2022-11-25 10:34:00 +08:00
0a76b9c61b fix invalid UpdatedAt usage in soft deleting feature for package gdb (#2323) 2022-11-24 21:23:15 +08:00
fbeb8f81ac add ut cases for package glog part2 (#2317) 2022-11-21 10:32:08 +08:00
62af4f1c2c add zookeeper registry support (#2284) 2022-11-18 14:07:17 +08:00
ed43efe4fb add ut cases for package gdebug (#2313)
* add ut cases for package gdebug

* add ut cases for package gdebug

* add ut cases for package gdebug

Co-authored-by: houseme <housemecn@gmail.com>
2022-11-18 14:05:39 +08:00
1cb42c32e3 add ut cases for package g (#2315) 2022-11-18 14:05:16 +08:00
628b454ebc feat: cmd gf prebuild suport oracle (#2312) 2022-11-17 21:07:12 +08:00
38a858d7d3 change result data type of function Count from int to int64 for package gdb (#2298)
* feat: modify model count value int64

* fix

* fix:modify int64

* fix
2022-11-17 19:47:17 +08:00
83b92ddfa4 add ut cases for package glog (#2302)
* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog

* add ut cases for package glog
2022-11-17 19:44:48 +08:00
7cd415b1df add ut cases for package gtime (#2303)
* add ut cases for package gtime

* add ut cases for package gtime

* add ut cases for package gtime
2022-11-17 19:44:20 +08:00
d2113b4d23 add ut cases for package gerror (#2304)
* add ut cases for package gerror

* add ut cases for package gerror
2022-11-17 19:43:54 +08:00
d445987f95 add ut cases for package gcode (#2307) 2022-11-17 19:43:04 +08:00
14d2d747f6 add minus of start parameter support for gstr.Substr, like the substr function in PHP (#2297)
* Make the substr like the substr in PHP

Make the substr like the substr in PHP

* Update gstr_z_unit_test.go

* Update gstr_z_unit_test.go

* Make the SubStrRune like the mb_substr in PHP

Make the SubStrRune like the mb_substr in PHP

* Update gstr_z_unit_test.go

* Update gstr_z_unit_test.go

* Update gins_z_unit_view_test.go

* Update gview_z_unit_test.go
2022-11-16 10:10:59 +08:00
73dc8c9c4b fix cache issue in Count/Value functions for gdb.Model (#2300)
* add Tag* functions to retreive most commonly used tag value from struct field for package gstructs; use description tag as default value if brief is empty for gcmd.Argument

* fix cache issue in Count/Value functions for gdb.Model

* add more ut case for package gdb

* version updates
2022-11-16 10:04:49 +08:00
576f1a798c add Tag* functions to retreive most commonly used tag value from struct field for package gstructs; use description tag as default value if brief is empty for gcmd.Argument (#2299) 2022-11-15 17:05:34 +08:00
78fa2d2e3b fix: update szenius/set-timezone@v1.1 (#2293) 2022-11-14 19:58:17 +08:00
9402cc8c6a fix /* router supported for handler of package ghttp; fix json tag name issue when it contains , for package goai; add proxy example for http server (#2294)
* fix  router supported for handler of package ghttp; fix json tag name issue when it contains  for package goai

* add proxy example for http server
2022-11-14 19:57:39 +08:00
7d1a508ea9 improve ut case for package gcache/gpool (#2290)
* improve ut case for package gcache/gpool

* up
2022-11-12 10:49:48 +08:00
b84034b667 fix: gcache MustGetOrSetFunc error (#2291) 2022-11-10 20:34:48 +08:00
84b7cbd992 ci: action update (#2289) 2022-11-10 20:26:57 +08:00
bc8ca912ce fix: gcron check if the predefined patterns fail (#2288) 2022-11-10 19:59:09 +08:00
b61baa1efc add ut cases for package gconv part2 (#2282) 2022-11-10 19:58:03 +08:00
c4a5bc8584 style(test): Unify the indentation format of SQL strings in clickhouse_test (#2277)
style(test): Unify the indentation format of SQL strings
2022-11-10 19:57:15 +08:00
8c71d579b5 add command fix and up (#2280) 2022-11-10 19:56:12 +08:00
2e8d8f63ff fix IsSubDomain method error (#2283)
Co-authored-by: weiwei3 <weiwei3@37.com>
2022-11-10 19:47:43 +08:00
91b94878d3 fix used schema not change in nested transaction when used different schemas (#2279)
* fix used schema not change in nested transaction between different schemas

* up

Co-authored-by: houseme <housemecn@gmail.com>
2022-11-10 09:55:08 +08:00
b000aa3dfe add supervisor for package grpool (#2252)
* add supervisor for package grpool

* up
2022-11-08 19:00:16 +08:00
582c6eaef9 gtest model unit test (#2267) 2022-11-07 17:56:33 +08:00
4f4109cdb6 fix typo for comments (#2268)
* Modify comment syntax error

* Modify comment syntax error
2022-11-07 17:55:49 +08:00
9f12673631 add ut cases for package gconv (#2272)
* improve gconv.go code coverage

* improve gconv_convert.go code coverage

* improve gconv_float.go code coverage

* improve gconv_map.go code coverage

* improve gconv_maps.go code coverage

* improve gconv_maptomap.go code coverage

* improve gconv_maptomaps.go code coverage
2022-11-07 17:53:51 +08:00
d37b75442d feat: modify sql count value int64 (#2266) 2022-11-07 17:52:25 +08:00
ee58255418 move common used tag from packages to package gtag for maintainability (#2256)
* move common used tag from packages to package gtag for maintainability

* move common used tag from packages to package gtag for maintainability

Co-authored-by: houseme <housemecn@gmail.com>
2022-11-07 17:51:37 +08:00
033ba588c9 fix redis ci yaml (#2269) 2022-11-05 10:23:52 +08:00
60d8283971 fix router parameters handling by auto url decoding (#2262)
improve router parameters handling by auto url decoding
2022-11-04 15:03:27 +08:00
ad90bc2809 version.go updates (#2259) 2022-11-04 11:33:31 +08:00
a1b9eca7b6 fix issue #2244 (#2257)
* fix issue #2244

* ut update for package gtime

* golangci updates
2022-11-03 21:17:28 +08:00
c4a5b8ca94 fix issue 1915 and repeated link instance key for package gdb (#2250)
* fix issue #1915

* fix issue in repeated link instance key

* add configuration item Namespace for package gdb

* up

* up

* fix: pgsql list table names (#2255)

Co-authored-by: Gin <qinyuguang@gmail.com>
2022-11-03 20:22:36 +08:00
ab79134309 add schema name in debug logging content; add master-slave ut case for package gdb (#2249)
* add schema name in debug logging content; add master-slave ut case for package gdb

* add schema name in debug logging content; add master-slave ut case for package gdb
2022-11-02 21:55:58 +08:00
63c3e8396b attach and export real handler for request (#2220)
* attach and export real handler for request

* add note

* rename HandlerParsedItem to HandlerItemParsed

Co-authored-by: John Guo <john@johng.cn>
2022-11-01 20:17:59 +08:00
1793bf0863 add golangci feature to guarantee codes quality (#2229) 2022-11-01 20:12:21 +08:00
Gin
8e0e87877a feat: add gcfg.Adapter implements using nacos service (#2232)
* feat: add `gcfg.Adapter` implements using nacos service

* Update gf.yml

* Update gf.yml

Co-authored-by: John Guo <john@johng.cn>
2022-10-26 18:45:35 +08:00
425b31c6fd improve nil receiver handling for package gtime (#2226)
* improve nil receiver handling for package gtime

* CI updates

* CI updates
2022-10-26 18:37:40 +08:00
4da469325d fix gen dao oracle entity bug (#2219)
Co-authored-by: John Guo <john@johng.cn>
2022-10-26 18:37:06 +08:00
33fdde6afd opt: parameter verification of optimized handler methods (#2224) 2022-10-20 19:36:01 +08:00
ee6103418b auto creating error with code in ghttp.MiddlewareHandlerResponse when there's no 200 http status code (#2223) 2022-10-20 15:50:17 +08:00
038548c188 v2.2.1 (#2222) 2022-10-18 20:32:28 +08:00
ce8b536fca Parse database empty json field to empty object( fix issue 2105 ) (#2213)
* Parse database empty json field to empty object( fix issue 2105 )

* fix issue #2105

Co-authored-by: Xu <zhenghao.xu>
Co-authored-by: John Guo <john@johng.cn>
2022-10-18 19:13:55 +08:00
8e5a03f6c9 add Ptr* functions for package gconv (#2206)
* add Ptr* functions for package gconv

* delete binary file

* revert changes for file gconv.go

Co-authored-by: houseme <housemecn@gmail.com>
2022-10-18 19:13:14 +08:00
1c5fd1a1f7 improve ut cases for package contrib/drivers/mysql (#2216)
* improve ut cases for package contrib/drivers/mysql

* improve logging for database Open
2022-10-17 15:43:22 +08:00
2598745e50 fix issue #1971 (#2203)
Co-authored-by: houseme <housemecn@gmail.com>
2022-10-14 10:10:27 +08:00
e756f284be Add test for clickhouse #1815 (#2200) 2022-10-13 20:34:44 +08:00
c6a02b850d fix issue #1934 (#2193) 2022-10-13 19:13:10 +08:00
55e8dbe9fd remove repeated error stack file lines among stacks for package gerror (#2199)
* remove repeated error stack file lines among stacks for package gerror

* fix nil pointer error for package gerror
2022-10-13 19:12:01 +08:00
5efa5ebd2f fix issue #1946 (#2194)
* fix issue #1946

* fix issue #1946
2022-10-12 20:31:03 +08:00
4ebe4233fc fix issue of OmitEmptyWhere in Builder for package gdb (#2195) 2022-10-12 20:30:47 +08:00
35623b5abe fix: modify Polaris config readme.md (#2186)
* fix: modify polaris config readme.md

* modify readme.md ,add License

* feat: add License
2022-10-11 19:27:26 +08:00
b617d399b6 fix info content when listens on port :0 for ghttp.Server (#2191) 2022-10-11 19:20:39 +08:00
b96b5c3f7c fix: pgsql driver check local type error (#2192) 2022-10-11 19:20:16 +08:00
847f016cc9 new version v2.2.0 (#2185) 2022-10-10 20:15:17 +08:00
c613dc8c5c feat: temporarily disable the unit testing of the Polaris configuration center (#2183)
* feat: temporarily annotate the unit test of Polaris configuration Center

* fix: remove
2022-10-09 21:42:32 +08:00
182a393050 package comments and readme update (#2182) 2022-10-09 21:23:55 +08:00
6cb91021cf feat: create polaris config (#2170)
* feat: create polaris config

* feat: improve code

* feat: modify config file path

Co-authored-by: John Guo <john@johng.cn>
2022-10-09 19:20:33 +08:00
2be9bb970b add function ZipPathContent for package gcompress (#2179)
add function ZipPathContent for package gcompress
2022-10-09 19:19:10 +08:00
ea396a3925 feat: improve glog for polaris register (#2178)
feat: improve glog
2022-10-09 09:10:02 +08:00
b1611fee1b improve port listening for ghttp.Server (#2175)
* version updates

* fix issue #2172

* improve port listening for ghttp.Server

* UT cases update

* UT cases update

* add GetListenedPort/GetListenedAddress for gtcp.Server

* UT cases update for package gudp

* up
2022-10-08 21:45:21 +08:00
dba903c13b add WithUUID for package gtrace (#2176)
* add WithUUID for package gtrace

* feat: improve import

Co-authored-by: houseme <housemecn@gmail.com>
2022-10-08 21:44:42 +08:00
7cb5fbe684 fix issue #1965 (#2177) 2022-10-08 21:42:30 +08:00
d7ae5624c8 fix issue #1965 (#2174)
Co-authored-by: houseme <housemecn@gmail.com>
2022-10-08 19:36:05 +08:00
f1455ad37a fix issue #2172 (#2173)
* version updates

* fix issue #2172
2022-10-08 11:46:38 +08:00
127e8af6a6 add gcfg.Adapter implements using apollo service (#2165)
* version updates

* up

* add watch feature for package kubecm

* feat: support apollo as Adapter (#2143)

* feat: support apollo as Adapter

* feat: support apollo as Adapter

* feat: support apollo as Adapter

* feat: test apollo Adapter

* feat: test apollo Adapter

Co-authored-by: hongyihui <hongyihui@lixiang.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: John Guo <john@johng.cn>

* add gcfg.Adapter implements using apollo service

* ci yaml update for apollo

Co-authored-by: hong0220 <hong0220@users.noreply.github.com>
Co-authored-by: hongyihui <hongyihui@lixiang.com>
Co-authored-by: houseme <housemecn@gmail.com>
2022-09-30 18:19:52 +08:00
d9be1d0b52 add watch feature for package kubecm (#2164)
* version updates

* up

* add watch feature for package kubecm
2022-09-30 17:36:40 +08:00
6cd84e8276 fix configuration management for package gdb (#2163) 2022-09-30 15:41:51 +08:00
ceaeceadd9 add local db configuration support for package gdb (#2161)
* version updates

* add local db configuration support for package gdb

* add local db configuration support for package gdb

* add local db configuration support for package gdb
2022-09-29 11:58:03 +08:00
cd5bf7c504 Feature/driver-dm fix something is invalid in dm (#2158)
* fix core.hasfield error index out of range & fix GroupConcat is invalid in dm

* add unit test

Co-authored-by: Xu <zhenghao.xu>
2022-09-28 10:02:48 +08:00
66aa0c7050 add switch of brief stack for package gerror (#2153) 2022-09-27 10:11:33 +08:00
141ca62c6d feature/v2.2.0 (#2154) 2022-09-26 22:11:13 +08:00
9dc97f4b0d fix issue in init context for package gctx (#2138)
* fix issue in init context for package gctx

* improve package gtest
2022-09-23 20:50:48 +08:00
714bda3e0f remove noisy internal logging content of package gcron (#2141) 2022-09-23 20:50:25 +08:00
2b4598f65b fix: pgsql DoExec Transaction checks (#2101)
Co-authored-by: John Guo <john@johng.cn>
2022-09-20 20:29:42 +08:00
5e9ef8ada4 fix issue incorrect struct name match pattern for command gen service (#2125)
* project template update for command init

* improve command , add extra option 

* add  option for command

* up
2022-09-15 14:44:24 +08:00
cf7c07cc34 improve and add clear option for command gen dao/service (#2123)
* project template update for command init

* improve command , add extra option 

* add  option for command
2022-09-14 21:01:57 +08:00
508062f8dc fix issue bot :ignore issue which without labels (#2077)
Co-authored-by: John Guo <john@johng.cn>
2022-09-14 15:44:54 +08:00
e5c63c7e16 project template update for command init (#2117) 2022-09-11 20:02:28 +08:00
7a11f00eb4 TplTableNameCamelLowerCase remove space (#2109)
Co-authored-by: zengjia <zengjia2@37.com>
Co-authored-by: houseme <housemecn@gmail.com>
2022-09-11 20:02:07 +08:00
faf09c586c add GzipPathWriter for package gcompress (#2116)
* add GzipPathWriter for package gcompress

* UT case updates for package package gclient
2022-09-08 17:32:21 +08:00
c866b5005f fix error message for package gtrace (#2103) 2022-08-31 19:53:21 +08:00
a0619f7ff0 remove uint repeat conversion (#2096)
Co-authored-by: houseme <housemecn@gmail.com>
2022-08-26 15:45:41 +08:00
37aee19bfa new release v2.1.4 (#2095)
v2.1.4
2022-08-26 15:05:45 +08:00
27609d8da8 fix issue #1921 (#2091)
* CI updates

* fix issue in OpenAPI json marshaling of embedded struct definition; improve command gen service

* improve logging content printing for internal log

* fix issue #1921
2022-08-26 14:30:49 +08:00
c083b333d8 fix field type check for package gdb (#2086)
* CI updates

* fix field type check for package gdb
2022-08-26 14:30:33 +08:00
ee376883d1 improve logging content printing for internal log (#2090)
* CI updates

* fix issue in OpenAPI json marshaling of embedded struct definition; improve command gen service

* improve logging content printing for internal log
2022-08-26 14:30:12 +08:00
98169784b1 fix issue in OpenAPI json marshaling of embedded struct definition; improve command gen service (#2089)
* CI updates

* fix issue in OpenAPI json marshaling of embedded struct definition; improve command gen service
2022-08-24 21:20:17 +08:00
9d1c6f2daa v2.1.3 release (#2084) 2022-08-22 14:40:36 +08:00
25d4ba320a improve command init: add go mod tidy for init project (#2083)
* CI updates

* improve command init
2022-08-22 14:31:35 +08:00
3988a7ff6b add more UT cases for package gview (#2072)
* CI updates

* add more UT cases for package gview
2022-08-18 21:06:20 +08:00
26e3c7aeb8 fix issue 1914 (#2075)
* CI updates

* fix issue #1914
2022-08-18 21:05:58 +08:00
eff46bd1db fix issue #2047 (#2069) 2022-08-16 20:46:22 +08:00
7a3176ea77 Fix name of issue CI (#2071)
CI updates
2022-08-16 20:41:54 +08:00
a656ad0941 add issue bot support (#2065) (#2066) 2022-08-15 21:52:33 +08:00
299573dd19 fixed inconsistent results when converting float64(NaN) to int/uint on multiple platforms (#2064) 2022-08-15 21:51:34 +08:00
43b84f4044 fix clickhouse in function TableFields when configuration using link (#2063) 2022-08-15 20:53:02 +08:00
897d6d9ad0 fix gctx init slice bounds out of range on ios platform (#2062) 2022-08-15 20:40:17 +08:00
e4c8cfc16b add interface DB.CheckLocalTypeForField for package gdb (#2059) 2022-08-11 21:47:35 +08:00
95888e0b77 add last insert id support for pgsql (#1994) 2022-08-09 19:45:05 +08:00
Gin
4ded89d453 improve gdb.CheckValueForLocalType for pgsql (#2040) 2022-08-08 19:56:06 +08:00
Gin
82a3391937 fix precision lost of int64 for package gcfg (#2044)
fix: gcfg lose precision

Co-authored-by: qinyuguang <qinyuguang@meican.com>
2022-08-03 21:50:17 +08:00
f580b7a488 improve header printing in json format for package glog; add golang v1.18 support for ci workflow (#2037) 2022-07-29 19:06:22 +08:00
9df0a9da0a fix issue #1648 (#2033) 2022-07-28 10:11:15 +08:00
6172862061 add MiddlewareJsonBody, improve error response handling for package ghttp (#2032) 2022-07-27 19:52:02 +08:00
1ae037f515 Update goai_path.go (#2029) 2022-07-26 22:48:40 +08:00
6f7cd96a7f feature: gen dao from tpl file path (#2021) 2022-07-25 20:55:48 +08:00
e00d3ff7ff fix issue in gstr.Nl2Br (#2028) 2022-07-25 20:54:42 +08:00
390b936153 fix gf-cli command 'gen dao' help infomation (#2022) 2022-07-25 19:43:47 +08:00
863bea1ad1 improve field type check from db to golang (#2023) 2022-07-22 16:44:24 +08:00
b7794a8783 use method name as its command name if no name defined in Meta of input struct for package gcmd (#2019) 2022-07-19 16:30:00 +08:00
bb3c51c6cc add interrupt for concurrent ci workflows(#2020) 2022-07-18 22:24:22 +08:00
c3c82cebd5 Feature/ci cache (#2010) 2022-07-18 16:02:21 +08:00
5d51e9fa2c improve package gerror, add HasCode/HasError function for package gerror (#2006) 2022-07-15 10:49:04 +08:00
2c70bb6a00 ci updates 2022-07-14 20:54:00 +08:00
98b2e8ab18 improve panic...recover of exit feature for package ghttp/gtimer/gfsnotify (#2000) 2022-07-13 20:20:38 +08:00
675ae9bade fix concurrent safety for package gdb (#1998) 2022-07-12 21:26:18 +08:00
3e7e8ba6f2 fix(gdb): panic when concurrent db config map read and write. (#1997) 2022-07-12 19:31:22 +08:00
f1766bdbdc add init ctx feature (#1995) 2022-07-12 19:27:42 +08:00
e3665cedaf new version v2.1.2 (#1993) 2022-07-12 14:08:19 +08:00
dd7caea910 fix UT issue for package gcron (#1992) 2022-07-12 09:55:46 +08:00
8ed57c6468 Improve the code coverage of the gtype module (#1975) 2022-07-11 21:29:32 +08:00
0e6becc36d Improve the code coverage of the gvar module (#1982) 2022-07-11 19:35:31 +08:00
e38c455252 Improve the code coverage of the gpool, gqueue, gring module (#1987) 2022-07-11 19:34:40 +08:00
4c1cf73005 Improve the code coverage of the gutil, grand module (#1989) 2022-07-11 19:33:59 +08:00
384fb3c4d5 fix go.sum of package contrib/drivers/pgsql (#1980) 2022-07-07 21:52:21 +08:00
afb90b0af3 Feature/pgsql add pgsql unit test (#1853) (#1973) 2022-07-07 21:42:20 +08:00
1530ffc926 Improve the code coverage of the gset module (#1977) 2022-07-07 21:28:23 +08:00
f876a56d2a some improves for ci yaml and package cmd/gf, database/gdb (#1972) 2022-07-07 21:16:26 +08:00
d26eadf5be gfcli: fix imports parse and update gofmt (#1979) 2022-07-07 20:57:20 +08:00
13fc0cb9eb feat: pgsql 字段类型 支持 数组类型 (#1881) 2022-07-06 21:06:20 +08:00
Gin
59b3f6e962 improve list tables for pgsql (#1790) 2022-07-06 20:05:12 +08:00
80442efe94 redis add sentinel slaveOnly filed (#1948) 2022-07-06 19:54:36 +08:00
ab929e465b update comment for ghttp.Request (#1968) 2022-07-06 19:48:43 +08:00
047c90466d improve UT for package gcron (#1966) 2022-07-04 21:18:20 +08:00
40e6b2b0f1 fix gf run custom arguments and gf gen dao specify config file path (#1879) 2022-07-04 21:01:55 +08:00
9159f00014 Fix goai repeat param (#1916) 2022-07-04 20:40:28 +08:00
59a9484970 gf gen service supports the generation of service files in the specified naming format (#1953) 2022-07-04 20:36:58 +08:00
8a853b1bb7 add file export (#1959) 2022-07-04 20:17:00 +08:00
2bcd6c4771 add full week/month name support for pattern, add seconds fix feature in some delay seconds for package gcron (#1960) 2022-07-01 09:53:01 +08:00
1acc1b8230 improve DeepCopy feature for bunch of components, especially the container and gtime (#1956) 2022-06-29 14:58:27 +08:00
2c169e2330 improve package glog; fix issue in package gtrace (#1952) 2022-06-28 15:47:16 +08:00
f57d71b6fa add cross building support for sqlite in command gen dao (#1944) 2022-06-27 11:09:55 +08:00
796bc008f8 improve configuration parsing for command gen dao (#1938) 2022-06-24 18:03:05 +08:00
d7faae0531 add gstr.IsGNUVersion (#1937) 2022-06-24 16:54:24 +08:00
f0511592b5 github.com/glebarez/go-sqlite (#1932) 2022-06-24 16:15:42 +08:00
68efab79ef improve command gen service 2022-06-24 15:35:16 +08:00
1ede8c77ba version updates 2022-06-24 15:21:36 +08:00
48f95d0009 fix issue in Response.WriteJson/Xml functions 2022-06-24 15:21:10 +08:00
0bb57b8989 go.sum update 2022-06-24 15:16:46 +08:00
0503c17867 feat/gfcli: replace gofmt&goimports with tools/imports (#1935) 2022-06-24 14:15:20 +08:00
19779cd342 Fix multiple gdb-group overrides (#1890)
Co-authored-by: longl <longlei@dealmap.cloud>
2022-06-23 21:30:29 +08:00
141f3512a9 fix glog bug (#1844) 2022-06-23 21:05:12 +08:00
3b9e5c71bf version updates 2022-06-21 21:52:54 +08:00
2bcee014f7 add tracing feature for package gproc (#1923) 2022-06-21 21:46:12 +08:00
f0568b4e22 Merge branch 'develop' 2022-06-21 19:08:36 +08:00
8670f29c4e update project templates and improve command init for cli 2022-06-21 18:08:11 +08:00
33a528af76 fix issue #1913 2022-06-20 22:03:19 +08:00
52056644d4 add context parameter (#1919) 2022-06-20 20:34:59 +08:00
3ae23df4b3 Improve the code coverage of the gmap module (#1910) 2022-06-20 19:05:47 +08:00
1b327b8abd improve database configuration parsing for package gins/gdb 2022-06-20 12:07:51 +08:00
bb5cd3e224 fix database configuration parsing for package gins 2022-06-20 11:14:13 +08:00
1e8237446e add tracing logging content if trace id is available in context for package gcmd 2022-06-17 17:42:49 +08:00
b2b2044786 add tracing logging content if trace id is available in context for package gcmd 2022-06-17 17:41:10 +08:00
64c5222623 add environment support of opentelemetry propagation for package gctx 2022-06-17 16:47:01 +08:00
1597291ac3 improve configuration parsing for package gdb 2022-06-17 15:35:55 +08:00
c2e742335b add otel support for package gcmd 2022-06-17 15:16:35 +08:00
cf5884bc60 add SetBodyContent for gclient.Response 2022-06-17 11:31:32 +08:00
cbf5ee9649 go fmt -w 2022-06-16 18:02:51 +08:00
8ac177a6de improve UT for package gredis 2022-06-16 17:41:15 +08:00
cdd4473df5 improve command gen service; add error trace for error of some packages 2022-06-16 17:07:25 +08:00
aaebaa7250 improve DoRequestObj for gclient.Client 2022-06-16 10:51:12 +08:00
7443a8baa1 Merge branch 'develop' 2022-06-15 21:43:04 +08:00
c6ff95a3f4 README update for contrib/registry etcd/polaris 2022-06-15 21:42:12 +08:00
7957016ae2 Polaris Server Offical image support (#1911) 2022-06-15 19:38:22 +08:00
17ab0e2ced remove returning error of Write* functions for ghttp.Server; add UT cases for gclient.Client.DoRequestObj 2022-06-15 19:36:53 +08:00
b0650f3402 Improve the code coverage of the garray,glist module (#1908) 2022-06-15 19:35:21 +08:00
f4f73f2765 Merge branch 'master' of https://github.com/gogf/gf into develop 2022-06-15 16:28:20 +08:00
babc69e13d add DoRequestObj function for gclient.Client 2022-06-15 16:28:17 +08:00
481c50f233 add example for package gerror 2022-06-15 14:46:31 +08:00
b62b2f3598 Improve the code coverage of the gudp module (#1907) 2022-06-13 22:01:20 +08:00
4f37abac6a upgrade ClickHouse-Go dependencies to V2.0.15 (#1904) 2022-06-13 19:40:47 +08:00
31a23e724d Improve the code coverage of the gclient module (#1899) 2022-06-13 19:31:42 +08:00
7d5ab1f8db Merge branch 'master' of https://github.com/gogf/gf 2022-06-06 21:36:44 +08:00
0d8952dcde improve WithTraceID function for package gtrace 2022-06-06 21:36:30 +08:00
bd7ec5d0b0 Feature/sqlite ut (#1882) 2022-06-06 19:57:53 +08:00
MZ
9e6e8001ca fix gf gen service ignore watch file dir windows platform bug (#1889) 2022-06-06 19:56:44 +08:00
0639becccc version updates 2022-06-01 16:36:40 +08:00
88844649eb fix version of redoc 2022-06-01 16:34:07 +08:00
31c5d5a5f5 Merge branch 'master' of https://github.com/gogf/gf into develop 2022-06-01 14:44:11 +08:00
6abbc57c96 fix issue #1864 2022-05-26 15:28:17 +08:00
39af6e51c4 fix ut cases for package goai 2022-05-26 15:17:59 +08:00
ef04c8a09e Feature/oracle (#1869) 2022-05-25 21:55:27 +08:00
4505d61604 improve WhereBuilder feature for package gdb 2022-05-25 21:52:08 +08:00
04d32e7a91 improve FieldsPrefix for gdb.Model 2022-05-25 16:22:46 +08:00
26066965c3 Merge branch 'master' of https://github.com/gogf/gf into develop 2022-05-25 16:02:48 +08:00
7f199527f8 improve service discovery for package gclient 2022-05-24 19:16:43 +08:00
ea79b3cbb8 move package goai from protocol to net 2022-05-24 18:53:10 +08:00
0ca81bd11a Improve the code coverage of the gtcp module (#1836) 2022-05-23 22:45:12 +08:00
4d13ffdc26 improve ut case for empty upload file validation 2022-05-23 22:23:29 +08:00
331a29024e merge master 2022-05-23 22:17:06 +08:00
6aa5c2b2ef Fix/1748 issues #1748 (#1817) 2022-05-23 22:09:11 +08:00
8c969b2a84 upgrade ClickHouse dependencies to V2 (#1772) 2022-05-23 21:21:59 +08:00
0d7e28ee75 add deep copy feature 2022-05-23 16:51:10 +08:00
ab5062663e Feature/gsvc interface (#1871) 2022-05-23 15:08:11 +08:00
896b9fa105 [ISSUE #1866] Fix/polaris logs dir and docker image (#1867)
* feat:modify polaris log dir

* modify polaris image docker

* fix: modify polaris docker image
2022-05-19 23:33:04 +08:00
6a01275499 improve data converting for package gdb 2022-05-19 21:44:53 +08:00
61bf0a0092 remove sqlite import for command gen dao 2022-05-19 20:13:56 +08:00
d7c5a08d20 fix issue of space char in binary pth of gofmt/goimports 2022-05-19 20:03:44 +08:00
350ee9f0a2 ci workflow updates 2022-05-19 19:59:41 +08:00
7753fc6fe1 improve error message for package gdb 2022-05-19 17:27:13 +08:00
24f5b2782d version updates 2022-05-19 16:10:52 +08:00
853d7aaf8f fix issue missing mysql driver import for package contrib/drivers/mysql 2022-05-19 15:02:15 +08:00
07509e9847 go mod tidy 2022-05-19 10:49:09 +08:00
ab82599ee2 Feature/polaris feat: Add Polaris support (#1797) 2022-05-18 22:24:40 +08:00
10e2b60ad9 workflow ci updates 2022-05-18 21:38:13 +08:00
965476c7f4 workflow ci updates 2022-05-18 21:24:15 +08:00
9536b33a6a Fix/codecovci (#1858) 2022-05-18 21:18:49 +08:00
61271e4f7b Replace the Swagger JS CDN source from jsdelivr to unpkg.com (#1852)
replace the CDN source from jsdelivr to unpkg.com

The jsdelivr cdn certificate expired in the mainland, causing the website to hang. To fix it, the solution is to replace the CDN source to unpkg.com
2022-05-18 20:34:59 +08:00
57941b6df9 Bug fix#1849 (#1851) 2022-05-18 20:19:40 +08:00
1102de5a66 fix issue in missing mysql import for command gen dao 2022-05-18 20:02:53 +08:00
6d33a73617 Merge branch 'master' of https://github.com/gogf/gf 2022-05-18 19:58:25 +08:00
cdcb0cdc14 Merge branch 'develop' 2022-05-18 19:58:16 +08:00
6176028176 improve package gmeta 2022-05-18 17:57:16 +08:00
c871bb3a1e improve package gcfg 2022-05-18 15:11:49 +08:00
3430cf1f17 improve data converting for package gdb, drivers/pgsql 2022-05-18 11:55:09 +08:00
4556dda038 improve data converting for package gdb, drivers/pgsql 2022-05-18 11:16:25 +08:00
49042d480c improve data converting for package gdb, drivers/pgsql 2022-05-18 11:05:05 +08:00
b7295a1558 Merge pull request #1843 from wenzi1/feature/mssql
mssql unit test
2022-05-17 21:24:50 +08:00
62d91438f2 version upgrade 2022-05-17 16:43:10 +08:00
c4c3620c5f improve enum handling for array property of goai schema 2022-05-17 11:15:29 +08:00
ec0cbab47e Merge remote-tracking branch 'origin/master' into feature/mssql 2022-05-17 09:42:21 +08:00
8e3c66584d add unit test 2022-05-16 22:58:53 +08:00
84e75129a5 improve command gen service for cli 2022-05-16 20:07:30 +08:00
26d460241d Null in field is error 2022-05-13 23:30:33 +08:00
ede54b392e Merge branch 'master' of https://github.com/wenzi1/gf 2022-05-13 23:13:07 +08:00
d12542d78e Merge remote-tracking branch 'origin/master' 2022-05-13 22:20:50 +08:00
3a014dcb09 fix issue in UT of mysql sriver 2022-05-13 22:11:44 +08:00
cb27f26e64 Merge branch 'gogf:master' into master 2022-05-13 22:00:49 +08:00
a3ad294d6a README updates for drivers 2022-05-13 21:54:24 +08:00
cf57ea3ef0 Merge branch 'gogf:master' into master 2022-05-13 21:51:08 +08:00
94dd590fc4 Merge branch 'develop' 2022-05-13 21:48:11 +08:00
27836feb47 delete comment 2022-05-13 21:45:19 +08:00
96e48e1de6 Merge branch 'master' into feature/mssql 2022-05-13 21:07:34 +08:00
d5c06664b5 fix issue #1798 2022-05-13 21:04:08 +08:00
e4edbe25b2 Merge pull request #1823 from huangqian1985/master
add gClient ExampleNew function
2022-05-13 20:24:19 +08:00
31bc30bb27 Merge pull request #1806 from happyinsect/master
add support for .properties configuration file
2022-05-13 20:01:29 +08:00
a2905977ec improve package gcmd, adding CaseSensitive option for options parsing, default is CaseInsensitive 2022-05-13 15:24:10 +08:00
b63e01adf6 add internal log content for package gcmd 2022-05-13 14:48:22 +08:00
2680666f52 improve gstr.WordWrap 2022-05-13 14:18:51 +08:00
f82f53f5f6 modify ExampleNew_MultiConn_Recommend function 2022-05-13 11:58:46 +08:00
e27ca17b0e exec CI 2022-05-13 06:47:48 +08:00
066b1026a2 Merge branch 'master' of https://github.com/gogf/gf 2022-05-12 23:46:31 +08:00
c7cf72e7bc fix gClien Close() 2022-05-12 23:22:30 +08:00
0e2a0075ef Use gconv.String instead of cast.ToString. 2022-05-12 22:59:08 +08:00
6dccaf802c CI updates 2022-05-12 22:45:57 +08:00
de5224689a CI updates 2022-05-12 22:26:57 +08:00
f9ec01c647 CI workflow updates 2022-05-12 21:57:02 +08:00
4902eb73b7 gfmt file 2022-05-12 21:31:54 +08:00
513c8605fb update go.mod and go.sum 2022-05-12 21:11:06 +08:00
84148bbbb0 Merge https://github.com/gogf/gf 2022-05-12 20:57:11 +08:00
c2e91edca8 Merge branch 'master' of https://github.com/gogf/gf 2022-05-12 20:17:08 +08:00
17fc1ce174 Call ReadAll() function in Close() of gClient 2022-05-12 20:08:24 +08:00
be9377a496 add test cases 2022-05-12 17:05:02 +08:00
c40a4d8a66 improve command docker for cli 2022-05-12 17:04:00 +08:00
6d0b4faeb0 gitignore updates 2022-05-12 16:01:55 +08:00
3297924992 ci test 2022-05-12 15:33:48 +08:00
059c62a6c0 ci test 2022-05-12 15:25:28 +08:00
bef942b19f ci test 2022-05-12 14:57:26 +08:00
30140fb229 ci test 2022-05-12 14:37:31 +08:00
df3ae386cb ci test 2022-05-12 14:35:39 +08:00
baf4cc1d1c remove bad example and little fix 2022-05-12 12:48:37 +08:00
9fcd3374c1 Merge pull request #1827 from wenzi1/feature/mssql
Feature/mssql
2022-05-12 11:47:28 +08:00
d5d56e51d7 增加用例覆盖率 2022-05-12 09:39:15 +08:00
3b8853736d Merge branch 'develop' into master 2022-05-12 09:25:25 +08:00
16b22e7505 add unit test 2022-05-12 09:03:55 +08:00
da7eac03ad delete package comment 2022-05-12 00:25:30 +08:00
060f67c2c8 change decode/encode lib for properties to magiconair 2022-05-12 00:23:46 +08:00
273b81d60f little fix 2022-05-12 00:22:10 +08:00
72b58ff8a1 add unit test 2022-05-12 00:03:20 +08:00
900e0b2751 add gini 2022-05-12 00:00:36 +08:00
9026fd2c13 add gClient ExampleNew function, include normal New Example, bad MultiConn New Example and Recommend MultiConn New Example 2022-05-11 23:58:36 +08:00
f6f0c8fd1e ci test 2022-05-11 20:42:34 +08:00
4bdaacab91 ci test 2022-05-11 20:12:30 +08:00
60ca7d7246 ci test 2022-05-11 18:11:35 +08:00
e4e312c4f8 ci updates 2022-05-11 17:51:27 +08:00
7bcdbae7b8 ci updates 2022-05-11 17:36:55 +08:00
b16cd2dc85 ci updates 2022-05-11 17:11:18 +08:00
0826f8ba35 Merge pull request #1818 from wenzi1/master
gf-cli Bug of generating Dao file of MSSQL
2022-05-11 13:58:47 +08:00
ead284e20b workflow updates 2022-05-11 13:58:04 +08:00
59023f9f09 delete empty line after package comment. 2022-05-11 11:08:05 +08:00
17e48ba9f2 Add test case for func tojson 2022-05-11 01:02:36 +08:00
e60b42470e [MOD] User viper as the properties file decoding lib. 2022-05-11 00:48:22 +08:00
9c42ba187d upgrade otel to v1.7.0 2022-05-10 20:37:44 +08:00
c6f14dc1b1 go mod updates 2022-05-10 17:54:42 +08:00
02e3240bb1 workflow yaml updates 2022-05-10 17:16:39 +08:00
54f0968f86 workflow yaml updates 2022-05-10 16:53:39 +08:00
0e75d39811 workflow yaml updates 2022-05-10 16:34:47 +08:00
6cf6414da2 improve package gdb 2022-05-10 16:31:56 +08:00
89f77a2412 update TableFields function 2022-05-10 16:00:50 +08:00
a400d8b2f3 workflow updates 2022-05-10 15:47:49 +08:00
dc6a9237d7 move ut cases from package gdb to contrib/drivers/mysql 2022-05-10 15:38:08 +08:00
2c73ba2f76 Merge pull request #2 from gogf/master
update
2022-05-10 10:37:13 +08:00
2cbfdf43cf upgrade used third party package fsnotify to v1.5.4 2022-05-10 10:23:31 +08:00
5e0e6f356b fix issue #1766 2022-05-09 22:47:04 +08:00
cbff244d88 improve package gcron 2022-05-09 21:45:57 +08:00
2e405342ca improve package gcron 2022-05-09 21:42:50 +08:00
583d576cdb remove octal number converting for gconv.Int*/Uint* functions; fix issue #1733 2022-05-09 21:26:42 +08:00
3db97ba0dd fix issue #1714, #1727 2022-05-09 20:42:41 +08:00
e81d6a859b Merge pull request #1729 from WesleyWu/fix#1714
fix timezone bug when persisting *gtime.Time to db #1714
2022-05-09 20:28:00 +08:00
534abb7f17 improve hook feature for package gdb 2022-05-09 14:22:28 +08:00
7198eb3b66 add support for .properties configuration file 2022-05-08 00:23:24 +08:00
32f33b9f8c go.mod updates 2022-05-07 18:06:51 +08:00
03ad6a5728 remove debug info for UT of package gdb 2022-05-07 17:50:49 +08:00
c1308475f3 Merge branch 'feature/wherebuilder' into develop 2022-05-07 17:49:30 +08:00
e4ec1be948 workflow updates 2022-05-07 16:43:28 +08:00
c90f91dcbe remove Sharding feature 2022-05-07 16:38:17 +08:00
5332ce4c79 improve WhereBuilder feature for package gdb 2022-05-07 15:11:31 +08:00
eaae7f46d2 improve WhereBuilder feature for package gdb 2022-05-07 14:26:56 +08:00
8c40a53b80 improve WhereBuilder for package gdb 2022-05-06 22:21:43 +08:00
25c091df7f improve package ghttp 2022-05-06 20:25:21 +08:00
ec3a4532b8 comment updates for package clilckhouse 2022-05-06 10:34:08 +08:00
ad04adccea Merge pull request #1796 from houseme/feature/trace
feat: Report trace-compatible device host name or IP archive parameters
2022-05-05 22:19:35 +08:00
cfd2636f13 Merge pull request #1795 from huangqian1985/master
add ExampleEncode function
2022-05-05 22:18:20 +08:00
7e854f88ca feat: Report trace-compatible device host name or IP archive parameters 2022-05-03 22:53:02 +08:00
3628b1e9d2 add ExampleEncode function 2022-05-02 17:29:19 +08:00
68e75c589b add WhereBuilder feature for package gdb 2022-04-30 15:53:56 +08:00
9ad9292321 improve handler feature for package glog 2022-04-29 14:13:54 +08:00
7fcf7d31a0 improve command gen service for cli 2022-04-29 11:08:16 +08:00
0cf28c0f07 improve package goai 2022-04-28 20:58:28 +08:00
abbc96a873 improve package goai 2022-04-28 20:37:15 +08:00
b7201e111d Merge branch 'master' of https://github.com/gogf/gf into develop 2022-04-28 20:34:35 +08:00
a31553468c Merge pull request #1789 from mingzaily/master
fix: swagger ignore "-" param.
2022-04-28 20:24:11 +08:00
ce89b440bb feat: optimize ignore tag. 2022-04-28 17:14:19 +08:00
3a72c4a507 improve command gen service for cli 2022-04-28 15:09:54 +08:00
c82e612258 improve command gen service for cli 2022-04-27 22:10:49 +08:00
ae5891068e schema switch in runtime feature for clickhouse/mssql/pgsql/oracle 2022-04-27 17:15:26 +08:00
f326dc4eaa remove unused imports for package gdb 2022-04-27 15:27:44 +08:00
48fddcd5e7 improve session Manager and default Storage implements for package gsession; fix issue #1781 2022-04-27 15:05:34 +08:00
33c9204d58 fix: swagger ignore "-" param. 2022-04-26 23:22:43 +08:00
99f1e69469 add custom dao/do/entity path support for command gen dao for cli 2022-04-26 23:18:29 +08:00
ed0b3c039a improve package gsession; improve command docker for cli 2022-04-26 22:42:56 +08:00
eef25c28b4 improve command docker/gen service 2022-04-26 17:49:01 +08:00
a32847f0c5 add default handler feature for package glog 2022-04-25 18:05:52 +08:00
0fc193faa3 add command gen service for cli 2022-04-24 22:52:29 +08:00
65077a224c add command gen service for cli 2022-04-24 22:52:07 +08:00
c256d2d4af fix issue in gstr.RepliaceI; add command gen service for cli 2022-04-24 22:23:56 +08:00
215a50675e add command gen service for cli 2022-04-22 18:17:10 +08:00
023c4a19ae add multiple tags support for command docker of cli 2022-04-21 15:29:10 +08:00
ac5d399906 improve package guid 2022-04-19 16:18:49 +08:00
7fd0e5b3bc fix issue in loosing internal ctx data in cache feature for package gdb 2022-04-19 10:42:16 +08:00
64ff651d57 fix issue in loosing internal ctx data for Transaction for package gdb; fix issue #1732 2022-04-19 10:22:10 +08:00
d260de15ba fix issue #1750 2022-04-18 20:57:41 +08:00
be77779aff Merge branch 'master' of https://github.com/gogf/gf into develop 2022-04-18 20:29:35 +08:00
e119f2a534 improve cache handlement for package gdb 2022-04-18 20:29:24 +08:00
a09c8497bc Merge branch 'develop' of https://github.com/gogf/gf into develop 2022-04-18 20:28:14 +08:00
ebad3eb93e error meesage update for package gdb; remove default batch number for batch insert statement for package gdb 2022-04-18 20:28:00 +08:00
e4e4534c7c Merge pull request #1759 from qinyuguang/gdb_cache
fix issue #1755
2022-04-18 20:22:38 +08:00
b412fc6516 Merge pull request #1749 from qinyuguang/gjson_unmarshalvalue
fix issue #1747
2022-04-18 20:19:07 +08:00
f9c9750108 improve gutil.Dump 2022-04-15 18:00:16 +08:00
5dee3bb4d9 add auto creating tags github workflow; go.mod update for crontrib packages 2022-04-15 14:47:02 +08:00
1e3d8cdadd fix issue #1721 2022-04-13 21:58:35 +08:00
c5bf45f1ae fix issue #1755 2022-04-13 21:49:08 +08:00
bf674060c0 add internal package consts to manage shared constants; improve buildin function dump only available in develop mode for package gview 2022-04-13 21:08:12 +08:00
878dbe4ab9 fix issue #1740 2022-04-13 20:42:39 +08:00
d8b383719a improve package gtag 2022-04-13 11:21:24 +08:00
9ff5f39701 fix issue #1747 2022-04-12 23:30:18 +08:00
5144cc0e08 Merge pull request #1735 from yuancjun/patch-1
avoid a single space at the end of a line.
2022-04-12 21:36:44 +08:00
ee29b28575 improve clickhouse driver 2022-04-12 21:31:51 +08:00
7785082f19 Merge branch 'master' of https://github.com/gogf/gf into develop 2022-04-12 21:17:32 +08:00
edf40ba430 Merge pull request #1616 from DGuang21/feature-clickhouse-driver
Feature - clickhouse driver
2022-04-12 21:14:12 +08:00
a228495ced improve error message for package ghttp 2022-04-12 16:15:54 +08:00
ed9dc70769 add UT case for package gvalid 2022-04-12 16:09:24 +08:00
e8581d4fd5 add Is/Equal/Unwrap functions for package gerror 2022-04-12 15:45:26 +08:00
2d6fcf5d06 fix issue #1708 2022-04-12 12:09:09 +08:00
55e0262c37 improve package gconv 2022-04-11 21:54:23 +08:00
d5e5a48170 fix issue #1747 2022-04-11 20:49:33 +08:00
d0f2928cec fix issue of nil pointer in package internal/utils 2022-04-11 20:43:32 +08:00
190a53647e fix issue #1701 2022-04-11 20:38:48 +08:00
f9a3fa3c23 fix issue #1700 2022-04-11 17:58:07 +08:00
f1fee72d6d fix issue #1700 2022-04-08 18:11:17 +08:00
0b4ae6b116 add UpdateAndGetAffected for gdb.Model 2022-04-08 17:22:07 +08:00
a1ec7cb896 improve clickhouse driver 2022-04-08 10:08:04 +08:00
1935412db9 improve clickhouse driver 2022-04-08 10:07:14 +08:00
c90a9d45ee improve clickhouse driver 2022-04-08 09:44:42 +08:00
a594592151 Merge branch 'feature-clickhouse-driver' of https://github.com/DGuang21/gf into feature-clickhouse-driver 2022-04-08 09:43:09 +08:00
119d8bf98c improve command gf run 2022-04-07 22:07:47 +08:00
1e141d9f64 improve package gjson/ghttp 2022-04-07 21:26:39 +08:00
587af6dec8 add sqlite support for cli tool 2022-04-07 20:29:15 +08:00
793e862e5a Merge pull request #1730 from xiaoping378/patch-2
Update README.MD
2022-04-07 20:16:29 +08:00
09c3425dd3 Merge pull request #1683 from Macrow/master
feat: support custom listener
2022-04-07 20:05:16 +08:00
4ca168412b avoid a single space at the end of a line. 2022-04-06 11:57:22 +08:00
66f24db6da Update README.MD 2022-04-04 21:48:36 +08:00
c39a58f812 improve clickhouse driver 2022-04-04 14:56:44 +08:00
5034f231a9 improve clickhouse driver 2022-04-04 12:46:11 +08:00
1a271ce627 fix timezone bug when persisting *gtime.Time to db #1714 2022-04-03 16:00:19 +08:00
64afd5f64c Merge branch 'master' of https://github.com/DGuang21/gf into feature-clickhouse-driver 2022-04-02 18:35:12 +08:00
0e0d2e1c45 fix: break when finished set custom listener in newGracefulServer method 2022-04-01 09:03:36 +08:00
52d8371ba9 add UT case for package gdb 2022-03-31 21:40:28 +08:00
1d74b58d36 Merge branch 'master' of https://github.com/DGuang21/gf into feature-clickhouse-driver 2022-03-31 21:29:17 +08:00
66803fd664 fix issue in package gdb 2022-03-31 16:57:32 +08:00
87609a3424 version update 2022-03-31 16:52:15 +08:00
b4184e4523 Merge branch 'master' of https://github.com/gogf/gf 2022-03-31 16:16:57 +08:00
05508e4fcb improve cache feature for package gdb 2022-03-31 16:15:44 +08:00
372bae4799 fix issue in missing first result column when in select cache scenario 2022-03-31 15:42:12 +08:00
c7f51b8e77 fix: SetListener test data race error 2022-03-30 14:55:03 +08:00
21f48d3750 improve Unique function performance for normal arrays 2022-03-30 14:32:16 +08:00
b57cbacc82 refactor: method SetListener accepts slice of net.Listener and remove method SetListeners 2022-03-29 23:22:23 +08:00
126a81d89a Merge pull request #1697 from cuishuang/master
fix some typos
2022-03-29 20:38:20 +08:00
707dc6b346 add xextensions feature for package goai 2022-03-29 20:31:00 +08:00
c1c86c026f fix type integer from type number for package goai 2022-03-28 16:40:43 +08:00
5c4982cb0c add Sort field for Pat of package goai 2022-03-28 16:20:08 +08:00
fed38ea7ab add Sort field for Operation of package goai 2022-03-28 16:18:44 +08:00
4d6ef1c52d add sort field for path of package goai 2022-03-28 15:59:02 +08:00
c6aba6da4d improve ExternalDocs feature for package goai 2022-03-28 15:21:58 +08:00
ec92d2b7f4 improve empty slice/object validation logic for package gvalid 2022-03-25 17:53:58 +08:00
6810e71220 add UT case for package goai 2022-03-25 12:00:09 +08:00
f4192d695c remove sort feature for openapi 2022-03-24 22:08:06 +08:00
6664437b06 add sort feature for path of openapi 2022-03-24 21:56:37 +08:00
96a135834a improve openapi genereating for package ghttp 2022-03-24 20:15:54 +08:00
09ba1bf1fb imrove context handling for package gdb 2022-03-24 17:51:49 +08:00
cc01629b57 improve hook and sharding feature for package gdb 2022-03-24 15:33:30 +08:00
2d586859c3 fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-23 21:45:00 +08:00
a5e20e4939 improve openapi paths sequence in json as api defined sequence 2022-03-23 17:39:38 +08:00
0e3f4f45e0 improve hook feature for package gdb 2022-03-23 16:23:33 +08:00
045c3e132f improve hook feature for package gdb 2022-03-23 16:17:18 +08:00
80c068ae05 add example for properties of swagger schema object 2022-03-23 15:05:37 +08:00
6574b8cbfe change build-in swagger ui to public cdn 2022-03-23 14:48:34 +08:00
20c48b1712 change build-in swagger ui to public cdn 2022-03-23 14:46:56 +08:00
ee16b6df88 change build-in swagger ui to public cdn 2022-03-23 14:43:48 +08:00
325887fa18 fix: SetListener overwrite default address 2022-03-22 21:35:53 +08:00
73ca527b0a feat: add SetListener and throw error in SetListeners 2022-03-22 13:34:15 +08:00
439350836e fix example case for package gsession 2022-03-21 22:44:21 +08:00
5ee387672b enhancement from issue #1689 2022-03-21 22:36:06 +08:00
f670c24e2c fix issue #1681 2022-03-21 22:24:59 +08:00
f2e1f63396 fix issue #1679 2022-03-21 22:04:15 +08:00
6dacdd60dc add sharding feature for package gdb 2022-03-21 21:17:48 +08:00
87ccc27ee4 sharding feature develop 2022-03-21 14:26:56 +08:00
147348e0d1 refactor: remove unnecessary code in method getListenAddress of Server 2022-03-20 10:17:44 +08:00
ad202ea735 refactor: adjust method SetListeners of server and add unit test 2022-03-20 02:31:21 +08:00
950695664c improve hook feature for package gdb 2022-03-19 23:38:57 +08:00
d1f76f3834 Merge branch 'master' of https://github.com/gogf/gf 2022-03-19 22:54:50 +08:00
66e6a05e5f cli template update 2022-03-19 22:54:38 +08:00
0f430c66ae Merge pull request #1684 from houseme/fix-1674
improve ignore and up websocket 1.5.0
2022-03-19 22:50:53 +08:00
8357b0f649 improve comment 2022-03-19 17:58:21 +08:00
7fc75bfeff improve ignore and up websocket 1.5.0 2022-03-19 16:16:18 +08:00
d7bd1b74e8 feat: support custom listener 2022-03-18 20:54:32 +08:00
d7764e2968 Merge branch 'develop' 2022-03-18 11:52:02 +08:00
f865d6fa6a remove UT case of http server in package gins 2022-03-18 10:13:00 +08:00
e6bbead4e6 Merge pull request #1660 from qinyuguang/gdb_cache
gdb returns result when cache set failed
2022-03-17 22:05:06 +08:00
5f3a525d11 add Set function for AdapterFile for package gcfg 2022-03-17 21:41:10 +08:00
c5d80a2192 improve UT cases for package gins/gvalid 2022-03-17 21:31:07 +08:00
97b8f0f781 improve recursilve validation feature for package gvalid 2022-03-17 20:27:59 +08:00
bceb5fc7de rename gdebug.TestData* -> gtest.Data*; add UT case for http server 2022-03-17 16:58:04 +08:00
b3e66d8023 improve package gjson 2022-03-15 21:45:47 +08:00
e06f831205 improve package grand 2022-03-15 17:09:35 +08:00
60340a7348 fix UT case for package glog 2022-03-15 10:15:46 +08:00
dccfc1c8cd add hook feature for model of package gdb 2022-03-14 23:47:55 +08:00
d58186372f Merge branch 'master' into develop 2022-03-14 19:43:21 +08:00
d32246275a rename DoGetAll to DoSelect 2022-03-14 19:41:32 +08:00
2eec1bc61a version updates 2022-03-14 19:39:56 +08:00
bbab9f3934 rename DoGetAll to DoSelect 2022-03-14 19:36:43 +08:00
09a3f23e3d cli pack updates 2022-03-13 09:23:19 +08:00
329f6b90f7 improve gutil.Dump feature 2022-03-11 15:26:01 +08:00
a4ab9c284f gdb returns result when cache set failed 2022-03-11 13:04:53 +08:00
9e056dfac8 Merge branch 'master' of https://github.com/gogf/gf 2022-03-11 10:24:57 +08:00
d8d9996464 fix issue #1662 2022-03-11 10:24:42 +08:00
43992a137e Merge pull request #1659 from arieslee/master
[fix bug] the default value of r.get is invalid
2022-03-11 09:14:11 +08:00
7767bf4d5d 重跑ci 2022-03-11 07:54:34 +08:00
acd1989fa1 improve Dump feature for package gutil 2022-03-10 22:29:47 +08:00
afa1f78a02 fix issue #1661 2022-03-10 21:12:24 +08:00
87b1433473 issue template update 2022-03-10 19:30:03 +08:00
5813979479 重跑ci 2022-03-10 14:32:06 +08:00
ba7cbfe3d9 error message update for database driver import 2022-03-10 14:29:49 +08:00
546b6b1724 t.Assert(err, nil) -> t.AssertNil(err) 2022-03-10 11:36:40 +08:00
eca3583845 fix issue #1416; add ParseOption for package gview 2022-03-10 11:35:23 +08:00
2471130f59 重跑ci 2022-03-10 09:52:45 +08:00
f5693c4393 improve package gview 2022-03-10 09:48:19 +08:00
12eb3ac63e [fix bug] the default value of r.get is invalid 2022-03-10 09:33:33 +08:00
e3f0163092 Merge branch 'master' of https://github.com/gogf/gf 2022-03-10 09:23:01 +08:00
213392640c fix issue #1653 2022-03-10 09:22:50 +08:00
4382a6e7bc Merge pull request #1658 from houseme/fix-1655
fix: js link err
2022-03-10 09:14:38 +08:00
c200177af4 fix: js link err 2022-03-09 23:36:30 +08:00
465100ae41 Merge pull request #1657 from houseme/fix-1655
fix: server access logs contain the protocol used between the server …
2022-03-09 22:23:40 +08:00
3d6867c321 fix 2022-03-09 21:29:49 +08:00
3d5ff3b250 fix 2022-03-09 21:27:02 +08:00
be47203732 improve code 2022-03-09 21:24:57 +08:00
1625fc6f7e improve order feature for gdb.Model 2022-03-09 21:02:08 +08:00
fa57634505 Merge pull request #1529 from zxr615/feature-groupRaw
Added Order() method support for gdb.
2022-03-09 20:55:15 +08:00
ac71658b4b Merge branch 'master' into feature-groupRaw 2022-03-09 20:55:06 +08:00
61db7d96b7 Merge pull request #1520 from FlyingBlazer/patch-1
Fix gdb Order
2022-03-09 20:48:54 +08:00
5ee297d999 Merge pull request #1651 from chenzebinm4/develop/bert
Repeat 'len(s)'.
2022-03-09 20:46:41 +08:00
6301403777 Merge pull request #1632 from huangqian1985/master
Improving gfile and gSesssion Code Coverage
2022-03-09 20:45:44 +08:00
95881d7616 Merge pull request #1652 from stardemo/master
[fix] gf cli build missing suffix
2022-03-09 20:43:40 +08:00
85d8f90d81 Merge pull request #1656 from tiger1103/master
[fix bug] Fix redis cache adapter GetOrSetFunc, GetOrSetFuncLock meth…
2022-03-09 20:42:44 +08:00
f6054ab37f improve code 2022-03-09 18:32:13 +08:00
5537930210 fix 2022-03-09 18:30:32 +08:00
920dbbef5e fix: server access logs contain the protocol used between the server and the load balancer, but not the protocol used between the client and the load balancer 2022-03-09 17:42:56 +08:00
yxh
2510e0412d [fix bug] Fix redis cache adapter GetOrSetFunc, GetOrSetFuncLock method bug and add unit test 2022-03-09 17:21:02 +08:00
2302f88847 [fix] gf cli build missing suffix 2022-03-09 11:27:52 +08:00
4f95d0a07a Repeat 'len(s)'. 2022-03-09 10:53:28 +08:00
8f326dcac5 project template update 2022-03-08 22:51:56 +08:00
aa294ea5df ci updates 2022-03-08 21:27:14 +08:00
6afc725b61 ci updates 2022-03-08 21:22:01 +08:00
ec01693773 ci updates 2022-03-08 21:04:48 +08:00
b0cf501782 ci updates 2022-03-08 20:28:18 +08:00
c2fb7ada0a improve example for package gmap 2022-03-08 20:25:34 +08:00
d0a8e60ace improve example for package gmap 2022-03-08 20:14:38 +08:00
ab36bb8842 version updates 2022-03-08 20:12:48 +08:00
0b3cd7b7ae improve handler response for ghttp.Server 2022-03-08 11:50:23 +08:00
10ed04cdb8 example updates for package gmap 2022-03-08 09:49:33 +08:00
f08c18594b Merge branch 'master' of https://github.com/gogf/gf 2022-03-07 22:35:39 +08:00
e09704a408 example updates for package gmap 2022-03-07 22:10:34 +08:00
ade9ae3c0b improve package goai 2022-03-07 21:29:37 +08:00
9cf6124c4c improve package goai 2022-03-07 21:09:02 +08:00
6d323cc529 improve package goai 2022-03-07 20:49:30 +08:00
aea9f6fe18 keep sequence in attributes definition for oai.Schemas 2022-03-07 19:46:05 +08:00
8a27463e44 ensure sequence for json.Marshal for gmap.ListMap/TreeMap 2022-03-07 17:39:41 +08:00
47ee2cba51 Merge branch 'master' of https://github.com/gogf/gf 2022-03-07 09:58:07 +08:00
531cc7b864 fix issue in package gproc 2022-03-07 09:57:51 +08:00
54bdabd94d Merge pull request #1549 from FlyingBlazer/cookie-secure-config
ghttp: add cookie security configurations
2022-03-04 17:42:44 +08:00
bb6e8fe7a8 Merge branch 'master' of https://github.com/gogf/gf 2022-03-04 11:37:30 +08:00
d5d199ebef Swagger UI updates 2022-03-04 11:36:05 +08:00
158a4589d2 Merge pull request #1637 from wangbs95/feature/fix-chinese-encode
fix(fix bug , add nexttime feature): ServeFileDownload filename doubl…
2022-03-04 09:32:01 +08:00
84c0f456c0 template pack update 2022-03-03 21:43:01 +08:00
3fcd6ef877 fix issue orphan value parsing for sructured arguments of command for package gcmd 2022-03-03 21:03:42 +08:00
b5855037f3 Improving gSession Code Coverage 2022-03-02 21:50:23 +08:00
4e2d378145 improve file uploading using strict route feature 2022-03-02 21:15:16 +08:00
38a7055017 Merge branch 'master' of https://github.com/gogf/gf 2022-03-02 21:05:14 +08:00
d64898c59a improve package goai 2022-03-02 20:00:40 +08:00
3bff71b3fc merge master and update unit test 2022-03-02 15:33:58 +08:00
8343d1cd0e Merge branch 'master' into cookie-secure-config 2022-03-02 15:20:31 +08:00
5c23c0cecd fix(fix bug , add nexttime feature): ServeFileDownload filename double quotes cause underscores before and after the final file 2022-03-02 11:00:04 +08:00
f580713478 Merge branch 'master' of https://github.com/gogf/gf 2022-03-02 10:26:20 +08:00
3c58b8d7fa improve openapi 2022-03-02 10:26:09 +08:00
072d5f9760 make options public 2022-03-02 09:56:58 +08:00
f8067f5dd5 improve package ghttp 2022-03-01 22:53:19 +08:00
ea354d10cc Merge pull request #1636 from wangbs95/feature/fix-chinese-encode
revert(fix bug , add nexttime feature): ServeFileDownload File name C…
2022-03-01 22:52:34 +08:00
4d5b41434a Merge branch 'master' of https://github.com/gogf/gf 2022-03-01 22:38:51 +08:00
1724a26957 improve package gcfg 2022-03-01 22:34:57 +08:00
cb69fbcbd6 Improving gSession Code Coverage 2022-03-01 22:12:59 +08:00
46dc68dfd5 CI update for gf cli 2022-03-01 21:20:17 +08:00
12fdfbf8b2 improve package gcfg 2022-03-01 21:14:45 +08:00
992a986d12 Merge branch 'master' of https://github.com/gogf/gf 2022-03-01 20:02:21 +08:00
68bdf7deb4 revert(fix bug , add nexttime feature): ServeFileDownload File name Chinese garbled repair 2022-03-01 18:32:11 +08:00
2362c453ec improve cli command install 2022-03-01 16:39:47 +08:00
50f6b6e0f0 fix UT case for package ghttp 2022-03-01 14:08:36 +08:00
88a9eef8a6 api swagger ui update 2022-03-01 11:43:42 +08:00
eb533f3344 Improving gfile Code Coverage 2022-02-28 22:57:53 +08:00
308e13a546 gf cli command build update 2022-02-28 22:00:25 +08:00
a0b1fefdbb Merge branch 'master' of https://github.com/gogf/gf 2022-02-28 21:58:15 +08:00
3edbcb7bf9 gf cli update 2022-02-28 21:57:59 +08:00
436931b560 Merge branch 'master' of https://github.com/gogf/gf 2022-02-28 21:15:15 +08:00
0516159ae3 Improving gcmd Code Coverage 2022-02-28 21:11:53 +08:00
cb78953b38 Merge pull request #1628 from huangqian1985/master
Improving gcmd Code Coverage
2022-02-28 20:45:01 +08:00
a1ddac4e6b Merge branch 'master' of https://github.com/gogf/gf 2022-02-28 17:49:16 +08:00
456697ea99 improve cli command install 2022-02-28 17:48:52 +08:00
8acffd1186 Improving gcmd Code Coverage 2022-02-27 21:00:23 +08:00
814450fd17 gcmd example 2022-02-27 13:22:26 +08:00
1365c1d277 Merge pull request #1623 from huangqian1985/master
Improving gjson Code Coverage
2022-02-27 08:59:19 +08:00
30be5c5e49 Improving gjson Code Coverage And Fix 2022-02-26 21:26:30 +08:00
932cd9d5bb README updates 2022-02-25 10:22:54 +08:00
7b5f17c16b gf cli pack template update 2022-02-24 22:44:48 +08:00
b5e8e68713 fix issue #1625 2022-02-24 22:07:27 +08:00
3a803ac39f fix 2022-02-24 21:41:39 +08:00
d27db119a0 fix issue #1626 2022-02-24 21:24:42 +08:00
f54d0a339c Improving gjson Code Coverage 2022-02-24 21:14:11 +08:00
5e3c0bd9aa improve clickhouse driver 2022-02-24 21:06:26 +08:00
d83b676c60 Merge branch 'gjson_example' 2022-02-24 20:15:55 +08:00
def3dc364f Merge branch 'master' of https://github.com/gogf/gf 2022-02-24 20:15:44 +08:00
298aa5f040 Improving gjson Code Coverage 2022-02-24 20:14:44 +08:00
a6bbb8424c improve clickhouse driver 2022-02-24 13:50:28 +08:00
00daeb318c improve clickhouse driver 2022-02-24 13:03:01 +08:00
65341141fe improve clickhouse driver 2022-02-24 12:58:57 +08:00
fe353c5fe3 Merge branch 'gogf:master' into feature-clickhouse-driver 2022-02-24 10:12:05 +08:00
008e5ea196 improve clickhouse driver 2022-02-23 22:53:28 +08:00
157e936f24 improve clickhouse driver 2022-02-23 22:51:37 +08:00
e4d56e7ad9 improve package gjson 2022-02-23 16:54:15 +08:00
8eb9fdfcd0 improve package gbuild; version updates 2022-02-23 12:03:21 +08:00
3db5358dcc fix issue #1615 2022-02-23 10:34:38 +08:00
d1fe0670fc Merge branch 'master' of https://github.com/gogf/gf 2022-02-23 10:27:44 +08:00
ee614f9c6b fix issue #1563 2022-02-23 10:27:31 +08:00
0fce4edcd3 Merge branch 'master' of https://github.com/gogf/gf 2022-02-23 00:46:47 +08:00
a34f52ae5e Merge branch 'gjson_example' 2022-02-23 00:46:33 +08:00
da465bb030 Improving gjson Code Coverage 2022-02-23 00:46:13 +08:00
d23b24dfba Merge pull request #1610 from huangqian1985/master
gjson Example Function
2022-02-22 22:03:54 +08:00
22941276a5 fix issue #1611 2022-02-22 21:59:18 +08:00
20a50cb198 fix issue #1615 2022-02-22 21:32:48 +08:00
f0cd3c084e fix data race in UT cases for package ghttp 2022-02-22 20:49:09 +08:00
d9c1e1f576 improve package gconv/cli 2022-02-22 20:19:41 +08:00
aa6705f493 improva gf cli, package gcfg 2022-02-22 17:42:40 +08:00
3f526c3819 command usage description update for package gf cli 2022-02-22 14:17:18 +08:00
6f5058c9b6 add x-url-path feature for ghttp.Server 2022-02-22 14:12:09 +08:00
4935416b94 add middleware for CORS with default options 2022-02-22 10:51:22 +08:00
afa58ed45b fix issue #1227 #1617 2022-02-22 10:43:31 +08:00
455d724c01 improve clickhouse driver 2022-02-19 23:10:31 +08:00
42bccb4c23 Merge branch 'master' of https://github.com/gogf/gf 2022-02-19 19:49:36 +08:00
b2b0a1828e Implemented gjson Example
1.MapStrAny 2.Interfaces 3.Interface 4.Var 5.IsNil 6.Get 7.GetJson 8.GetJsons 9.GetJsonMap 10.Set 11.MustSet 12.Remove 13.MustRemove 14.Contains 15.Len 16.Append 17.MustAppend 18. Map 19.Array 20.Scan 21.Dump
2022-02-19 19:48:50 +08:00
ea60f7e054 improve clickhouse driver 2022-02-19 17:49:53 +08:00
daf2b649ef improve clickhouse driver 2022-02-19 16:59:17 +08:00
aa87d234e3 improve clickhouse driver 2022-02-19 15:09:44 +08:00
5eec9ce7b1 Modify Function Name 2022-02-19 11:43:45 +08:00
7812f41b43 fix issue #1219 2022-02-17 23:04:50 +08:00
0bd3537a78 Implemented gjson Example
1.SetViolenceCheck 2.ToJson 3.ToJsonString 4.ToJsonIndent 5.ToJsonIndentString 6.MustToJson 7.MustToJsonString 8.MustToJsonIndent 9.MustToJsonIndentString 10.ToXml 11.ToXmlString 12.ToXmlIndent 13.ToXmlIndentString 14.MustToXml 15.MustToXmlString 16.MustToXmlIndent 17.MustToXmlIndentString 18.ToYaml 19.ToYamlString 20.ToYamlIndent 21.MustToYaml 22.MustToYamlString 23.ToToml 24.ToTomlString 25.MustToToml 26.MustToTomlString 27.ToIni 28.ToIniString 29.MustToIni 30.MustToIniString 31.MarshalJSON 32.UnmarshalJSON 33.UnmarshalValue
2022-02-17 22:54:29 +08:00
fdf09b5978 improve UT case for package gtimer 2022-02-17 22:45:06 +08:00
17d7c92b9d fix issue #1217 2022-02-17 22:42:33 +08:00
b6a7788240 fix issue #1609 2022-02-17 22:24:50 +08:00
00ccce7bb8 fix issue #1607 2022-02-17 22:02:51 +08:00
54b564b871 fix UT cases for package ghttp 2022-02-17 21:14:11 +08:00
5882a9dc21 Merge branch 'gjson_example' 2022-02-17 20:30:26 +08:00
144249fcff Implemented gjson Example
1.SetSplitChar
2022-02-17 20:29:38 +08:00
31ce55eb4d cli update 2022-02-17 17:52:48 +08:00
255b502460 README update 2022-02-17 17:15:09 +08:00
073869b354 downgrade otel version from v1.3.0 to v1.0.0 2022-02-17 15:47:08 +08:00
9fdf20b3e2 add SetError for ghttp.Request 2022-02-17 11:51:21 +08:00
2461ef9f29 fix issue #1597 2022-02-17 11:46:35 +08:00
f8f13bd905 Implemented gjson Example
1.Unmarshal 2.Encode 3.MustEncode 4.EncodeString 5.MustEncodeString 6.Decode 7.DecodeTo 8.DecodeToJson
2022-02-16 22:38:25 +08:00
948cb9ff7c enhance from issue #1589 2022-02-16 20:51:39 +08:00
fa39b9ee54 fix issue in UT cases for package gring 2022-02-16 15:31:01 +08:00
6d09328d6d improve package goai; add example for array items response definition 2022-02-16 15:28:40 +08:00
77fc8866bf fix issue #1567 2022-02-16 01:12:22 +08:00
a5cc03ff25 fix issue #1563 2022-02-16 00:47:23 +08:00
5ab959ba58 fix issue #1554 2022-02-16 00:26:06 +08:00
86b90ed4b6 enhancement from #1552 2022-02-15 23:55:05 +08:00
6ffdff7095 fix issue #1537 2022-02-15 23:43:47 +08:00
37c6320dd7 fix issue #1530 2022-02-15 23:04:37 +08:00
33367fd3ee Implemented gjson Example
1.ExampleValid 2.ExampleMarshal 3.ExampleMarshalIndent
2022-02-15 23:02:48 +08:00
3a1cd3d588 Merge branch 'master' of https://github.com/gogf/gf into gjson_example 2022-02-15 22:15:33 +08:00
4fc27f6509 Implemented gjson Example
1. ExampleLoad 2.ExampleLoadJson 3.ExampleLoadXml 4.ExampleLoadIni 5.ExampleLoadYaml 6.ExampleLoadToml
7.ExampleLoadContent 8.ExampleLoadContentType 9.ExampleIsValidDataType
2022-02-15 22:08:51 +08:00
f0b78253b2 fix issue #1605 2022-02-15 01:10:03 +08:00
2428b27168 fix issue #1488 2022-02-15 00:21:05 +08:00
01ba56c38b remove function Set for package gcfg 2022-02-14 17:20:27 +08:00
887cad3b96 fix issue #1458 2022-02-14 17:04:14 +08:00
14268aa1c0 fix issue #1405 2022-02-14 16:33:07 +08:00
23c00eb83f fix issue #1394 2022-02-14 16:08:26 +08:00
5f2047d61b fix issue in configuration StdoutColorDisabled for package glog; rename TempDir to Temp for package gfile 2022-02-14 14:50:25 +08:00
1f9d86f015 improve configuration read from package frame/gins 2022-02-14 11:46:20 +08:00
8cb6086f73 Implemented gjson Example
1. New 2.NewWithTag 3.NewWithOptions
2022-02-12 17:27:32 +08:00
a887cedb99 example update 2022-02-09 16:51:15 +08:00
1fb9be0628 improve trace feature for package gdb/gredis; add trace example cases 2022-02-09 02:49:29 +08:00
caf03b223b CI update 2022-02-08 23:57:57 +08:00
f77d388d4f CI update 2022-02-08 23:55:14 +08:00
d0cfeb2a8c CI update 2022-02-08 23:52:29 +08:00
0a6e4ebf18 CI update 2022-02-08 23:25:33 +08:00
dd34892857 CI update 2022-02-08 23:19:19 +08:00
af39eb4c9f CI update; Example update for package gcache 2022-02-08 23:13:33 +08:00
bd4948c084 fix UT case for package gdb 2022-02-08 16:38:10 +08:00
cea6cbc7db Merge pull request #1595 from stardemo/master
Update Github Action badge
2022-02-08 16:31:16 +08:00
54ccbfef98 tempale content update for cmd gf 2022-02-08 16:30:38 +08:00
88b124b29a UT cases for package gdb 2022-02-08 14:43:39 +08:00
7eff3bc697 Update Github Action badge 2022-02-02 11:18:22 +08:00
c3161d58fd improve registry for package ghttp 2022-01-29 21:42:48 +08:00
e2a0cb97ae up 2022-01-29 21:30:48 +08:00
4fae47db63 add secondary configuration node name for http server; improve package gsvc 2022-01-28 17:29:05 +08:00
48b5f37894 move grpc packages to katyusha 2022-01-28 16:23:44 +08:00
ff1755d2db cli update 2022-01-28 16:18:16 +08:00
f13ccd8527 Merge branch 'master' into feature-gsvc 2022-01-28 16:09:21 +08:00
a97d74b15c cli update 2022-01-28 16:07:00 +08:00
8b48f16508 improve service registry for package ghttp; improve service discovery for package gclient; improve cli 2022-01-28 16:00:16 +08:00
04eb654133 add error stack for internal error printing 2022-01-28 14:51:49 +08:00
1a000396e2 improve gf command gen dao 2022-01-28 10:27:33 +08:00
3a658cdb85 improve service registry for package ghttp/gclient 2022-01-27 18:12:39 +08:00
3cb578488c add service registry feature for package ghttp/gclient 2022-01-27 16:50:31 +08:00
c845d1d93d add Weight/RoundRobin/LeastConnection selector for package gsel; improve package balancer 2022-01-27 15:15:55 +08:00
d322e67117 fix string print for time only gtime.Time; improve package drivers 2022-01-27 12:04:46 +08:00
9ff17810a4 add raw grpc example using gsvc/resolver/registry-etcd 2022-01-26 23:43:48 +08:00
5f87591407 improve package gsvc 2022-01-26 22:23:54 +08:00
65c385c013 add etcd registry; add resolver; improve balancer 2022-01-26 20:51:17 +08:00
8094968605 README update 2022-01-26 17:05:30 +08:00
7ac9c46f12 mark underlying PostForm function deprecated for gclient.Client 2022-01-25 23:01:35 +08:00
01b9fa8ac9 improve package gcfg 2022-01-25 20:43:57 +08:00
adb4a1e6c0 README update 2022-01-25 10:21:59 +08:00
c371e5221a improve package gsel 2022-01-24 23:33:56 +08:00
c9529199a1 add package gsvc/gsel 2022-01-24 23:09:26 +08:00
f2e7f18d61 CI update 2022-01-24 16:32:59 +08:00
96044822a0 CI update 2022-01-24 16:12:32 +08:00
c469d0277f README update 2022-01-24 15:50:15 +08:00
221082b967 command -> cmd 2022-01-24 14:49:56 +08:00
2c2acfb5b8 README update 2022-01-24 14:47:22 +08:00
76b819ae3b move gf cli and gdb drivers into gf repo. 2022-01-24 14:41:23 +08:00
43f1354e79 fix configuration support for package gcmd 2022-01-24 10:32:19 +08:00
6e1c76efe6 add GetAdapter for package gcache; add GetStorage for package gsession 2022-01-23 15:14:06 +08:00
e517bf7b0e improve details for package gjson/gtcp/gudp 2022-01-22 15:45:38 +08:00
3b811c3434 add GetFreePort/GetFreePorts for package gtcp/gudp 2022-01-22 15:33:31 +08:00
9e3a49dd1b add GetFreePort/GetFreePorts for package gipv4 2022-01-22 15:12:58 +08:00
65d1648c30 improve seconds unit support in configuration for package gredis 2022-01-22 13:48:09 +08:00
a4d80bf743 move db drivers to github.com/gogf/gf/gdb-drivers 2022-01-21 18:06:35 +08:00
a15ec0d677 expose attributes of struct Result for package gdb 2022-01-21 17:43:00 +08:00
7e5301c845 expose insert option constants for package gdb 2022-01-21 17:31:48 +08:00
795ac4773e Merge branch 'master' of https://github.com/gogf/gf 2022-01-21 12:38:22 +08:00
c75cce0378 fix issue in package gjson for interface assertion of nil Json 2022-01-21 12:38:06 +08:00
5760289d2a Merge pull request #1574 from qinyuguang/gdb_ping
gdb Ping with context
2022-01-21 12:13:39 +08:00
619e256138 improve package gcron/gtimer 2022-01-20 15:53:16 +08:00
7401fb09c9 add examples for package gcmd 2022-01-19 23:35:23 +08:00
bb37e5ac88 remove Handler feature for gcmd.Parser 2022-01-19 21:07:48 +08:00
69935f3d1c remove ContainsOpt from package gcmd 2022-01-19 20:25:04 +08:00
3dcd9b535b UT update for package gclient/ghttp 2022-01-19 18:26:39 +08:00
e90f72b538 improve UT cases for package gtime 2022-01-19 18:23:04 +08:00
9efc2894d4 improve UT cases for package gtime 2022-01-19 18:18:30 +08:00
07c5ce0bbc improve UT cases for package gtime 2022-01-19 17:26:39 +08:00
3bbbe1db9c change pointer receiver that implements interface MarshalJSON to struct receiver for all packages 2022-01-19 16:55:57 +08:00
d7b94428ae fix issue in json marshal for package egtime 2022-01-19 16:44:58 +08:00
033e2c1d78 fix issue in rules of gmeta.Meta for package gvalid 2022-01-18 15:43:12 +08:00
9345eb5e94 dto -> do for package gdb 2022-01-17 21:10:58 +08:00
220ed74ad1 fix gstr.IsNumeric 2022-01-17 19:42:21 +08:00
658ca8c0fd Eg 2022-01-17 17:14:40 +08:00
56f88f759a add buildin function yamli for package gview 2022-01-17 17:10:44 +08:00
ee1585fb24 gdb Ping with context 2022-01-17 15:58:31 +08:00
c72a9f2e1e add buildin functions xml/ini/yaml/toml for package gview 2022-01-17 15:55:45 +08:00
d4b502f14e fix issue #1571 2022-01-15 22:15:10 +08:00
d32acabcef fix issue #1570 2022-01-15 21:38:15 +08:00
4943c3a9e0 add UT cases for package gjson 2022-01-15 20:25:29 +08:00
58290ec9ea fix issue in package ghash 2022-01-15 20:17:40 +08:00
6468d55a81 add absolute file path support for package gcfg/gview 2022-01-14 17:16:38 +08:00
fe93d7b332 add GetRegisteredRuleMap function, add internal logging for rule overwrite situation of package gvalid 2022-01-14 16:46:25 +08:00
067514b74f Merge branch 'master' of https://github.com/gogf/gf 2022-01-13 21:32:17 +08:00
aff2fbdc54 Merge branch 'master' of https://github.com/gogf/gf 2022-01-13 21:31:37 +08:00
805f60efa1 improve package ghash 2022-01-13 21:31:23 +08:00
b0b1b61280 Merge pull request #1555 from larryclean/master
修改gdb cache的key为gcache:md5(sql)方式
2022-01-13 21:29:55 +08:00
c09f22242f Merge pull request #1566 from qinyuguang/pgsql_dropped_field
gdb pgsql skip dropped fields
2022-01-13 20:57:31 +08:00
9892cc46e4 improve package ghttp 2022-01-13 20:57:13 +08:00
6e12aa4bf7 fix issue #1568 2022-01-13 20:49:26 +08:00
8731123030 add StdoutColorDisabled configuration for package glog 2022-01-13 15:22:27 +08:00
eaeb8e03ab gdb pgsql skip dropped fields 2022-01-13 14:20:01 +08:00
6ded700f92 add options for Decode/DecodeTo/DecodeToJson functions of package gjson 2022-01-13 12:09:04 +08:00
e5613e8690 improve function New for creating db by specified configuration node 2022-01-12 21:57:46 +08:00
45fbb5326c README updates 2022-01-12 20:43:36 +08:00
b09f4e9240 Merge branch 'master' of https://github.com/gogf/gf 2022-01-12 20:42:38 +08:00
c2f2ad7a28 README updates 2022-01-12 20:42:11 +08:00
0534994fa8 Merge pull request #1546 from eh-steve/eh-steve/gconv-map-recurse
Recurse map fields inside structs
2022-01-12 20:01:31 +08:00
9486f6e7e9 improve package gcmd/ghttp 2022-01-12 19:39:38 +08:00
343985ad12 Add tests to highlight problem cases previously failing 2022-01-10 18:53:32 +00:00
0f67559995 add gcode.WithCode 2022-01-10 22:58:29 +08:00
280c3b4a86 improve package gvar; remove gvar.Create 2022-01-10 20:33:09 +08:00
d4cb1666e5 improve package gclient for constants 2022-01-10 16:42:30 +08:00
bc29e86e58 Merge branch 'master' of https://github.com/gogf/gf 2022-01-10 15:50:15 +08:00
2e76268005 Merge branch 'gogf:master' into master 2022-01-10 10:34:37 +08:00
9abaf744f2 edit imports sort 2022-01-10 10:02:03 +08:00
6232c873b8 Revert "Use Copyfile() to back up the log, so as not to continue writing the log to the old file because the old fd is not closed #1366"
This reverts commit a3bab8db55.
2022-01-08 12:10:39 +08:00
a3bab8db55 Use Copyfile() to back up the log, so as not to continue writing the log to the old file because the old fd is not closed #1366 2022-01-08 12:02:56 +08:00
d30862373e 修正测试数据库配置 2022-01-07 22:25:00 +08:00
ee4ca43bd5 Safe() 2022-01-07 22:21:18 +08:00
3bed3e4f5b 修改gdb cache的key为gcache:md5(sql)方式 2022-01-07 22:14:47 +08:00
0dc1adb672 orderBy raw() 2022-01-07 21:06:49 +08:00
d045b4d2f5 make unit test compatible with go 1.15 2022-01-07 18:52:21 +08:00
572e71d76a add CookieOptions
add UnitTest
2022-01-07 17:10:21 +08:00
09f83bdd58 add panic for ghttp.Server.GetBody 2022-01-06 21:47:36 +08:00
61c9d5fb3f Merge pull request #1 from gogf/master
是是是
2022-01-05 19:14:33 +08:00
c91b83969c WIP: add cookie security configuration 2022-01-05 14:33:20 +08:00
47cefbf6d7 允许多次调用Order 2022-01-05 11:53:50 +08:00
4cdddbd6e0 Recurse map fields inside structs 2022-01-04 19:22:18 +00:00
99455e328b Merge pull request #1535 from starccck/master
support manipulate pg.Array type data
2022-01-04 21:24:44 +08:00
ee25d696eb improve package gcmd 2022-01-01 20:20:49 +08:00
c17530a6db improve command not found error for package gcmd 2022-01-01 19:57:43 +08:00
0a7e4be4ef improve DoCommit for package gdb 2022-01-01 15:47:17 +08:00
c1586a3b81 improve package gcmd 2022-01-01 00:58:10 +08:00
09f9d1cb7a improve package gcmd 2022-01-01 00:18:50 +08:00
00692c50da improve package gaes 2021-12-31 14:24:07 +08:00
4663978fde improve package gaes 2021-12-30 23:02:34 +08:00
130a67c72b improve package gaes 2021-12-30 23:02:18 +08:00
fd5b0fdf49 comment update 2021-12-30 00:20:38 +08:00
f04715bccb support manipulate pg.Array type data 2021-12-29 00:13:22 +08:00
3932e0b15f add OmitEmpty support for WhereIn 2021-12-28 17:15:01 +08:00
b00de2c617 add gdb.DB.DoFilter; improve function gdb.DB.DoCommit for package gdb 2021-12-27 20:51:26 +08:00
14e96069f2 comment update for package gvalid 2021-12-26 23:17:33 +08:00
079cf9d7b8 add function EncodeString for package gjson 2021-12-26 16:16:16 +08:00
ca5c0cc84d add MustEncodeString for package gjson 2021-12-26 14:42:09 +08:00
984e5f98f7 add MustEncode for package gjson 2021-12-26 11:26:36 +08:00
b79e4a3ab7 add interface function ConvertDataForRecord for gdb.DB 2021-12-23 22:00:28 +08:00
fab17f89c4 fix issue in ut for package gsha1/gclient/ghttp/gregex 2021-12-23 00:34:02 +08:00
48c5c1e5a8 change errors wrapped by gerror.Wrap with error stack info for all packages 2021-12-23 00:09:00 +08:00
b9bb1ecd46 Merge branch 'master' of https://github.com/gogf/gf into feature/v2-gerror 2021-12-22 22:29:02 +08:00
2a8e2f9f2c Merge pull request #1524 from houseme/master
feat:improve tracing
2021-12-22 22:26:15 +08:00
e5f1b74bd9 Merge pull request #1527 from huangqian1985/master
tidy gstr files
2021-12-22 22:25:29 +08:00
cafd9098d7 change errors wrapped by gerror.Wrap with error stack info for all packages 2021-12-22 22:22:42 +08:00
b39b2374c4 Added Order() method support for gdb. 2021-12-22 20:51:03 +08:00
739490c62b revert file 2021-12-22 20:23:24 +08:00
8de8a0c97a Merge branch 'master' of https://github.com/gogf/gf 2021-12-22 20:01:50 +08:00
44089d70d4 Merge branch 'master' of https://github.com/gogf/gf into feature/v2-gerror 2021-12-22 18:28:04 +08:00
aabc1f8322 fix issue in time maintaining feature for package gdb 2021-12-22 17:42:26 +08:00
09493bbc36 Merge branch 'master' of https://github.com/gogf/gf 2021-12-21 23:25:10 +08:00
e389d73c65 Merge remote-tracking branch 'origin/master' 2021-12-21 23:25:04 +08:00
a9647a7bf3 tidy gstr file 2021-12-21 23:24:38 +08:00
ce93b625d4 change errors wrapped by gerror.Wrap with error stack info for all packages 2021-12-21 22:59:14 +08:00
bdf8244f7d Merge branch 'gogf:master' into master 2021-12-21 22:55:21 +08:00
7e81600772 improve package gjson 2021-12-20 00:32:23 +08:00
de17302ad0 fix issue in gstr.ReplaceI 2021-12-19 21:04:35 +08:00
25bdf10cc8 feat:improve tracing 2021-12-19 00:44:31 +08:00
02c6deaec8 feat:modify trace-ID to TraceID 2021-12-19 00:18:18 +08:00
63d384b676 help content update for pakcga egcmd 2021-12-18 23:27:41 +08:00
29a996e70e add Trace-Id response header for package ghttp 2021-12-18 21:54:12 +08:00
4978955404 fix issue in missing handler name for standard router handlers 2021-12-18 18:25:04 +08:00
a7c4597c97 Merge remote-tracking branch 'origin/master' 2021-12-18 17:20:50 +08:00
57a1a7607a improve package gsession 2021-12-18 17:14:33 +08:00
31772d5eac add fnction Mustremove for package gsession 2021-12-18 14:13:36 +08:00
77422f71f7 add fnction MustSet/MusetSetMap for package gsession 2021-12-18 14:10:55 +08:00
40225c5352 improve route dump for package ghttp;remove mutex for package gtag 2021-12-18 12:54:09 +08:00
ad48dc025b improve route dump for package ghttp 2021-12-18 12:43:33 +08:00
1215f67aac improve route dump for package ghttp 2021-12-18 12:36:34 +08:00
b9907ae3ba improve package gview for default folder searching 2021-12-17 21:38:10 +08:00
656d1bbbd6 improve content type response for ghttp.Server 2021-12-17 17:42:18 +08:00
20c0e6d68f error message update for package gconv 2021-12-17 17:28:02 +08:00
b27259aded fix issue converting empty map[string]string to map[string]interface{} 2021-12-17 17:22:55 +08:00
3658faafae improve help content printing for package gcmd 2021-12-17 15:47:48 +08:00
0b05c9e3e7 improve function gdb.Core.HasTable 2021-12-17 12:26:30 +08:00
f3c25ecba9 fix issue in ut for package gcache/gfsnotify 2021-12-17 12:11:40 +08:00
b9d6ac26d1 rename cache function from func() (interface{}, error) to func(ctx context.Context) (value interface{}, err error) for package gcache; add cache for function Tables of gdb.Core; improve Where condition with prefix handling for package gdb 2021-12-17 11:46:05 +08:00
f583f28953 rename SetTraceID to WithTraceID for package gtrace 2021-12-17 01:27:24 +08:00
b6d60fc209 downgrade otel version to v1.0.0 2021-12-17 00:55:48 +08:00
f72ba0b64d fix issue in ut of package internal/tracing 2021-12-17 00:11:41 +08:00
8f24dc3549 add SetTraceID for package gtrace 2021-12-17 00:06:38 +08:00
4de74464ac fix issue in unit testing case for package gctx/glog 2021-12-16 23:38:40 +08:00
fa45715416 go fmt for go 1.17 2021-12-16 23:26:41 +08:00
df68ce23d2 min required go version upgrade to 1.16 2021-12-16 23:18:12 +08:00
aee52fd56e enable OpenTelemetry in default for some core components 2021-12-16 23:09:37 +08:00
000483cc6f Merge branch 'master' of https://github.com/gogf/gf 2021-12-16 12:45:27 +08:00
f4e8eff813 improve help content printing for package gcmd 2021-12-16 12:45:00 +08:00
4143722f6f Merge pull request #1521 from huangqian1985/master
gstr Example Function
2021-12-16 10:05:01 +08:00
b0675400e3 Merge branch 'gstr_sample' 2021-12-15 21:18:55 +08:00
eb5332ea11 Merge branch 'master' of https://github.com/gogf/gf 2021-12-15 21:18:49 +08:00
ff2e9b568b Implemented gstr Example
1. PrefixArray 2.SubStrFrom 3.SubStrFromEx 4.SubStrFromR 5.SubStrFromREx
2021-12-15 21:15:34 +08:00
19c9f0a488 add DTO feature for package gdb 2021-12-15 00:01:59 +08:00
90e116fb9e Merge branch 'master' of https://github.com/gogf/gf 2021-12-14 23:54:53 +08:00
e28be8d114 reorder the sample function 2021-12-14 23:54:15 +08:00
36e05561cc improve Export feature for package gres 2021-12-14 23:49:08 +08:00
bc2ce19876 add Export feature for package gres 2021-12-14 23:01:20 +08:00
4c7e409e61 improve argument/option printing content for package gcmd 2021-12-14 22:34:06 +08:00
a4bb80b6fd Merge branch 'master' of https://github.com/gogf/gf 2021-12-14 21:13:58 +08:00
bb1a95fff8 fix issue in gproc.ShellExec 2021-12-14 21:01:36 +08:00
937845e67d Merge branch 'master' of https://github.com/gogf/gf 2021-12-14 16:14:04 +08:00
7d84ab761b improve package gcmd for help content printing 2021-12-13 20:30:56 +08:00
80daed6bdf add repeated checks for command name, argument name and short name for package gcmd 2021-12-13 20:18:13 +08:00
1015fb5338 improve package gcmd 2021-12-13 19:59:41 +08:00
e401ba0f43 Merge branch 'master' of https://github.com/gogf/gf 2021-12-11 23:11:35 +08:00
b4e6abc460 Adjust the function sequence 2021-12-11 23:11:17 +08:00
a1fb5f18dc improve package gcmd 2021-12-11 01:11:40 +08:00
780d06b19e improve package gcmd 2021-12-11 00:57:26 +08:00
3a20883a81 improve package gcmd 2021-12-11 00:12:58 +08:00
f0c25d8476 improve package gcmd/gtag 2021-12-10 23:58:10 +08:00
34e7913268 add internal logging for package gtrace 2021-12-10 23:26:53 +08:00
e10ba4cf67 improve stack filtering for package gdebug/glog 2021-12-10 22:54:32 +08:00
39bbca2a50 add stack filter of goframe module path for logging content 2021-12-10 18:52:35 +08:00
e02bdd875d add stack filter of goframe module path for logging content 2021-12-10 18:25:28 +08:00
3f24159636 add tracing configuration switch for whole framework 2021-12-10 18:08:36 +08:00
4769fbf383 Merge branch 'master' of https://github.com/gogf/gf 2021-12-09 23:49:53 +08:00
f25f8e8033 add argument feature for package gcmd 2021-12-09 23:49:39 +08:00
6a7722995e Merge pull request #1517 from huangqian1985/master
gpool Function Example
2021-12-09 22:34:45 +08:00
892619678e Merge branch 'master' of https://github.com/gogf/gf 2021-12-09 21:29:15 +08:00
8a2f49a4d2 Merge remote-tracking branch 'origin/master' 2021-12-09 21:28:52 +08:00
57a939e10b Implemented gpool All Example 2021-12-09 21:28:03 +08:00
01930c9899 improve package gcmd 2021-12-08 19:50:28 +08:00
4f0b45aeac improve package gcmd 2021-12-08 19:21:25 +08:00
b7b71795a4 improve package gcmd 2021-12-07 22:19:28 +08:00
9c41f2e3f8 improve package gcmd 2021-12-07 22:10:19 +08:00
a8d6363e79 inject Command into context and add function CommandFromCtx for package gcmd 2021-12-07 21:55:06 +08:00
5dcdb66794 add MustShell/MustShellRun/MustShellExec for package gproc 2021-12-07 21:13:50 +08:00
0c1de766bc Merge branch 'master' of https://github.com/gogf/gf 2021-12-07 21:03:23 +08:00
ad64a29145 add MustSet/MusetRemove for package genv 2021-12-07 21:03:06 +08:00
885ddd36fc Merge branch 'master' of https://github.com/gogf/gf 2021-12-07 19:09:09 +08:00
6a82fdb888 add config feature for package gcmd 2021-12-07 19:08:52 +08:00
02f01323f9 Merge pull request #1510 from huangqian1985/master
Validator Function Example
2021-12-07 19:07:54 +08:00
5af426d265 Merge branch 'gvalid_Example' 2021-12-07 13:50:11 +08:00
10fc81f716 modify gvalid sample file name 2021-12-07 13:49:08 +08:00
4b168f5579 Merge branch 'gvalid_Example' 2021-12-06 22:20:41 +08:00
a0a9ecfa20 Merge branch 'master' of https://github.com/gogf/gf into gvalid_Example 2021-12-06 22:20:15 +08:00
ff36667dbc move sample function to right file 2021-12-06 22:20:00 +08:00
667b6aa4ca Merge branch 'gvalid_Example' 2021-12-05 22:18:39 +08:00
e11698dc2a modify function name 2021-12-05 22:18:13 +08:00
dacc19ac98 Merge pull request #1508 from Hades300/GetRemoteIp-IPv6Fix
ghttp_request.go GetRemoteIp ipv6 fix
2021-12-05 21:59:20 +08:00
d330e9ac8f Merge pull request #1509 from victory460/master
fix a comment error in IsSubDomain
2021-12-05 21:57:43 +08:00
85d01f3d9e Merge branch 'gvalid_Example'
# Conflicts:
#	util/gvalid/gvalid_z_example_test.go
2021-12-05 15:01:08 +08:00
15fd815144 Merge branch 'master' of https://github.com/gogf/gf into gvalid_Example 2021-12-05 14:56:50 +08:00
68a8a456c9 move function sample to new file 2021-12-05 14:56:34 +08:00
2bb80593a7 Merge pull request #1511 from houseme/master
Update README.MD
2021-12-04 23:51:56 +08:00
58992fa0ba Merge branch 'master' of https://github.com/gogf/gf 2021-12-04 23:34:34 +08:00
0e3a8576b4 improve debugging feature 2021-12-04 23:07:54 +08:00
8586f31e03 github action 2021-12-04 22:44:02 +08:00
bca467cd15 github action 2021-12-04 22:43:30 +08:00
21215f6b2f github action 2021-12-04 22:36:13 +08:00
cb6095dc17 github action 2021-12-04 22:17:35 +08:00
8121b9c794 test commit 2021-12-04 21:29:37 +08:00
66450b0ecd disable debugging internal logging content in github action 2021-12-04 20:51:24 +08:00
a4d7cf14a7 Merge branch 'master' of https://github.com/gogf/gf 2021-12-04 20:50:09 +08:00
65fde53083 Update README.MD 2021-12-04 18:25:24 +08:00
acb2bc7d99 Merge branch 'master' of https://github.com/gogf/gf into gvalid_Example 2021-12-04 14:35:45 +08:00
7b9a03d13c Implemented Validator Example
1.RuleFunc 2.RuleFuncMap
2021-12-04 14:35:33 +08:00
b6df7b94d0 change MaxConnCount to 0 for ulimited connections for package gdb 2021-12-04 13:57:38 +08:00
71399d1f65 improve package gcmd 2021-12-04 00:26:45 +08:00
0da5535bda improve package gvalid 2021-12-04 00:11:57 +08:00
c74a33f04a README update 2021-12-04 00:07:49 +08:00
ecfedff32a README update 2021-12-04 00:07:05 +08:00
34bf315623 README update 2021-12-04 00:05:54 +08:00
3f030b1f6e improve error message for invalid rule for package gvalid 2021-12-03 23:56:00 +08:00
8de176d73f move package /net/ghttp/internal/client as /net/gclient 2021-12-03 23:32:00 +08:00
afc3367f31 auto enable dump feature for ghttp.Client 2021-12-03 17:49:26 +08:00
f56c2ed356 fix a comment error in IsSubDomain
Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
2021-12-03 17:19:42 +08:00
e2fbce0420 ghttp_request.go GetRemoteIp ipv6 fix 2021-12-03 16:07:04 +08:00
80e8a58f45 add NeedArgs feature for package gcmd 2021-12-02 23:50:29 +08:00
26ef8c5872 add root tag in matadata of struct to specify the root command function for the object for package gcmd 2021-12-02 23:31:06 +08:00
b840405af6 improve error logging format for ghttp.Server 2021-12-02 21:22:02 +08:00
6aa39b3451 improve package gcfg 2021-12-02 20:55:41 +08:00
c1b75b9071 improve package gcmd 2021-12-02 20:27:26 +08:00
65e1048715 improve package gcron 2021-12-02 20:05:29 +08:00
9ed6ebbcff Merge pull request #1384 from kingeasternsun/processconflict
feat(fix bug , add nexttime feature):
2021-12-02 19:50:01 +08:00
e615528f17 Merge pull request #1506 from houseme/master
feat:add trace db.statement、host.name
2021-12-02 19:47:07 +08:00
261fa7e843 Merge pull request #1505 from jqb44179/feature/gfile_example
pull request by gfile example
2021-12-02 19:41:21 +08:00
5ed5adc6df feat:add trace db.statement、host.name 2021-12-02 18:54:56 +08:00
tom
632b7f34ae add gfile example 2021-12-02 17:27:53 +08:00
9659f45fbb Implemented Validator Example
1.Ci 2.Data 3.Assoc 4.Rules 5.Messages
2021-12-01 23:16:16 +08:00
30a597cadc Merge pull request #1501 from ehproject-teamer/master
update MarshalJSON example
2021-12-01 22:18:25 +08:00
e4e98caf8f Merge branch 'master' of https://github.com/gogf/gf into gvalid_Example 2021-11-30 23:49:34 +08:00
6b5f111b6a Implemented gvalid Example
1.New 2.Run 3.Clone 4.I18n
2021-11-30 23:48:26 +08:00
8f0c0337c5 update gtime example output 2021-11-30 23:10:02 +08:00
d87413fb23 Merge branch 'master' of https://github.com/ehproject-teamer/gf 2021-11-30 22:55:51 +08:00
0340fb7124 update gtime example 2021-11-30 22:53:28 +08:00
6c19844a2f Merge branch 'gogf:master' into master 2021-11-30 22:50:48 +08:00
dd0045e36f improve package gcmd 2021-11-30 16:43:42 +08:00
6acb2f46e6 update gtime example 2021-11-29 10:14:55 +08:00
578d8218bd go fmt 2021-11-29 10:08:12 +08:00
f754bdbb0e Update gtime_z_example_time_test.go 2021-11-29 10:05:52 +08:00
3ff77a87d4 add json 2021-11-28 23:57:49 +08:00
2ead7606b2 go fmt 2021-11-28 23:41:41 +08:00
1fdf85e3b8 update MarshalJSON example 2021-11-28 23:36:21 +08:00
18c4082bd2 Merge branch 'master' of https://github.com/gogf/gf 2021-11-27 20:54:15 +08:00
45e9e108bd add search folders for package gcfg 2021-11-27 20:54:02 +08:00
ec55463856 Merge pull request #1500 from huangqian1985/master
AVLTree Example And RedBlackTree Example
2021-11-27 20:37:02 +08:00
8944635bf9 modify "May Output" to "Output"
modify fuinction name
2021-11-27 20:07:39 +08:00
c4b45d2400 modify "May Output" to "Output" 2021-11-27 19:33:00 +08:00
b444a661c2 Merge branch 'master' of https://github.com/gogf/gf 2021-11-27 19:12:04 +08:00
085ac39231 Implemented RedBlackTree All Example 2021-11-27 19:11:14 +08:00
f5bd5a8748 Implemented AVLTree All Example 2021-11-27 18:09:16 +08:00
478f901595 Fix AVLTree MarshalJSON() Bug 2021-11-27 18:08:48 +08:00
5073413ffc improve TableFields feature for package gdb 2021-11-27 12:59:41 +08:00
7bdb4fe660 fix unit testing case for package gcache 2021-11-27 12:10:05 +08:00
bf8afc96e4 improve instance creating of database for package gins 2021-11-27 11:53:05 +08:00
817c3ce698 add Available function for Adapter of package gcfg 2021-11-27 01:36:21 +08:00
c33378540a add Available function for Adapter of package gcfg 2021-11-27 01:33:53 +08:00
c160500c7d Merge branch 'master' of https://github.com/gogf/gf 2021-11-27 01:10:14 +08:00
35cf228d83 add AdapterRedis for package gcache 2021-11-27 01:10:00 +08:00
b0eb76359e Implemented AVLTree Example
1.ExampleNewAVLTree 2.ExampleNewAVLTreeFrom
Implemented RedBlackTree Example
1.ExampleNewRedBlackTree 2.ExampleNewRedBlackTreeFrom
2021-11-27 00:04:43 +08:00
16a05f1450 Fix IteratorAscFrom() And IteratorDescFrom() Panic Bug 2021-11-27 00:02:19 +08:00
1749af1416 Merge branch 'master' of https://github.com/gogf/gf into gtree_Example 2021-11-26 23:37:07 +08:00
ae7685278d Merge pull request #1496 from huangqian1985/master
BTree Example
2021-11-26 23:32:49 +08:00
b63786cd75 Merge branch 'master' of https://github.com/gogf/gf into gtree_Example 2021-11-26 23:21:19 +08:00
e5c3444ea6 Merge branch 'master' of https://github.com/gogf/gf 2021-11-26 23:03:10 +08:00
0ded168715 Merge branch 'master' of https://github.com/gogf/gf into gtree_Example 2021-11-26 22:57:12 +08:00
a7b78b00b1 comment update for package gtree 2021-11-26 22:49:06 +08:00
a0c139f6a7 rename words and format output 2021-11-26 21:05:01 +08:00
b649c5aca8 Merge pull request #1486 from Hamster601/gvar_dev
add gvar example
2021-11-26 20:38:37 +08:00
56c13c2abf Merge pull request #1495 from mojo-zd/master
remove unnecessary code
2021-11-26 20:38:06 +08:00
e21cd301c2 Merge pull request #1499 from zxr615/fix_orderby_null
order by null is not escaped
2021-11-26 20:37:27 +08:00
656fb99b6a add test case 2021-11-26 11:48:15 +08:00
1725d247ae order by null is not escaped 2021-11-26 10:38:50 +08:00
85aa850539 Merge branch 'master' into gvar_dev 2021-11-26 10:25:49 +08:00
2cae1412f9 add line 2021-11-26 10:25:25 +08:00
f78d65833b Fix Left() And Right() Panic Bug 2021-11-25 23:56:51 +08:00
2c542cfd46 Implemented BTree Example
1.Keys 2.Values 3.Map 4.MapStrAny 5.Clear 6.Replace 7.Height 8.Left 9.Right 10.String 11.Search 12.Print 13.Iterator 14.IteratorFrom 15.IteratorAsc 16.IteratorAscFrom 17.IteratorDesc 18.IteratorDescFrom 19.MarshalJson
2021-11-25 23:55:36 +08:00
ab1f64a83e remove unnecessary code 2021-11-25 22:01:47 +08:00
9105590c69 improve chaining feature for ghttp.Client 2021-11-25 16:23:18 +08:00
fe1ca3cc22 format 2021-11-25 16:13:12 +08:00
c906990b63 add http instance function for package gins 2021-11-25 16:06:02 +08:00
23f13c0f6a 新增gvar使用示例 2021-11-25 15:50:58 +08:00
be0df90d05 add strict attribute for gcmd.Command for strict option parsing 2021-11-25 14:56:15 +08:00
65b6fbba84 Implemented BTree Example
1.GetVar 2.GetVarOrSet 3.GetVarOrSetFunc 4.GetVarOrSetFuncLock 5.SetIfNotExist 6.SetIfNotExistFunc 7.SetIfNotExistFuncLock 8.Contains 9.Remove 10.Removes 11.IsEmpty 12.Size
2021-11-25 07:25:29 +08:00
58a2e5a3b3 Merge branch 'master' of https://github.com/gogf/gf into gtree_Example 2021-11-24 23:23:50 +08:00
2866ee75a1 Implemented BTree Example
1.Clone 2.Set 3.Sets 4.Get 5.GetOrSet 6.GetOrSetFunc 7.GetOrSetFuncLock
2021-11-24 23:23:14 +08:00
f91b5b558a improve package gcmd 2021-11-24 22:45:34 +08:00
0db3a9f0f6 improve package gcmd 2021-11-24 22:27:09 +08:00
8442bab164 improve package gcmd 2021-11-24 22:15:23 +08:00
332de30fba improve package gcmd 2021-11-24 21:57:41 +08:00
c5541b484f improve package gtag/gcmd 2021-11-24 21:41:36 +08:00
7b22355abb expose package internal/structs as os/gstructs; add package gtag for custom tag storage feature 2021-11-24 16:17:50 +08:00
09be476fd9 Implemented BTree Example
1.NewBTree 2.NewBTreeFrom
2021-11-23 23:21:29 +08:00
e2abee7ba4 Merge branch 'master' of https://github.com/gogf/gf 2021-11-23 21:05:44 +08:00
6d62e071e4 fix issue in package goai 2021-11-23 21:05:31 +08:00
af289bcc7e Merge branch 'master' of https://github.com/gogf/gf into gtree_Example 2021-11-23 20:57:30 +08:00
c12404b378 add gtree example new file 2021-11-23 20:53:17 +08:00
8a22b129dd add gtree example new file 2021-11-23 20:52:57 +08:00
28fe100761 Merge pull request #1489 from huangqian1985/master
gmap Example and gvalid Example
2021-11-23 20:40:33 +08:00
0622b517c5 command object feature for package gcmd 2021-11-23 20:26:55 +08:00
d7da2b5657 Merge branch 'master' of https://github.com/gogf/gf 2021-11-23 20:22:00 +08:00
5415d6dc52 Merge branch 'master' into feature/gcmd-manager 2021-11-23 16:24:11 +08:00
1978a262a8 improve ScanList feature for pakcga egdb 2021-11-23 15:28:40 +08:00
9e21052a3c object feature for package gcmd 2021-11-23 14:08:37 +08:00
9748b9f70b improve association feature for package gvalid 2021-11-23 10:42:43 +08:00
a237495b66 modify CheckStruct to Run 2021-11-23 07:44:35 +08:00
00ac9069ee Merge branch 'master' of https://github.com/gogf/gf 2021-11-22 23:26:40 +08:00
7e3d7b3575 modify UnmarshalValue Sample 2021-11-22 23:11:40 +08:00
a96acf6eed improve dump feature for package gutil 2021-11-22 23:05:32 +08:00
bbc43520fb improve package gvalid 2021-11-22 22:47:00 +08:00
cea6e4c3d9 improve package gvalid 2021-11-22 22:43:09 +08:00
7e56bf700a Merge branch 'master' of https://github.com/gogf/gf 2021-11-22 21:10:52 +08:00
2728ab9e42 add "ci" rule Example 2021-11-22 21:04:24 +08:00
3be19e58e1 recursive validation feature for package gvalid 2021-11-22 20:28:47 +08:00
82ea10a59b Merge branch 'master' of https://github.com/gogf/gf 2021-11-22 15:27:38 +08:00
86a1721326 Merge branch 'master' into feature/recursive-validation 2021-11-22 14:45:53 +08:00
eaef2d865e add rule ci for package gvalid 2021-11-22 14:41:33 +08:00
dc1ad3dda4 gcmd manager feature 2021-11-22 11:23:46 +08:00
c94513f4aa add "bail" rule Example 2021-11-22 08:59:21 +08:00
bae18a92b7 Merge branch 'master' of https://github.com/gogf/gf 2021-11-22 00:27:10 +08:00
a3dfebffb4 output modify 2021-11-22 00:26:34 +08:00
f5920fff68 Merge branch 'master' of https://github.com/gogf/gf 2021-11-21 23:04:11 +08:00
e15a862cd2 Merge pull request #1463 from hailaz/master
add examples for package gfile
2021-11-21 22:47:03 +08:00
22b7b2b953 comment updates for package gcmd 2021-11-21 22:38:47 +08:00
dde4b75022 improve command feature for package gcmd 2021-11-21 13:11:28 +08:00
e936b376fb improve command feature for package gcmd 2021-11-21 13:09:45 +08:00
b58c5311d0 Implemented TreeMap Example 2021-11-21 12:44:59 +08:00
dbee5810dc merge master 2021-11-21 00:54:40 +08:00
8ea4b71e7a Implemented ListMap Example 2021-11-20 21:46:20 +08:00
3e5b3a6dad Implemented StrStrMap Example 2021-11-20 12:37:09 +08:00
61bc38fff6 Implemented StrStrMap Example 2021-11-20 12:27:01 +08:00
c047214a33 Merge branch 'master' of https://github.com/gogf/gf 2021-11-20 12:13:12 +08:00
7d75f6e7c5 Implemented StrStrMap Example 2021-11-20 12:13:05 +08:00
a99cc34243 Implemented StrStrMap Example 2021-11-20 12:12:32 +08:00
8db890c510 improve unit testing case for package gcache 2021-11-20 12:08:14 +08:00
1db2c31ecc Implemented StrIntMap Example 2021-11-20 08:47:44 +08:00
49edad0216 Implemented StrAnyMap Example 2021-11-20 08:13:10 +08:00
51fd87bc01 Implemented StrAnyMap Example 2021-11-20 07:49:56 +08:00
42673c383a merge master 2021-11-19 23:14:58 +08:00
9aeac45198 Implemented IntIntMap Example 2021-11-19 21:46:11 +08:00
d9a152b772 Merge branch 'master' of https://github.com/gogf/gf 2021-11-19 20:44:52 +08:00
cd9ea5697b Merge branch 'master' of https://github.com/gogf/gf 2021-11-19 15:23:34 +08:00
551ceef0e1 improve package gconv 2021-11-19 15:21:46 +08:00
b81a1e7c9c Merge pull request #12 from gogf/master
pr from master
2021-11-19 09:56:02 +08:00
0355ec6b21 doc: add code comments 2021-11-19 09:53:32 +08:00
076b15d71f Implemented IntAnyMap Example 2021-11-19 07:27:19 +08:00
d35daa0f72 Merge pull request #1487 from stardemo/master
add ci notice for go fmt
2021-11-18 22:36:36 +08:00
d138c5bff2 improve unit testing case for package gview 2021-11-18 22:33:36 +08:00
66d56396ca improve unit testing case for package gview 2021-11-18 22:16:54 +08:00
0c62c62a7a improve example for package gstr 2021-11-18 22:13:12 +08:00
7d6c9244cf Implemented AnyAnyMap Example Function:
1.Replace 2.LockFunc 3.RLockFunc 4.Flip 5.Merge 6.String 7.MarshalJSON 8.UnmarshalJSON 9.UnmarshalValue
2021-11-18 21:37:27 +08:00
7f33c101c8 Merge branch 'master' of https://github.com/giamyl/gf 2021-11-18 20:11:41 +08:00
07ac8aca41 fix unit testing cases for package gres/gview 2021-11-18 20:07:24 +08:00
de4db409ee improve gutil.Dump 2021-11-18 15:25:24 +08:00
712416f490 improve gutil.Dump 2021-11-18 15:20:37 +08:00
0d8c9d5cfb move "gofmt check pass" echo 2021-11-18 11:56:03 +08:00
9547277931 fix gofmt check cmd 2021-11-18 11:32:03 +08:00
02849956e8 add ci gofmt check notice 2021-11-18 11:23:51 +08:00
dcf5975334 Merge branch 'gogf-master' 2021-11-18 09:54:35 +08:00
747ed6c64d Merge branch 'master' of https://github.com/gogf/gf into gogf-master 2021-11-18 09:52:27 +08:00
e586e4d109 更新示例文件 2021-11-18 08:59:51 +08:00
be2a0f4a18 Delete gstr_z_all_example_test.go 2021-11-18 08:58:48 +08:00
a184d16f06 更新示例 2021-11-18 08:58:21 +08:00
f6facc7507 修改示例 2021-11-18 08:54:44 +08:00
7d7ceec1d6 Merge branch 'gogf:master' into master 2021-11-18 08:54:13 +08:00
3f4dff462d Merge branch 'master' of https://github.com/gogf/gf 2021-11-18 07:33:29 +08:00
36927b4371 Implemented AnyAnyMap Example Function:
1.Remove 2.Removes 3.Keys 4.Values 5.Contains 6.Size 7.IsEmpty 8.Clear
2021-11-18 07:32:29 +08:00
290200a490 修改示例表现形式 2021-11-18 06:26:27 +08:00
57ccc13e0c unit testing files renaming 2021-11-17 23:20:58 +08:00
ef29ee4804 Implemented AnyAnyMap Example Function:
1.Iterator 2.Clone 3.Map 4.MapCopy 5.MapStrAny 6.FilterEmpty 7.FilterNil 8.Set 9.Sets 10.Search 11.Get 12.Pop 13.Pops 14.GetOrSet 15.GetOrSetFunc 16.GetOrSetFuncLock 17.GetVar 18.GetVarOrSet 19.GetVarOrSetFunc 20.GetVarOrSetFuncLock
2021-11-17 23:18:35 +08:00
732664a1ff files renaming for package gdb 2021-11-17 22:01:17 +08:00
f2ef7454c2 improve prefix feature for package gdb 2021-11-17 21:29:46 +08:00
e4023cadce doc: add code comments 2021-11-17 19:50:03 +08:00
92b9af5d9e Merge branch 'master' of https://github.com/gogf/gf 2021-11-17 19:32:06 +08:00
51cc9c541f doc: add copyright 2021-11-17 14:14:19 +08:00
6ad7baeb2c remove gsmtp 2021-11-16 23:39:45 +08:00
266a4214c5 fix example for package gregex 2021-11-16 21:40:04 +08:00
67a479a2cd remove .example 2021-11-16 21:37:59 +08:00
459aaea6e1 .golangci.yml updates 2021-11-16 21:25:14 +08:00
9b93542e99 Merge pull request #1483 from houseme/master
improve code 'if block ends with a return statement, so drop this els…
2021-11-16 21:02:56 +08:00
0b9931a3a4 improve Dump feature for package gutil 2021-11-16 20:41:31 +08:00
bb4f72d1ec improve code Introduce according to grouping 2021-11-16 19:43:02 +08:00
e86ee052cb improve code import 2021-11-16 19:29:02 +08:00
c6efb5ee3b [feature] improve code range map 2021-11-16 17:21:13 +08:00
efcba5ecae Merge branch 'master' of https://github.com/gogf/gf 2021-11-16 07:36:23 +08:00
416a5173ae 1# Complete the AnyAnyMap Example Function (Not Implemented)
2# Implemented AnyAnyMap Example Function:
1.NewAnyAnyMap 2.NewAnyAnyMapFrom
2021-11-16 07:30:14 +08:00
cc9b3a08d0 splite gmap example file. 2021-11-16 07:20:18 +08:00
857ca4d978 URL encode and decode 2021-11-16 00:59:15 +08:00
0135d23b16 URL-encode according to RFC 3986 2021-11-16 00:56:38 +08:00
babb84a798 Merge branch 'gogf:master' into master 2021-11-16 00:45:34 +08:00
e92aaa0891 Merge branch 'master' of https://github.com/gogf/gf 2021-11-16 00:42:44 +08:00
939a9267c6 improve slice converting for package gconv 2021-11-16 00:41:47 +08:00
ff8633231f improve code 'if block ends with a return statement, so drop this else and outdent its block (golint)' 2021-11-16 00:26:10 +08:00
4e1bbd76f9 Merge branch 'master' of https://github.com/gogf/gf 2021-11-15 23:34:43 +08:00
570814cf6e gmap example function
1.NewFrom 2.NewHashMap 3.NewHashMapFrom
2021-11-15 23:34:25 +08:00
47a4c6b58c Merge pull request #1481 from houseme/master
improve code
2021-11-15 22:36:31 +08:00
4fa2a879d7 [feature] improve code gview 2021-11-15 20:49:02 +08:00
cd60a4aca7 [feature] improve code glog 2021-11-15 20:31:16 +08:00
b664982be3 [feature] improve code gfile gcfg 2021-11-15 20:26:31 +08:00
485785e023 improve example for package gqueue 2021-11-15 19:20:46 +08:00
5389a93ec8 Merge branch 'master' of https://github.com/gogf/gf 2021-11-15 19:16:40 +08:00
634cacd435 merge develop 2021-11-15 19:15:58 +08:00
61bf7a28d2 Merge pull request #1480 from huangqian1985/master
gring Example
2021-11-15 19:12:22 +08:00
e172c486c3 Merge pull request #1478 from houseme/master
Upgrade opentelemetry version to 1.2.0. Improved import, by group improt
2021-11-15 19:11:41 +08:00
da7ddd43f5 improve field filtering for list type parameters of function Data for ForDao models 2021-11-15 17:39:23 +08:00
98e5fb1542 improve field filtering for list type parameters of function Data for ForDao models 2021-11-15 17:27:35 +08:00
f99b037c60 improve field filtering for list type parameters of function Data for ForDao models 2021-11-15 17:06:04 +08:00
5a1209c82d developing recursive validation 2021-11-15 16:50:30 +08:00
8ddab7f0cc Merge branch 'gogf:master' into master 2021-11-14 22:50:53 +08:00
6cd8d008eb Modifying LockIteratorPrev to RLockIteratorPrev and its implementation 2021-11-14 21:35:00 +08:00
f4f1145424 gring example function
1.Set 2.Put 3.Move 4.Prev 5.Next 6.Link 7.Unlink 8.RLockIteratorNext 9.RLockIteratorPrev 10.SliceNext 11.SlicePrev
2021-11-14 21:33:23 +08:00
d7c121430e Merge branch 'master' of https://github.com/gogf/gf 2021-11-14 21:17:30 +08:00
e23704d694 improve package gvalid by adding extra internal variable for error message template, changing :xxx varibale name to {xxx} format 2021-11-14 21:00:34 +08:00
e4ddeb6033 Improved import, by group improt. 2021-11-14 18:24:38 +08:00
4cdd98dbf5 Merge branch 'master' of https://github.com/gogf/gf 2021-11-14 17:47:34 +08:00
ce16dad88f improve error handling for custom validation rule for package gvalid 2021-11-14 17:47:21 +08:00
b59ed1b943 Improved import, by group improt. 2021-11-14 15:37:24 +08:00
ea31af5364 Merge branch 'gogf:master' into master 2021-11-14 15:33:18 +08:00
ac2a95534e Merge pull request #1474 from ehproject-teamer/master
add gtime example test
2021-11-14 12:29:51 +08:00
1a7450b9e9 v2.0.0-beta 2021-11-14 11:36:59 +08:00
5ef8280c31 fix: gfile scan dir example 2021-11-14 00:08:31 +08:00
15deeb19b0 go fmt 2021-11-13 23:48:47 +08:00
d13bbb7a04 merge conflict 2021-11-13 23:46:18 +08:00
f2dc26a7b3 Improved gfile example 2021-11-13 23:42:03 +08:00
299e16bed1 Improved import, by group improt. 2021-11-13 23:34:16 +08:00
d864120353 Improved import, by group improt. 2021-11-13 23:30:31 +08:00
be03b3cdda Improved import, by group improt. 2021-11-13 23:23:55 +08:00
cfa3d817af update gtime example 2021-11-13 23:16:18 +08:00
2c716a88c4 gring example function
1.New 2.Cap 3.Len
2021-11-12 22:52:41 +08:00
89d2a896f1 Update gtime_z_example_basic_test.go 2021-11-12 12:16:08 +08:00
56648638aa Merge branch 'gogf:master' into master 2021-11-12 11:14:03 +08:00
741a790660 修改了示例的表现格式 2021-11-12 01:37:27 +08:00
684fa9b9c9 Merge pull request #1467 from 564104865/zhiwei
update cache
2021-11-11 23:53:45 +08:00
4e91039254 Update gcache_z_example_cache_test.go 2021-11-11 23:37:01 +08:00
195e167502 Update gcache_z_example_cache_test.go 2021-11-11 23:29:29 +08:00
01a50b06cb Update gcache_z_example_cache_test.go 2021-11-11 22:32:08 +08:00
9b663b4c2b Update gcache_z_example_cache_test.go 2021-11-11 22:18:01 +08:00
655426c322 Update gcache_z_example_cache_test.go 2021-11-11 21:19:33 +08:00
ae819ad44b Merge branch 'master' of https://github.com/ehproject-teamer/gf 2021-11-11 17:51:33 +08:00
50ad3f0f26 go fmt 2021-11-11 17:49:43 +08:00
413a8be037 Merge branch 'gogf:master' into master 2021-11-11 17:45:49 +08:00
da659817c5 complete gtime example 2021-11-11 17:41:31 +08:00
6d37515e14 Optimization gfile example 2021-11-11 13:01:32 +08:00
ae27afaeb4 Merge branch 'zhiwei' of https://github.com/564104865/gf into zhiwei 2021-11-10 16:46:20 +08:00
30f462288e Update gcache_z_example_cache_test.go 2021-11-10 16:39:26 +08:00
4862505c5e Merge branch 'gogf:master' into zhiwei 2021-11-10 16:37:56 +08:00
4b0a8f81d5 修改了ExampleEqual 示例的对比值 2021-11-10 01:47:03 +08:00
f889df8d50 go fmt 格式化 2021-11-10 01:27:59 +08:00
836be74d13 修改示例中结果为map输出的地方增加May 2021-11-10 01:12:22 +08:00
7f24f0637b 修改了部分示例 2021-11-10 01:03:04 +08:00
31d793fafb improve example for package gqueue 2021-11-10 00:20:00 +08:00
be274478d0 Merge branch 'zhiwei' of https://github.com/564104865/gf into zhiwei 2021-11-09 20:47:28 +08:00
5b8c91a877 Merge branch 'gogf:master' into zhiwei 2021-11-09 20:46:12 +08:00
95a4690e69 improve error feature for package gvalid 2021-11-09 17:50:14 +08:00
33694c8b47 fix: ExampleGetContentsWithCache intlog 2021-11-09 16:34:00 +08:00
14b7c591d0 fix "github.com/gogf/gf/v2/test/gtest" 2021-11-09 16:25:44 +08:00
72043d0657 Merge branch 'gogf:master' into processconflict 2021-11-09 16:11:07 +08:00
e0a0fcbde2 improve cache feature for package gdb 2021-11-09 16:06:31 +08:00
58dd8a29db fix: gflie size example dir default size 4k 2021-11-09 16:04:47 +08:00
1f83c00ebf fix: gfile size example fail 2021-11-09 15:49:00 +08:00
02e1d01f29 improve RuleFunc for package gvalid 2021-11-09 15:22:17 +08:00
e0db3c87cf improve RuleFunc for package gvalid 2021-11-09 14:31:16 +08:00
903299728f update Must Cache 2021-11-09 11:46:53 +08:00
c617ad6a04 Merge branch 'gogf:master' into zhiwei 2021-11-09 11:38:05 +08:00
814649e7a3 Merge branch 'master' of https://github.com/gogf/gf 2021-11-08 19:51:45 +08:00
d1b69142c4 improve unit testing case for package gcache 2021-11-08 19:51:32 +08:00
2d1593f78e Merge branch 'zhiwei' of https://github.com/564104865/gf into zhiwei 2021-11-08 12:12:15 +08:00
d61f7af60c update cache adapter 2021-11-08 12:12:10 +08:00
65140d1293 Merge branch 'gogf:master' into zhiwei 2021-11-08 12:11:19 +08:00
85299cd447 Merge pull request #1466 from mingzaily/master
add examples for container gqueue
2021-11-07 21:53:24 +08:00
091df972f1 improve example for package gcache 2021-11-07 21:52:27 +08:00
748040fb0b improve group router for package ghttp 2021-11-07 21:31:33 +08:00
df02ca764f add size example for gqueue 2021-11-07 16:52:28 +08:00
6f64c26349 Merge branch 'gogf:master' into master 2021-11-07 16:40:20 +08:00
072355dc2c Merge branch 'zhiwei' of https://github.com/564104865/gf into zhiwei 2021-11-07 16:05:17 +08:00
3ca2cad449 improve gutil.Dump 2021-11-07 00:32:16 +08:00
05bb81cd71 Merge branch 'master' of https://github.com/gogf/gf 2021-11-07 00:16:52 +08:00
fd9246358a Merge branch 'feature/gconv.ScanList' into develop 2021-11-07 00:16:26 +08:00
42c4b32720 add gconv.ScanList 2021-11-07 00:16:14 +08:00
2757647211 Revert "11"
This reverts commit 45787dd8e4.
2021-11-06 20:31:47 +08:00
45787dd8e4 11 2021-11-06 20:31:16 +08:00
38b797b42f finish example for gqueue 2021-11-06 16:27:17 +08:00
e8f6ebc154 Merge branch 'gogf:master' into master 2021-11-06 16:12:38 +08:00
e715ce0625 Merge pull request #1450 from DGuang21/feature-regex-example
add examples for package gregex
2021-11-06 11:35:15 +08:00
aceb586bef Merge pull request #1461 from Evil-king/master
add examples for InitSet of package gset
2021-11-06 11:34:17 +08:00
15f9b69b36 fix 2021-11-06 06:38:28 +08:00
0aabb7d990 update package gstr 2021-11-06 04:41:08 +08:00
b036767fc0 📝 add example 2021-11-06 01:47:00 +08:00
b967cf6224 📝 add example 2021-11-06 01:16:51 +08:00
1a596fe84d 📝 add example 2021-11-06 00:54:10 +08:00
64fa8d5282 📝 add example 2021-11-06 00:49:15 +08:00
99d2186c8c 📝 add example 2021-11-06 00:06:56 +08:00
24f759e00e 📝 add example 2021-11-05 23:56:08 +08:00
66731c9c66 Merge pull request #1459 from visualsun/master
Create garray_z_example_sorted_str_test.go
2021-11-05 23:27:56 +08:00
e5ec9cd676 Merge pull request #1452 from 564104865/zhiwei
gcache Examples
2021-11-05 23:24:20 +08:00
e7b63839c8 Update garray_z_example_sorted_str_test.go 2021-11-05 19:31:11 +08:00
2511c378f2 Create garray_z_example_int_test.go 2021-11-05 17:02:28 +08:00
3de37873dc Merge pull request #10 from gogf/master
pr from master
2021-11-05 15:02:25 +08:00
12514a0311 Update garray_z_example_sorted_str_test.go 2021-11-05 14:45:04 +08:00
8a9dd169e2 test: add gflie example 2021-11-05 14:30:50 +08:00
84046a060a Package gstr's All Example 2021-11-05 10:50:15 +08:00
a27eec7752 Delete gstr_z_example_test.go 2021-11-05 10:48:13 +08:00
4539a9a4ab 修改gstr测试用例包名为gstr_test 2021-11-05 10:42:44 +08:00
cffa098373 更新gstr为gf-v2版本 2021-11-05 10:35:01 +08:00
c663a0d9c5 修改gstr测试用例
修改gstr测试用例的错误
2021-11-05 10:20:36 +08:00
5b83b2375e Update gcache_z_example_cache_test.go 2021-11-05 09:41:49 +08:00
98d72fae25 Merge branch 'gogf:master' into zhiwei 2021-11-05 09:38:41 +08:00
041ebacb8c 添加gstr包的实例 2021-11-05 01:20:18 +08:00
4f2a22dd0e Merge branch 'master' of https://github.com/gogf/gf 2021-11-05 01:15:30 +08:00
4acc0e9876 gconv.ScanList 2021-11-05 01:15:11 +08:00
7be24776d5 Merge branch 'develop' of https://github.com/gogf/gf into develop 2021-11-05 01:07:19 +08:00
485706a676 improve ScanList feature for package gdb 2021-11-05 01:07:06 +08:00
ea7d963f20 IntSet 2021-11-05 00:56:59 +08:00
613958a4b6 IntSet finish 2021-11-05 00:50:44 +08:00
44023ea91d Merge pull request #1453 from Evil-king/master
gstrset Example Finish
2021-11-05 00:21:15 +08:00
ef7f7e35f8 update review 2021-11-05 00:04:24 +08:00
613a50428b Update gcache_z_example_cache_test.go 2021-11-04 23:23:40 +08:00
3091f61a26 update ExampleStrSet_Remove 2021-11-04 22:26:17 +08:00
5776b2596d Create garray_z_example_sorted_str_test.go 2021-11-04 22:17:32 +08:00
430102c995 update 2021-11-04 22:11:09 +08:00
2a2bb4f1e1 improve the example document 2021-11-04 21:39:28 +08:00
205243e8b9 update 2021-11-04 21:02:54 +08:00
d16ce643fd Merge branch 'zhiwei' of https://github.com/564104865/gf into zhiwei 2021-11-04 20:58:19 +08:00
e94eb8f668 Merge branch 'gogf:master' into zhiwei 2021-11-04 20:56:02 +08:00
357084e788 update cache 2021-11-04 20:55:01 +08:00
9a757acc88 Merge pull request #1438 from danvinhe/bugfix/i1435
Bugfix/i1435
2021-11-04 20:38:58 +08:00
3fb1c07eac Merge pull request #1454 from visualsun/master
Update garray_z_example_str_test.go
2021-11-04 20:29:33 +08:00
6050b14087 Update garray_z_example_str_test.go 2021-11-04 20:11:54 +08:00
58c1c1bb16 Merge pull request #1455 from huangqian1985/develop
Validator Rule Example
2021-11-04 19:33:06 +08:00
b6f6ab17f9 go fmt 2021-11-03 23:50:57 +08:00
7bcba437a0 update cache values 2021-11-03 23:44:16 +08:00
abf199bf61 Merge branch 'gogf:master' into zhiwei 2021-11-03 23:29:31 +08:00
9ea2db5c81 fix 2021-11-03 23:17:04 +08:00
7a6fb4a807 Merge branch 'master' of https://github.com/gogf/gf 2021-11-03 23:14:08 +08:00
c3a75f5568 logging content update for package gdb 2021-11-03 23:13:11 +08:00
c850c420fd fixCi 2021-11-03 23:06:24 +08:00
e045aaaf07 Merge branch 'master' of https://github.com/gogf/gf into develop 2021-11-03 23:05:23 +08:00
0cd40caf0c Merge branch 'gogf:master' into master 2021-11-03 22:57:44 +08:00
f2bb9d65c3 edit review 2021-11-03 22:49:30 +08:00
4e05795642 Modify variable name 2021-11-03 22:38:31 +08:00
1df52637e8 Merge pull request #1429 from osgochina/master 2021-11-03 22:38:21 +08:00
b83362cc2e Update garray_z_example_str_test.go 2021-11-03 22:34:43 +08:00
274052511c Complete the following verification rule example method
1.mac 2.url 3.domain 4.size 5.length 6.min-length 7.max-length 8.between 9.min 10.max 11.json 12.integer 13.float 14.boolean 15.regex
2021-11-03 22:20:05 +08:00
32bc1ec064 Merge pull request #1432 from danvinhe/hotfix/i1421
Hotfix/i1421
2021-11-03 22:08:30 +08:00
5fa62e02c6 Update garray_z_example_str_test.go 2021-11-03 18:08:44 +08:00
bf3c3367a6 Update garray_z_example_str_test.go 2021-11-03 17:14:49 +08:00
9c05682605 change some example for gqueue 2021-11-03 16:16:03 +08:00
8f090739d9 go fmt 2021-11-03 15:23:51 +08:00
7971177c58 newredis 2021-11-03 15:16:07 +08:00
5707763758 Merge branch 'gogf:master' into zhiwei 2021-11-03 15:07:32 +08:00
35a786d765 Update gdb_func.go 2021-11-03 15:05:25 +08:00
12fe41e34d Merge branch 'master' into bugfix/i1435 2021-11-03 15:04:22 +08:00
5ffd362b6e Update glog_logger.go
多了个空格
2021-11-03 15:02:21 +08:00
a423fba2a8 comment or be unexported
exported method Redis.UpdateExpire should have comment or be unexported
2021-11-03 14:59:28 +08:00
41d0832fa5 Merge branch 'master' into hotfix/i1421 2021-11-03 14:55:02 +08:00
5e7b0c9303 Merge branch 'master' of https://github.com/gogf/gf 2021-11-03 13:27:49 +08:00
0c43e7986f improve function gutil.Dump/DumpWithType 2021-11-03 13:27:37 +08:00
bc1d76a796 add example for gqueue 2021-11-03 11:41:34 +08:00
6b9f72d973 📝 add example 2021-11-03 11:28:54 +08:00
d980cff663 📝 add example 2021-11-03 11:22:17 +08:00
7de69db707 232234 2021-11-03 10:16:41 +08:00
5e34aee2d7 example over 2021-11-03 00:49:06 +08:00
797719d8d5 Complete the following verification rule example method
1. passport 2.password 3.password2 4.password3 5.postcode 6.resident-id 7.bank-card 8.qq 9.ip 10.ipv4 11.ipv6
2021-11-02 23:47:25 +08:00
6c3aa6ede5 📝 add example 2021-11-02 20:08:15 +08:00
18459ec1bc Merge pull request #1449 from mingzaily/master
Example for glist
2021-11-02 19:37:47 +08:00
e727788f42 Merge branch 'gogf:master' into master 2021-11-02 14:33:13 +08:00
3df7711e74 complete example for glist 2021-11-02 14:31:34 +08:00
c1f856fa8e update 2021-11-02 13:27:54 +08:00
8ffc7699d6 Merge pull request #9 from gogf/master
pr from master
2021-11-02 11:25:49 +08:00
a3eff53c69 Modify "date" rule Example 2021-11-02 11:22:34 +08:00
56c12ad7c3 fix unit testing case for pakage gfile 2021-11-02 09:56:53 +08:00
77a0f59cd3 add automatic adding OmitNil option for data and where filtering if given struct name is defined like 'xxxForDao' 2021-11-02 09:55:37 +08:00
94768530cc Complete the following verification rule example method
1. datetime 2.date-format 3.email 4.phone 5.phone-loose 6.telephone
2021-11-02 00:03:44 +08:00
79a233eb78 example&comment update 2021-11-01 19:46:39 +08:00
183d800f4c 📝 add example 2021-11-01 12:17:53 +08:00
191ad20436 Complete the following verification rule example method
1. date
2021-10-31 23:16:54 +08:00
c0c68d1e46 rename Println -> Print for package glog 2021-10-30 20:47:38 +08:00
ac6968edf1 improve Dump feature 2021-10-30 20:35:55 +08:00
e22e1d0e4a remove function Println from package glog 2021-10-30 19:44:22 +08:00
42e27dd14c add context parameter for package grpool 2021-10-30 18:09:58 +08:00
d817047c98 remove Logger interface from package gdb 2021-10-30 16:12:51 +08:00
e15cd6ae89 fix issue in package gcache 2021-10-30 16:00:38 +08:00
17e6063c5c add neccessary parameter context for package gcron/gtimer 2021-10-30 15:36:10 +08:00
a8b2a2ff33 Merge remote-tracking branch 'origin/develop' into develop 2021-10-29 22:46:00 +08:00
4b3eb09492 Complete the following verification rule example method
1. required 2.required-if 3.required-unless 4.required-with 5.required-with-all 6.required-without 7.required-without-all 8.same 9.different 10.in 11.not-in
2021-10-29 22:44:35 +08:00
d1c09cb21d 完成以下校验规则示例方法
1. required 2.required-if 3.required-unless 4.required-with 5.required-with-all 6.required-without 7.required-without-all 8.same 9.different 10.in 11.not-in
2021-10-29 22:37:38 +08:00
1188793f8f automatically add column prefix for where conditions 2021-10-29 16:57:56 +08:00
09b8df1818 add WherePrefix/WhereOrPrefix for gdb.Model 2021-10-29 15:49:08 +08:00
6192d32501 add LeftJoinOnField/InnerJoinOnField/InnerJoinOnField/FieldsPrefix/FieldsExPrefix for package gdb 2021-10-29 15:12:31 +08:00
a6a8d787e4 merge IgnoreEmptySliceWhere feature into OmitEmptyWhere 2021-10-29 10:50:14 +08:00
e5c6d3f777 fix issue in unit testing cases for package gjson 2021-10-28 23:46:24 +08:00
1bfa792ea9 fix context canceled error while propagate context from http.Request 2021-10-28 23:37:51 +08:00
8ef4f68215 add IgnoreEmptySliceWhere feature for package gdb; add OriginValueAndKind/OriginTypeAndKind functions for package internal/utils 2021-10-28 23:18:23 +08:00
493f5dcff2 remove unused functions for package gdb 2021-10-27 15:41:15 +08:00
2cf84e020f add automatically detectting feature for 'in' attribute of parameters for package goai;add 'datetime' rule for package gvalid 2021-10-27 15:33:29 +08:00
e21bd9b4cb Update gcron_schedule.go 2021-10-27 10:44:28 +08:00
ded94276a8 Merge branch 'master' into processconflict 2021-10-27 10:33:36 +08:00
a19ba3d530 add embedded struct fields overwrite feature for package internal/structs 2021-10-26 21:57:56 +08:00
e0674ee7fe improve openapi implements 2021-10-25 21:23:47 +08:00
2481435829 improve openapi implements 2021-10-25 21:06:24 +08:00
e48b565e18 improve openapi implements 2021-10-25 20:36:09 +08:00
f6c2206b88 improve logging content field name from selected/updated to rows 2021-10-25 19:50:52 +08:00
4717e01708 replace gopkg.in/yaml.v2 with gopkg.in/yaml.v3 2021-10-25 19:17:56 +08:00
17861fc45d add short tags for default for package goai 2021-10-25 14:25:35 +08:00
a92c31168a add short tags for summary/description for package goai 2021-10-25 10:50:01 +08:00
940dcfb8c4 v2.0.0-alpha 2021-10-22 17:54:53 +08:00
8dd9483572 fix issue in unit testing case for package gview 2021-10-22 14:09:08 +08:00
4e7b33bde3 fix issue in unit testing case for package gview 2021-10-22 13:14:48 +08:00
977780736f improve gutil.Dump 2021-10-21 22:07:43 +08:00
aacfa1bd96 add short typed tag mapping for summary/description for package goai;add suffix checks for request/response struct naming 2021-10-21 20:17:02 +08:00
862ef57e0f fix unit testing cases 2021-10-21 19:25:39 +08:00
fa5499373a replace char <xxx> to ;add GetWithEnv/GetWithCmd fuctions for package gcfg 2021-10-21 18:22:47 +08:00
f901f19714 Parameters of type gdb.Raw do not require special treatment 2021-10-15 17:45:30 +08:00
6bde7c61b4 openapi 2021-10-14 15:03:39 +08:00
085c887b33 openapi 2021-10-13 22:34:52 +08:00
920c97af79 openapi 2021-10-13 22:28:49 +08:00
f887c9f44b improve package gmeta 2021-10-12 17:52:31 +08:00
18ceebeffd filter key updates for stack information 2021-10-12 17:25:45 +08:00
854747574d fix issue in package gcfg 2021-10-12 16:15:52 +08:00
7eb3b32b26 fix unit testing cases 2021-10-11 21:53:16 +08:00
54dd11f511 README update 2021-10-11 21:43:27 +08:00
1bc0635f8b version 2 2021-10-11 21:41:56 +08:00
bea54b445e add context for validation functions of package gvalid 2021-10-11 21:34:19 +08:00
bc735fee51 openapi 2021-10-11 20:39:13 +08:00
82175b5de9 rename gctx.Value/WithValue to CtxId/WithCtxId 2021-10-11 20:25:02 +08:00
cefa3638cf openapi 2021-10-11 19:59:15 +08:00
cbfd92a21d add common request structure feature support for openapi 2021-10-11 17:10:55 +08:00
310e178206 add common response structure feature support for openapi 2021-10-11 16:55:38 +08:00
e0c4f7ccbf Fixed: #1421 2021-10-09 18:32:59 +08:00
17904bccd0 openapi 2021-10-08 21:23:30 +08:00
5b2f40a454 openapi 2021-10-08 21:16:47 +08:00
b1113c328a openapi 2021-10-08 17:05:11 +08:00
26d823bd81 openapi 2021-10-08 16:32:40 +08:00
5a5809bd95 修复gini的bug。
当ini的配置值中含有"="时候,不能正确解析。
2021-10-08 16:17:58 +08:00
c225a15746 openapi 2021-10-08 16:02:53 +08:00
edd62f3b4f openapi 2021-10-08 15:37:17 +08:00
73e4a69383 openapi 2021-10-08 14:44:10 +08:00
5e32e8868e openapi 2021-10-08 11:42:28 +08:00
d430f2f52e openapi 2021-10-08 11:40:47 +08:00
51dbd133a4 openapi generating feature 2021-10-06 21:51:21 +08:00
4eb48660df openapi generating feature 2021-10-06 21:11:16 +08:00
d66d8585a2 openapi generating feature 2021-10-06 20:44:34 +08:00
89661301b0 fix issue for unit testing case for package ghttp 2021-10-06 20:16:18 +08:00
5d804987b9 add alias g.Meta for gmeta.Meta 2021-10-06 20:11:54 +08:00
892d3abf38 openapi generating feature 2021-10-06 19:52:19 +08:00
4a1a8c9fc5 openapi generating feature 2021-10-06 15:24:01 +08:00
18ede3ae1f improve error information for package goai 2021-10-06 15:03:00 +08:00
9ed79e9e86 openapi generating for ghttp.Server 2021-10-06 14:52:29 +08:00
5a7555a6ec fix issue in goai for recursive attribute 2021-10-06 14:45:29 +08:00
82d04d612b fix openapi specification generating; improve handler type 2021-10-06 14:22:58 +08:00
9f2eeb23ba print error stack in faltal error for ghttp.Server 2021-10-06 12:12:59 +08:00
c84e79a46d improve swagger ui feature for package ghttp 2021-10-06 11:54:53 +08:00
337c2d0953 filter issue in internal/structs 2021-10-06 11:10:35 +08:00
71189c8fb0 improve converting performance for equal type converting 2021-10-03 00:58:57 +08:00
322f5933ad add build-in swagger ui support for ghttp.Server 2021-10-03 00:22:06 +08:00
1e80dc71eb add automatic generating for OpenApi specification for ghttp.Server routes 2021-10-02 22:34:39 +08:00
198a6c8e33 add package goai for OpenAPIv3 support 2021-10-02 18:54:06 +08:00
0fdb935c3d add package goai for OpenAPIv3 support 2021-10-02 15:07:47 +08:00
dcafba8a2d add package goai for OpenAPIv3 support 2021-10-02 14:52:28 +08:00
131214151c add context for Client of package ghttp 2021-09-30 14:06:46 +08:00
dd4e08e88d refract package gdb; add selected & affected count to logging 2021-09-29 20:39:02 +08:00
b7b4067973 fix issue in unit testing case of package internal/structs 2021-09-29 19:18:27 +08:00
02478371f2 fix issue missing org tag value retrieving when using struct in Fields for package gdb 2021-09-28 22:02:08 +08:00
750972e7c6 fix unit testing cases 2021-09-28 19:04:36 +08:00
a9d7dc68a3 remove usage of package gparser 2021-09-27 23:05:46 +08:00
0a828aaed3 Merge branch 'v2_release' into develop 2021-09-27 22:52:28 +08:00
f2bab9777d comment update for package gvalid 2021-09-27 22:52:14 +08:00
993bf897cf remove deprecated functions; refract package gjson 2021-09-27 22:47:39 +08:00
df09d8c604 refract package ghttp/gredis/glog 2021-09-27 21:27:24 +08:00
5904a1e7c0 refract package gredis 2021-09-26 23:22:32 +08:00
b826ed6b03 Merge branch 'gogf:master' into master 2021-09-24 10:25:38 +08:00
6eee72b336 refract package gredis 2021-09-23 21:23:22 +08:00
a2c5c577db fix issue #1412 2021-09-23 19:29:20 +08:00
6fa0ad5793 gredis refract 2021-09-23 19:12:02 +08:00
2891c8e29d Merge branch 'gogf:master' into master 2021-09-23 19:05:53 +08:00
c3b3258194 update dependencies clbanning/mxj,grokify/html-strip-tags-go,gopkg.in/yaml to stable version 2021-09-22 19:43:52 +08:00
ef0aeb363b comment update for paxkage gcache; improve package gbuild 2021-09-22 19:29:08 +08:00
c843661dfd Merge branch 'develop' of https://github.com/gogf/gf into develop 2021-09-22 19:12:44 +08:00
b2629b9bfa comment update for package gtrace 2021-09-22 19:12:31 +08:00
ad2b3e6cc6 Merge branch 'master' of https://github.com/houseme/gf into develop 2021-09-22 19:04:22 +08:00
cbe704333a [feature] upgrade opentelemetry version v1.0.0 map to string 2021-09-22 14:54:42 +08:00
45b45517c8 [feature] upgrade opentelemetry version v1.0.0 2021-09-21 23:53:03 +08:00
9d67cb4f34 [feature] upgrade opentelemetry version v1.0.0 2021-09-21 15:15:37 +08:00
fe2eccfda4 remove usage of package unsafe for package gtype/grand 2021-09-20 12:58:10 +08:00
81e54be0c1 readme update 2021-09-20 12:29:05 +08:00
2e49c33cc7 remove depecated functions from package ghttp 2021-09-19 23:13:53 +08:00
e01e8dd4a2 github ci action updates 2021-09-19 10:50:31 +08:00
a1297b0402 github ci action updates 2021-09-19 10:36:43 +08:00
53db88c630 comment update for package gsession 2021-09-19 10:18:58 +08:00
c99c13acd1 refract pacakge gcfg, adding adapter interface for pacakge gcfg 2021-09-19 10:01:09 +08:00
01a3dd1eb0 add function gerror.HasStack; rename all api* interfaces to i* 2021-09-17 19:26:56 +08:00
5383672d78 change returned parameter from interface{} to *gvar.Var for gsession.Sessio.Get; remove Get* function excluding Get for gsession.Session 2021-09-17 11:15:00 +08:00
28f70d52ee add context parameter for all functions of package gcache 2021-09-17 10:48:08 +08:00
cfc1f8fbe4 use english doc 2021-09-17 09:27:31 +08:00
1455e30350 change returned value by Get* and Update/Remove functions from type interface{} to *gvar.Var for package gcache 2021-09-16 22:13:00 +08:00
b46e9bb68a improve package gcache 2021-09-16 21:17:03 +08:00
55a9c0738b improve package gcache, add GetVar*/RemoveVar/UpdateVar functions for package gcache 2021-09-16 20:57:59 +08:00
a72493f320 Merge branch 'master' into processconflict 2021-09-16 11:32:54 +08:00
0d9d7b8e04 Merge branch 'gogf:master' into master 2021-09-16 11:31:38 +08:00
101db282c2 fix issue #1401 2021-09-15 22:28:26 +08:00
ac78b2fa50 fix ci issue 2021-09-15 21:46:58 +08:00
e877eab033 fix ci issue 2021-09-15 21:21:29 +08:00
68e760d13a fix issue @1380 2021-09-15 21:17:45 +08:00
c323256812 Merge branch 'master' into processconflict 2021-09-15 18:54:46 +08:00
26584cdbb4 Merge branch 'gogf:master' into master 2021-09-15 18:52:59 +08:00
64a5cedcdf fix recover logic 2021-09-14 20:47:06 +08:00
40fedea408 Merge branch 'master' of https://github.com/gogf/gf 2021-09-14 20:25:33 +08:00
ffedfb7c0c improve package gproc for customize environment variables when creating process 2021-09-14 20:25:23 +08:00
cc08ceb797 improve package gring; remove function LockIteratorNext/LockIteratorPrev from package gring 2021-09-14 20:15:21 +08:00
053e4f2fc8 Merge pull request #1395 from houseme/master
[feature] upgrade opentelemetry v1.0.0-RC3
2021-09-14 20:15:01 +08:00
727f58a24b remove usage of gconv.Unsafe* functions internally to avoid unexpected errors 2021-09-14 19:30:20 +08:00
99b6085235 Merge branch 'master' of https://github.com/gogf/gf 2021-09-13 16:43:20 +08:00
006fb79967 improve package gjson; replace fmt.Errorf to gerror; improve examples for package gdb 2021-09-13 16:43:09 +08:00
5820e6ebe1 Merge branch 'gogf:master' into master 2021-09-13 15:11:01 +08:00
0776c35ddb upgrade toml version 0.4.1 2021-09-08 05:43:04 +08:00
471a37ef00 upgrade toml version 0.4.1 2021-09-08 05:41:44 +08:00
1242733735 [feature] upgrade opentelemetry v1.0.0-RC3 2021-09-04 14:27:38 +08:00
a6c9a7a944 fix test 2021-09-03 19:35:19 +08:00
e782facdf3 Merge branch 'gogf:master' into master 2021-09-03 14:39:58 +08:00
077a41911b Merge pull request #1390 from houseme/master
fix #1389
2021-09-03 10:54:03 +08:00
cc60bc9dab fix issue printing to stdout using fmt.Fprintf for package glog 2021-09-01 16:14:17 +08:00
425ca8aa3e improve process comminucation folder creating for package gproc 2021-09-01 15:02:58 +08:00
73d2b7ed06 fix issue #1387 2021-08-30 22:26:02 +08:00
0048e2c8c4 improve package gstr 2021-08-30 14:29:04 +08:00
adee4ac8dd fix #1389 2021-08-29 12:23:22 +08:00
549adf6487 improve unit testing case for package gdb 2021-08-27 20:35:35 +08:00
b5502c5580 revert and use 2021-08-27 20:26:07 +08:00
46bf669cdd Merge branch 'master' of https://github.com/gogf/gf 2021-08-27 20:16:41 +08:00
fa7a3e987d improve With feature for package gdb 2021-08-27 20:16:29 +08:00
b316b9c073 example updates for package gcache 2021-08-27 01:01:41 +08:00
5b57c35522 comment updates for package gcache 2021-08-27 00:01:15 +08:00
b9a07b104a Update gcron_schedule_test.go
add test to slash template parse
2021-08-26 10:58:54 +08:00
c7b379e53f Merge branch 'master' into processconflict 2021-08-26 09:33:23 +08:00
e0a3233ea3 improve package gcron 2021-08-26 00:11:27 +08:00
1b588b14d8 Merge branch 'master' of https://github.com/gogf/gf 2021-08-25 23:46:16 +08:00
2c839db941 Merge pull request #1372 from gzhmt-developer/master
fix tcp http demo error content-length
2021-08-25 23:42:30 +08:00
f9eaa8f930 fix issue of nested transaction missing in function operations for package gdb 2021-08-25 22:31:59 +08:00
59397fd8a5 add buildin function add/minus/times/divide for package gview 2021-08-25 20:00:53 +08:00
6be582355c improve DB.Close for package gdb 2021-08-25 10:58:29 +08:00
ac73851f78 Merge branch 'master' into processconflict 2021-08-25 09:28:04 +08:00
257897763d Merge branch 'master' of https://github.com/gogf/gf 2021-08-25 00:54:47 +08:00
29d50994ae add function Close for DB for package gdb 2021-08-24 22:59:25 +08:00
b129ee3f04 fix issue in unit testing case for package ghttp 2021-08-24 21:35:49 +08:00
a47699bf6e fix issue in unit testing case for package gjson 2021-08-24 21:34:14 +08:00
66b8b591df fix issue in missing import for package gcode 2021-08-24 21:31:15 +08:00
7b47fe96dd update version of third-party redigo from v2.0.0+incompatible to v1.8.5 2021-08-24 21:22:58 +08:00
abc8e62d58 add package gcode and improve error implements for package gerror 2021-08-24 21:18:59 +08:00
22e3fddf8d feat(fix bug , add nexttime feature):
1. fix bug: "Mon Jul 9 23:35 2012", "0 0 0 * Feb Mon/2". wo should get 1,3,5,7
2. add function to get the next run time
2021-08-23 23:12:16 +08:00
ef36cf8446 fix issue in example of package gjson 2021-08-20 23:15:48 +08:00
c5345239fc improve logging content for package gcron 2021-08-20 15:49:45 +08:00
a229960218 add context id feature for package gctx/glog 2021-08-20 15:44:08 +08:00
43180ef239 improve package gcron 2021-08-20 14:09:15 +08:00
e10240bd7c improve package gcron 2021-08-20 11:52:22 +08:00
a0ef6fce81 add bacth registering function Map for package ghttp 2021-08-19 20:59:08 +08:00
314bee2b4e remove context key printing into logging content for context feature of package glog 2021-08-19 15:35:41 +08:00
050c93ee8d Merge branch 'develop' of https://github.com/gogf/gf 2021-08-19 14:12:04 +08:00
feefcc98ef improve condition parameter of struct by sequence for package gdb 2021-08-19 14:11:28 +08:00
8f4ce91361 improve condition parameter of struct by sequence for package gdb 2021-08-19 14:09:31 +08:00
f03f56ba4e improve gconv.Struct for map attribute converting 2021-08-19 11:28:25 +08:00
457d552fa0 add UnmarshalJSON interface support for package gconv 2021-08-17 16:51:29 +08:00
be2fcf7f57 add UnmarshalJSON interface support for package gconv 2021-08-17 16:30:47 +08:00
ad6c4f5245 improve session storage for package gsession 2021-08-16 21:47:45 +08:00
db621e38d9 improve ServeFile/ServeFileDownload for package ghttp 2021-08-16 20:30:58 +08:00
170af1ab00 Merge pull request #1374 from wangle201210/develop
add func SetWriterColorEnable for file log color
2021-08-15 23:52:10 +08:00
31ef4e7b5a fmt 2021-08-13 13:27:43 +08:00
f56f689970 fmt 2021-08-13 13:24:28 +08:00
17b73e7cb3 add func SetWriterColorEnable for file log color 2021-08-13 13:20:33 +08:00
903f29a824 add OmitNil feature for package gdb 2021-08-13 11:28:47 +08:00
12f2193963 improve handler feature for package glog 2021-08-12 22:14:31 +08:00
13ecbc263e improve handler feature for package glog 2021-08-12 21:58:06 +08:00
7b9888c004 add FieldCount/FieldSum/FieldMax/FieldMin/FieldAvg functions for gdb.Model 2021-08-12 19:42:44 +08:00
91cd4f96f0 Update gtcp_conn.go 2021-08-12 10:50:46 +08:00
95a44122dd comment update for package glog 2021-08-12 10:47:05 +08:00
2bd76dfdde go fmt code 2021-08-12 09:35:57 +08:00
26895294f9 Merge pull request #1 from gzhmt-developer/ansionfor-patch-1
fix tcp demo error content-length
2021-08-12 00:23:04 +08:00
4cd4559784 fix tcp demo error content-length 2021-08-12 00:21:36 +08:00
3fc96f2bd0 add package gctx 2021-08-11 13:20:00 +08:00
91dd9e2bf9 auto update value of time field if given time value is zero for package gdb 2021-08-10 20:30:32 +08:00
9c5642f141 fix issue in border value checks for gstr.CompareVersion/CompareVersionGo 2021-08-10 19:29:54 +08:00
00f0a743fc add function TestDataContent for package gdebug 2021-08-10 17:20:15 +08:00
232751e3db improve context key and caller path&func outputs for logger of package glog 2021-08-10 15:46:40 +08:00
1c600d5b20 revert ORM logger from interface to glog.Logger 2021-08-10 15:36:15 +08:00
9bc3b44a61 version updates 2021-08-09 19:30:16 +08:00
83729f18ad Merge branch 'develop' 2021-08-09 19:29:46 +08:00
fdb6e70322 comment update for package glog 2021-08-09 19:29:11 +08:00
efaf3d591c comment update for package glog 2021-08-09 19:25:23 +08:00
ef50eb6d6b comment update for package ghttp 2021-08-09 19:16:37 +08:00
fb5a1f2306 Merge pull request #1369 from wangle201210/develop
fix print log on windows
2021-08-09 19:16:24 +08:00
9d4382d12e fmt 2021-08-08 16:58:15 +08:00
9ee76ecc93 fix print log on windows 2021-08-08 16:23:25 +08:00
0d2ca48d16 update comment and standardize const naming for package gproc 2021-08-08 14:05:27 +08:00
f1857df5e2 comment update for package glog 2021-08-08 13:56:26 +08:00
fc1dfb7ff9 comment update;standardize const naming for package gtcp/gudp 2021-08-08 13:10:21 +08:00
dc407bf293 merge develop 2021-08-07 12:04:31 +08:00
4eb057227c add SizeFormat function for package gfile; add more internal logging for rotation feature for pacakge glog 2021-08-07 11:59:30 +08:00
9cd944fd77 improve time maintaining feature for package gdb 2021-08-07 11:01:15 +08:00
cd3593182a improve package gerror/ghttp for error code handling 2021-08-07 10:44:57 +08:00
0f6820df9e add more unit testing case for package gtimer 2021-08-06 14:13:37 +08:00
0e158903c2 improve package gtimer for priority checks 2021-08-06 12:08:49 +08:00
214d0513e5 Merge branch 'develop' of https://github.com/gogf/gf into develop 2021-08-05 19:15:31 +08:00
75ca866991 fix issue in ghttp.Server 2021-08-05 19:15:18 +08:00
f22aa1b5d6 Merge pull request #1361 from jroam/fixbug-garray 2021-08-05 13:09:31 +08:00
00d7ee93b2 improve package gerror 2021-08-05 11:40:31 +08:00
537cbf983e edit some function annotations 2021-08-04 23:35:29 +08:00
4c54b1cfbc improve errcode feature for package gerror 2021-08-04 20:50:45 +08:00
e9ea58df64 Merge branch 'master' of https://github.com/gogf/gf 2021-08-04 13:29:17 +08:00
65fff6feae version updates 2021-08-04 13:29:06 +08:00
dbded5e753 Merge pull request #1365 from stardemo/master
Update Readme ,Github Action badge
2021-08-04 13:15:02 +08:00
3043645605 Update Readme ,Github Action badge 2021-08-03 23:29:34 +08:00
685bf56a30 fix issue #1325 2021-08-03 22:21:20 +08:00
a4497ed547 improve gdb.Modle for where holder 2021-08-03 21:32:05 +08:00
28cb0bef25 change logger of DB from glog.Logger to interface Logger 2021-08-03 20:34:26 +08:00
114cdb2351 improve package gtimer 2021-08-03 19:37:25 +08:00
a2bb8ad2f2 add more unit testing case for package gdb 2021-08-02 21:13:00 +08:00
5a4de52900 fix invalid separator char in packing with prefix folder string in OS widnows for package gres 2021-08-02 19:58:04 +08:00
ff70e54e3e fix unit testing case for package gtrace 2021-08-02 09:50:44 +08:00
fddc21670a add condition and order-by feature for with tag feature for package gdb 2021-08-02 00:38:56 +08:00
f02372cf58 improve package gvalid 2021-08-01 23:50:44 +08:00
ab5f809074 go.sum updates 2021-08-01 22:13:20 +08:00
121c1a0125 Merge branch 'develop' of https://github.com/gogf/gf into develop 2021-08-01 22:13:00 +08:00
7678540270 add bail rule for package gvalid 2021-08-01 22:12:44 +08:00
248e6ff134 bugfix garray Sort 2021-08-01 15:19:48 +08:00
839ebd5b51 Merge pull request #1360 from houseme/master
Update go.mod
2021-08-01 11:29:36 +08:00
fa64df6f91 improve package gdb/glog 2021-08-01 10:33:33 +08:00
0acd118c03 add ModelHandler feature for package gdb 2021-08-01 10:17:03 +08:00
2b5244a54b unit testing cases update for package gredis/glog 2021-08-01 09:45:46 +08:00
2472dd5fac github action updates 2021-08-01 09:33:12 +08:00
5899f676f7 Merge pull request #1347 from stardemo/develop
add basic action scripts
2021-08-01 09:17:31 +08:00
bb57dc1ae7 improve request context feature for package ghttp 2021-08-01 09:17:37 +08:00
5a6c2c27df inject Request object into context 2021-07-30 17:17:13 +08:00
9f096fc63d improve error code for package gerror 2021-07-30 16:21:45 +08:00
4267aadd78 remove controller feature from package ghttp 2021-07-30 15:15:44 +08:00
ef77a54c7e improve OmitEmpty feature for package gdb; mark package gmvc deprecated 2021-07-30 14:58:23 +08:00
afb0af4afd add example for package gvalid 2021-07-30 11:29:48 +08:00
9be92cc3d4 garray代码规范化 2021-07-28 22:18:06 +08:00
15aabfb4e7 Update go.mod
update otel v1.0.0-RC1 to otel v1.0.0-RC2
2021-07-28 21:32:08 +08:00
c83e899f1f add go version matrix 2021-07-22 09:29:26 +08:00
ebe90dcaa8 fix issue in Cache Penetration for cache feature of package gdb 2021-07-21 19:24:16 +08:00
1c3ae11eba Update go.yml 2021-07-21 11:18:10 +08:00
b718aa88a2 add report && i386 test 2021-07-21 00:02:15 +08:00
6240c3d90b disabled error test case to test action 2021-07-20 23:35:07 +08:00
c78f9d19f5 Update go.yml 2021-07-20 23:26:53 +08:00
0ddacdd7e2 add error code for components 2021-07-20 23:02:02 +08:00
f8486474aa fix scripts path 2021-07-19 23:23:24 +08:00
906c54ce61 add basic action scripts 2021-07-19 23:20:51 +08:00
f72d991c36 rename attribute names from lower-camel case to upper-camel case 2021-07-19 20:06:44 +08:00
528f0e5434 Merge branch 'feature/new-register-type' into develop 2021-07-19 19:41:09 +08:00
88009ee278 fix issue #1341 2021-07-15 22:19:00 +08:00
b192b7dd60 remove internal logging for package gtimer 2021-07-15 21:46:56 +08:00
03d51bd18c add internal logging for package gtimer 2021-07-15 21:40:26 +08:00
5c6c932a75 merge master 2021-07-15 21:23:36 +08:00
92c3c136f9 improve color feature for package glog 2021-07-15 21:20:29 +08:00
5069436fd2 Merge pull request #1346 from goflyfox/dev
update pgsql pri error #1340
2021-07-15 21:18:52 +08:00
141ba2e951 update pgsql pri error #1340 2021-07-15 14:53:21 +08:00
fae4dea37a improve color feature for package glog 2021-07-15 13:31:32 +08:00
860b22aba4 Merge pull request #1312 from wangle201210/develop
add log level prefix color
2021-07-15 09:16:27 +08:00
30dbccf99e 输出对应err 2021-07-14 21:28:23 +08:00
9b2497bc57 Merge branch 'develop-up' into develop
* develop-up: (38 commits)
  revert gerror usage for package gvalid
  unify error package to gerror
  add CtxStrict feature for package gdb
  rename constants of package gpage from skake to upper camel case
  add context for intlog
  improve Record/Result converting for package gdb
  add context for intlog/gsession;improve struct/structs converting for package gconv
  unify command or enviroment key names for packages
  improve details for package glog
  add file configuration support for logger in ghttp.Server
  version updates
  add more unit testing cases for package ghttp
  add automatic fields mapping and filtering for Model.Where statements
  improve Order feature for package gdb
  improve function Increment/Decrement for package gdb
  add auto fields filtering feature for function Scan of package gdb; mark funtcion Struct/Structs deprecated for gdb.Model
  improve record converting for package gdb
  improve transaction feature for package gdb
  improve caller path filtering for package gdebug
  improve caller path filtering for package gdebug
  ...

# Conflicts:
#	os/glog/glog_logger.go
#	os/glog/glog_logger_config.go
#	os/glog/glog_logger_level.go
2021-07-14 21:12:18 +08:00
0140808460 add handler extension feature for package ghttp 2021-07-13 23:01:31 +08:00
84aa30d9c2 允许日志文件中添加颜色 2021-07-13 22:45:35 +08:00
bc724deb5e 日志内容区分文件和控制台输出 2021-07-13 21:43:07 +08:00
fbfc23211c fix issue in Counter of package gdb 2021-07-13 19:37:16 +08:00
3d4d3a763a comment update for package gfsnotify 2021-07-12 22:05:03 +08:00
046749566d update sql of unit testing case for package gdb 2021-07-08 23:06:58 +08:00
3b1b8a8306 Merge branch 'master' of https://github.com/gogf/gf 2021-07-08 22:44:29 +08:00
5e92747737 fix issue #1291 2021-07-08 22:44:16 +08:00
82ad7e2acc add more unit testing case for package gdb 2021-07-08 22:08:45 +08:00
2d319d0856 update sql of unit testing cases for package gdb 2021-07-08 21:46:21 +08:00
c060904f3f Merge pull request #1328 from lgyaxx/patch-1
Update gdb_model_fields.go
2021-07-08 21:18:42 +08:00
a63c4b6441 add more unit testing case for package gdb 2021-07-08 21:06:49 +08:00
9df860a202 fix issue #1292 2021-07-08 21:02:36 +08:00
2a1634fd6f Update gdb_model_fields.go
annotation typo fix
2021-07-08 15:42:51 +08:00
2970864158 fix issue #1240 2021-07-06 21:18:26 +08:00
8e76d7a8ed improve function TableFileds for gussing table name from table string;add overwrote function DoInsert for mssql/pgsql/oracle/sqlite for unsupported features 2021-07-06 20:59:09 +08:00
50e5dd5bd0 fix issue in fields filtering for table name with as statement 2021-07-06 13:14:33 +08:00
7e2605188d improve session variable map in template parsing 2021-07-06 09:58:25 +08:00
e5ae1cb85c improve session variable map in template parsing 2021-07-06 09:53:35 +08:00
1e78734f2c remove gf cli from basic framework 2021-06-30 20:43:49 +08:00
d5fad88c56 gf cli updates 2021-06-30 20:16:49 +08:00
35a81b868f gf cli updates 2021-06-30 20:08:25 +08:00
84355c1ddd gf cli updates 2021-06-30 20:07:46 +08:00
012121ea77 gf cli updates 2021-06-30 20:00:50 +08:00
1e628b9edb move command tool from repo gf-cli to sub folder 2021-06-30 00:15:52 +08:00
bfdeb6c4f5 log color兼容win环境 2021-06-29 21:05:46 +08:00
c42a9d6e50 Merge pull request #1316 from qinyuguang/otel
Otel
2021-06-29 13:05:38 +08:00
083e32fd9e otel version bump to v1.0.0-RC1 2021-06-28 13:36:37 +08:00
2a350fd3ab merge develop 2021-06-28 13:15:40 +08:00
03928f1977 add logging level prefix with color or not config 2021-06-28 00:58:35 +08:00
a2771c7558 format code 2021-06-28 00:23:25 +08:00
968e1db94d add log level prefix color 2021-06-28 00:00:44 +08:00
bb0a3e09d6 revert gerror usage for package gvalid 2021-06-26 18:44:59 +08:00
d109706ad3 unify error package to gerror 2021-06-26 18:34:26 +08:00
b958689264 add CtxStrict feature for package gdb 2021-06-26 18:20:55 +08:00
859ea150ed rename constants of package gpage from skake to upper camel case 2021-06-26 17:00:32 +08:00
91ca79b300 add context for intlog 2021-06-26 16:51:26 +08:00
8210f40469 improve Record/Result converting for package gdb 2021-06-26 16:46:36 +08:00
50ffaef33f add context for intlog/gsession;improve struct/structs converting for package gconv 2021-06-26 16:23:54 +08:00
c25f88293b unify command or enviroment key names for packages 2021-06-26 12:08:18 +08:00
025cdd66c5 improve details for package glog 2021-06-26 11:25:54 +08:00
237f172ae5 add file configuration support for logger in ghttp.Server 2021-06-26 11:18:44 +08:00
4cd7e4e5a0 version updates 2021-06-23 21:57:13 +08:00
e6688b9e86 add more unit testing cases for package ghttp 2021-06-23 21:39:12 +08:00
65131c6f22 add automatic fields mapping and filtering for Model.Where statements 2021-06-23 12:04:16 +08:00
7667aca4c2 improve Order feature for package gdb 2021-06-23 09:42:10 +08:00
816791b9c1 improve function Increment/Decrement for package gdb 2021-06-23 09:34:53 +08:00
d6ea2220f7 add auto fields filtering feature for function Scan of package gdb; mark funtcion Struct/Structs deprecated for gdb.Model 2021-06-22 21:48:56 +08:00
69dd5db774 improve record converting for package gdb 2021-06-22 20:05:37 +08:00
adca9222ab improve transaction feature for package gdb 2021-06-22 17:42:31 +08:00
7144aa6999 improve caller path filtering for package gdebug 2021-06-22 15:34:26 +08:00
fbad5f60eb improve caller path filtering for package gdebug 2021-06-22 15:09:08 +08:00
266f592739 improve raw sql count statement for package gdb 2021-06-21 19:21:38 +08:00
7c8bbcb3af version update 2021-06-21 09:38:19 +08:00
ba18e2bf6b comment update 2021-06-21 09:37:12 +08:00
5fefe97b87 add Raw Model for package gdb 2021-06-18 15:27:49 +08:00
5fba250a14 add Raw Model for package gdb 2021-06-18 15:20:27 +08:00
2606ad83ac add OnDuplicate/OnDuplicateEx feature for package gdb 2021-06-16 21:51:44 +08:00
d450de8e0d add OnDuplicate/OnDuplicateEx feature for package gdb 2021-06-16 21:44:31 +08:00
e4b0de0d4f Merge branch 'master' of https://github.com/gogf/gf 2021-06-15 19:58:10 +08:00
2af4fd86cc rename configuration node name from LinkInfo to Link 2021-06-15 19:57:55 +08:00
ddd171bc18 Merge pull request #1284 from qinyuguang/gutil
add gutil.SliceToMapWithColumnAsKey
2021-06-11 09:52:30 +08:00
5ef4ef61f0 Merge pull request #1280 from imloama/develop 2021-06-11 09:50:17 +08:00
2679f92aa8 comment update for package gerror 2021-06-10 20:45:22 +08:00
cca438d77f fix issue #1209 2021-06-10 20:17:53 +08:00
f2bc29e5c1 add gutil.SliceToMapWithColumnAsKey 2021-06-09 18:49:49 +08:00
fe7209e76d rename HandleSqlBeforeCommit to DoCommit for package gdb 2021-06-08 21:55:55 +08:00
7c4a0453b7 improve handler feature for package glog 2021-06-08 21:35:54 +08:00
97879834bc remove deprecated functions for package gdb 2021-06-08 21:28:41 +08:00
332535901f Merge branch 'master' of https://github.com/gogf/gf 2021-06-08 20:32:52 +08:00
e68e7a3224 remove Batch*/DoBatchInsert functions for package gdb 2021-06-08 20:32:34 +08:00
b935a8c652 fix merge conflicts for gdb_driver_pgsql 2021-06-08 09:20:22 +08:00
65befd5ac4 Merge pull request #1276 from qinyuguang/gdb_config_timezone
add timezone configuration for package gdb
2021-06-07 20:01:06 +08:00
78bdb5ef71 Merge pull request #1277 from weicut/master
Fixed incorrect type conversion
2021-06-07 19:58:27 +08:00
6eb7261dfd add timezone configuration for package gdb, effective for mysql and pgsql 2021-06-07 13:45:40 +08:00
4f82be5bc0 Fixed incorrect type conversion 2021-06-07 10:17:23 +08:00
3ac5772059 add UNION/UNION ALL feature for package gdb 2021-06-06 23:06:39 +08:00
eb723e47c2 fix issue in gconv.MapDeep 2021-06-05 08:58:54 +08:00
8aa7f08350 improve DB interface for package gdb 2021-06-04 09:54:19 +08:00
a54559d016 add WhereLT/WhereLTE/WhereGT/WhereGTE/WhereOrLT/WhereOrLTE/WhereOrGT/WhereOrGTE functions for gdb.Model 2021-06-04 09:27:41 +08:00
8e1f6abac5 change github.com/go-sql-driver/mysql to github.com/gogf/mysql 2021-06-03 15:38:33 +08:00
7f3a2207a3 Merge branch 'master' of https://github.com/gogf/gf 2021-06-02 21:12:52 +08:00
742c7913ea fix issue in function Parse for package ghttp 2021-06-02 21:12:27 +08:00
2d8ab726e2 Merge pull request #1265 from weicut/master 2021-06-02 13:11:59 +08:00
702a296258 improve handler feature for package glog 2021-06-02 09:53:08 +08:00
c3c5414ce2 add custom handler feature 2021-06-02 09:42:27 +08:00
ee3d375532 补充浮点数单元测试 2021-06-02 09:18:52 +08:00
e3f5c9175c 补充浮点数单元测试 2021-06-02 09:17:50 +08:00
7c24449a24 Merge branch 'master' of github.com:gogf/gf 2021-06-02 09:08:45 +08:00
1c09846d3e fix issue #1272 2021-06-01 20:09:52 +08:00
db94346863 gitee/github template update 2021-06-01 19:59:57 +08:00
3e6b9864d5 fix issue #1256 2021-06-01 19:47:02 +08:00
392c81ad69 remove Link parameter from function TableFields for package gdb 2021-05-29 17:26:08 +08:00
fe142c93fd add function Transaction for gdb.Model 2021-05-29 17:07:49 +08:00
578e7d634b comment updates for package gvalid 2021-05-29 16:47:39 +08:00
6659a49869 Merge branch 'master' of https://github.com/gogf/gf 2021-05-29 16:45:19 +08:00
d9bc8b05e1 add example for package gvalid 2021-05-29 16:45:08 +08:00
571405597b Merge pull request #1271 from wangle201210/master
add valid size method
2021-05-29 16:16:21 +08:00
1441ce7f5f add examples for package gproc 2021-05-29 15:47:07 +08:00
071a587755 Merge remote-tracking branch 'upstream/master' 2021-05-29 12:35:56 +08:00
c1db01425e fix remarks 2021-05-29 12:25:50 +08:00
7bfd48e2ab valid field length 2021-05-29 12:15:37 +08:00
e80309af32 Merge branch 'master' of https://github.com/gogf/gf 2021-05-29 11:30:47 +08:00
fa1814ff54 add custom rule fucntions feature for package gvalid 2021-05-29 11:30:34 +08:00
d7b8a2684a Revert ""gvalid length" compatible with only one parameter"
This reverts commit b2d3c7d1fd.
2021-05-29 11:28:26 +08:00
8559cd299d Merge pull request #1268 from wangle201210/master
"gvalid  length" compatible with only one parameter
2021-05-28 13:44:36 +08:00
b2d3c7d1fd "gvalid length" compatible with only one parameter 2021-05-28 11:34:51 +08:00
5100e0e8b7 add sub-query feature for orm 2021-05-27 22:18:16 +08:00
8acb921ee3 improve package gtimer for times limitation 2021-05-27 13:10:10 +08:00
9ee0f04e58 add command feature for package gcmd 2021-05-26 22:08:13 +08:00
fc88001a8c revert name from Job to Entry for package gtimer/gcron 2021-05-26 09:55:33 +08:00
fab6c4048d comment update 2021-05-25 22:16:55 +08:00
7b32791006 修复浮点型排序
原因:
返回值,强制转成 int 类型,会导致浮点型比较不准确,例如:0.33,转成 int 类型时,会变成 0
2021-05-25 16:15:02 +08:00
aa04948319 修复浮点型排序
原因:
返回值,强制转成 int 类型,会导致浮点型比较不准确,例如:0.33,转成 int 类型时,会变成 0
2021-05-25 16:10:52 +08:00
5903eb8ceb fix issue #1254 2021-05-25 09:56:23 +08:00
211e62a8e7 add timestamptz type support for pgsql for package gdb 2021-05-24 13:30:04 +08:00
64a9b06e64 comment update 2021-05-23 00:02:49 +08:00
6d81aa4462 infract internal link 2021-05-21 15:38:56 +08:00
406b6bf410 infract internal link 2021-05-21 15:30:21 +08:00
4e41d8aff8 improve context and nested transaction feature for package gdb 2021-05-21 13:25:53 +08:00
017c6e4e1f add example for i18n feature of package gvalid 2021-05-19 23:17:13 +08:00
7d3233c7ad add context for custom validation rule function;add function WhereNot for gdb.Model 2021-05-19 22:33:50 +08:00
3e2662582c improve nested transaction feature for package gdb 2021-05-19 21:17:21 +08:00
c94dee8191 improve nested transaction feature for package gdb 2021-05-19 21:11:51 +08:00
ab2ef13d99 improve transaction for package gdb 2021-05-19 20:33:19 +08:00
fac9ab5c01 improve package gvalid 2021-05-19 19:00:34 +08:00
420e0b9ca4 improve package gvalid 2021-05-19 13:29:40 +08:00
ea0340db8e improve validation manager feature for package gvalid 2021-05-19 09:25:49 +08:00
0bd1ea07a7 example update 2021-05-18 20:52:39 +08:00
c8c28770fb change Error from struct to interface for package gvalid;error string update for package gdb 2021-05-18 20:51:31 +08:00
0dfd968824 comment update for package gconv/gproc 2021-05-17 21:26:39 +08:00
b84ca9cc13 debug 2021-05-17 20:25:00 +08:00
e5734425ba debug 2021-05-17 20:18:21 +08:00
2274a10cfd fx issue #1250 2021-05-17 19:59:34 +08:00
302e234bfe comment update for package gfsnotify 2021-05-17 19:17:04 +08:00
2b942bf06b Merge pull request #1247 from notnear/master
add websocket client
2021-05-17 13:52:39 +08:00
522f6cb455 fix issue of failing in folder watching with no recursive option for package gfsnotify 2021-05-17 13:43:36 +08:00
a757fbd37d improve package gcfg 2021-05-17 00:07:06 +08:00
33567ef338 remove unit testing file for package internal/json 2021-05-15 23:42:39 +08:00
b2a15c259e improve unit testing case for package internal/json 2021-05-15 23:21:38 +08:00
d12409b118 revert json.UnmarshalUseNumber to json.Unmarshal for code in the example folder 2021-05-15 23:13:31 +08:00
8aed1eca13 version updates 2021-05-15 23:02:44 +08:00
f389688caa add unit testing cases for package internal/json 2021-05-15 23:02:21 +08:00
7003c284d0 replace json.Unmarshal with json.UnmarshalUseNumber for packages 2021-05-15 22:38:07 +08:00
facb2949c3 improve unit testing cases for package gtimer 2021-05-15 18:31:46 +08:00
1b1355a595 improve package gtimer 2021-05-15 18:27:46 +08:00
d76e4c8aed refract package gtimer for more stable 2021-05-15 18:13:51 +08:00
cc1224e032 add context for package gvalid.Check* functions 2021-05-13 20:56:52 +08:00
tom
09de115670 add websocket client 2021-05-13 17:51:06 +08:00
23110b5d19 fix issue in unit testing case of package gins 2021-05-13 08:53:54 +08:00
a326f4a989 improve package gi18n/gview/gvalid for more flexable i18n feature controll,add custom error configuration and i18n translation for custom error message 2021-05-13 00:16:45 +08:00
d21b9d58e1 improve with feature by supporting attributes struct which also have 'with' tag 2021-05-12 21:34:15 +08:00
9d362c3738 merge feature/improve_struct_validation 2021-05-12 00:15:53 +08:00
b06580d343 improve struct validation for package gvalid 2021-05-12 00:01:52 +08:00
a4240bdfb7 improve struct validation for package gvalid 2021-05-11 20:57:30 +08:00
1eab1cb367 add more unit testing cases,remove function Filter usage in unit testing cases for package gdb 2021-05-11 20:14:06 +08:00
2e38416e12 improve struct embedded association case of with feature for package gdb 2021-05-11 20:00:50 +08:00
034a3f1808 improve struct validation 2021-05-11 19:20:39 +08:00
531519e8f2 Merge pull request #8 from gogf/master
mr from master
2021-05-07 09:53:15 +08:00
6a80091fef version updates 2021-05-03 00:00:29 +08:00
742653ce75 improve Model function for struct parameter that can retrieve table name tag from 2021-05-02 23:28:24 +08:00
a8c3d07d9f improve with feature for package gdb 2021-05-02 22:35:47 +08:00
df1ef5db78 add example for package gdb 2021-05-02 17:57:00 +08:00
4b15ab5e99 improve OrderRandom function for package gdb 2021-05-02 16:42:34 +08:00
cdc97e9b2b improve logging for transaction feature for package gdb 2021-05-02 15:58:28 +08:00
bd84b97614 add more Where*/Min/Max/Avg/Sum/CountColumn/Increment/Decrement/OrderAsc/OrderDesc/OrderRandom functions and associated unit testing cases for package gdb 2021-05-02 12:17:06 +08:00
d7eb1cca07 add nested transaction feature for package gdb 2021-05-02 09:35:54 +08:00
5856f74d83 up 2021-05-02 08:10:35 +08:00
563509c4a6 route map dumping updates 2021-05-01 09:04:16 +08:00
max
f3983cd6b7 feat: pg查询表字段时获取字段描述信息 2021-04-28 14:51:40 +08:00
d0753fa527 Merge branch 'develop' 2021-04-26 20:38:16 +08:00
524e3bedc7 improve empty value validation for required-with* patterns for package gvalid 2021-04-26 20:37:36 +08:00
30b60754e3 README update 2021-04-16 10:32:55 +08:00
88c49dc2cb README update 2021-04-16 10:27:39 +08:00
bb3dcc2622 Merge branch 'master' of https://github.com/gogf/gf 2021-04-16 10:22:02 +08:00
5cca0640d9 README update 2021-04-16 10:21:42 +08:00
fb48ceeeee Merge pull request #1214 from ansionfor/add-graceful-timeout
add graceful reload timeout config
2021-04-10 08:23:54 +08:00
90f4bba8fd gofmt格式化 2021-04-07 20:52:38 +08:00
802187abc4 add graceful reload timeout 2021-04-07 16:06:37 +08:00
49dd17c047 remove maxIdleTime feature due to be compatible with old Golang version <= v1.14 2021-04-04 12:13:51 +08:00
a3b94c24de fix issue #854; add maxIdleTime configuration and comments update for package gdb; version updates 2021-04-04 12:01:22 +08:00
ac4485dc84 comment update for package gsession 2021-04-02 18:00:50 +08:00
4d1e25cdab change internal constant varibale names for package gqueue 2021-04-02 16:16:54 +08:00
ec00e99477 comments update for package gtime 2021-04-01 09:41:14 +08:00
a73dca3e50 Merge pull request #1196 from yanllllk/yys 2021-04-01 09:27:59 +08:00
yys
ed71d2b2ac add test 2021-03-31 14:07:28 +08:00
3911c2e0a2 README updates 2021-03-30 18:00:44 +08:00
1b6765db50 README updates 2021-03-30 17:44:57 +08:00
345fb69521 README updates 2021-03-30 17:43:44 +08:00
83a6abc70f README updates 2021-03-30 17:42:00 +08:00
cfef726205 README updates 2021-03-30 17:41:10 +08:00
de0f9e728c README updates 2021-03-30 17:39:56 +08:00
d9754a532b version updates 2021-03-30 17:20:13 +08:00
dc51023c61 upgrade github.com/olekukonko/tablewriter from 0.0.1 to 0.0.5 2021-03-30 16:54:52 +08:00
87ce5c5419 Merge branch 'master' of https://github.com/gogf/gf 2021-03-30 16:48:19 +08:00
c4fc9f9618 fix issue #1204: improve validation support for time value, eg: gtime.Time/*gtime.Time, time.Time/*time.Time. 2021-03-30 16:06:20 +08:00
8d7aa5db83 Merge pull request #1205 from Zh1Cheung/master
bug:The parameter of the New method is a pointer
2021-03-30 15:39:31 +08:00
9c70fe3be8 add more unit testing case for package gvalid 2021-03-30 15:25:26 +08:00
78027d2ec6 deprecated comments update 2021-03-30 13:43:08 +08:00
d4e4b9addf improve package gcfg for automatically checking and adding path of package main 2021-03-29 18:05:47 +08:00
b2acd22f58 improve package gi18n 2021-03-29 17:36:51 +08:00
ae5ecb5bfa update unit testing case for package gtrace 2021-03-29 16:12:14 +08:00
6f1340ce36 upgrade otel from v0.18.0 to v0.19.0 2021-03-29 16:00:56 +08:00
473fdba14f add replace in go.mod for otel 2021-03-29 15:51:03 +08:00
93a01a1aaf bug:The parameter of the New method is a pointer 2021-03-27 16:21:28 +08:00
yys
7c51ff4707 gtime 修改 2021-03-25 13:38:59 +08:00
bb6883213f fix issue #1202 2021-03-24 22:04:04 +08:00
54395b39a6 fix issue #1202 2021-03-24 21:19:23 +08:00
6deb817fd0 fix issue in unit testing case for package gpage 2021-03-23 17:58:09 +08:00
482e093331 add map/[]map converting support for gconv.Scan;improve gconv.MaptoMaps 2021-03-23 17:53:20 +08:00
042f903157 Merge branch 'master' of https://github.com/gogf/gf 2021-03-23 14:23:47 +08:00
c423ad4830 fix issue in gfile.MainPkgPath;improve fields filter for package gdb 2021-03-23 14:21:54 +08:00
958b109a12 fix removing cookie issue 2021-03-19 19:16:21 +08:00
113fffdd69 Merge pull request #1199 from yangyanqing/yangyanqing/fix-zte-chinese 2021-03-19 17:08:31 +08:00
4aaf09fded improve gfile.MainPkgPath 2021-03-19 16:35:55 +08:00
2f3df76f37 fix issue #1190 2021-03-19 15:37:33 +08:00
cf7706b16d ZTE 的中文名应该是“中兴通讯”,不是“中兴科技” 2021-03-19 11:45:17 +08:00
36963c05a2 fix issue #1190 2021-03-19 11:35:12 +08:00
48d840a1b8 ad go.sum 2021-03-18 15:29:42 +08:00
e3ebc908bb improve package gconv 2021-03-18 15:21:05 +08:00
9ed8d8c113 rename max content log size name for gtrace from maxlogsize to maxcontentlogsize 2021-03-18 11:22:44 +08:00
9eab5daf19 update required minimum go version from 1.11 to 1.14 2021-03-18 11:19:36 +08:00
6a24b595f0 upgrade otel from 0.16.0 to 0.18.0 2021-03-18 10:39:23 +08:00
150f237f13 fix issue in incorrect parameter sequence in package gi18n;improve package gcfg for detailed error printing 2021-03-16 14:39:01 +08:00
yys
17233084f1 为gtime添加scanner和valuer 2021-03-13 14:07:22 +08:00
41f2138b39 fix issue of overflow in grand.D 2021-03-11 23:29:39 +08:00
6376b8aaa6 remove session storage file removing feature for package gsession 2021-03-11 21:21:47 +08:00
58362ad143 add grand.D for random time.Duration;add checking and removing session files for package gsession 2021-03-11 20:05:08 +08:00
d72d23c2eb change browser mode from boolean markable variable to cookiejar for ghttp.Client 2021-03-11 18:58:13 +08:00
7702c5bfde add internal logging for package gdb/gredis 2021-03-11 11:39:49 +08:00
20f2a6c003 add recursive validation feature of struct attribute for package gvalid for #1165 2021-03-10 23:28:34 +08:00
0d4c1c47d5 improve package grand 2021-03-10 21:19:11 +08:00
4d32733790 improve ghttp.Client for #1179 2021-03-09 22:54:38 +08:00
0e58b6e95b README updates 2021-03-08 23:27:48 +08:00
19bfc48dca version updates 2021-03-04 22:49:11 +08:00
ae0cc5a4b6 add more unit testing case for ScanList feature 2021-03-04 20:45:05 +08:00
ba74e0beb2 improve ScanList of the same replation names for package gdb 2021-03-04 00:07:06 +08:00
e5ca4e788e fix issue #1190 2021-03-03 14:29:01 +08:00
1c7f034135 Merge branch 'master' of https://github.com/gogf/gf 2021-03-02 23:32:50 +08:00
4c78ce6e3f fix issue #1187 2021-03-02 23:27:50 +08:00
7803d557b3 Merge pull request #1183 from rc452860/master 2021-03-02 00:04:05 +08:00
204fea395c add struct object support in group router registering for package ghttp 2021-03-01 20:49:09 +08:00
bd13de2b39 improve package internal/intlog 2021-03-01 17:50:02 +08:00
d0f649b328 improve package internal/intlog 2021-03-01 17:39:13 +08:00
04e42d2175 improve package internal/intlog 2021-03-01 17:15:18 +08:00
ffc88eaaa7 improve package gcfg for main package path searching 2021-03-01 17:05:44 +08:00
4b4cc5ebb9 improve package gcfg for main package path searching 2021-03-01 17:02:07 +08:00
0e6cddb547 去除cancelFunc避免退出之前关闭mysqlConn导致数据获取不完整 2021-03-01 01:43:53 +08:00
a69aec9070 Merge branch 'master' of https://github.com/gogf/gf 2021-02-28 20:14:10 +08:00
d2bd37962e add unit testing case of UnmarshalValue for struct converting of querying result; improve package gdb 2021-02-27 23:58:36 +08:00
eb6763b0fd fix issue of failing configuration for default configuration file for package gcfg 2021-02-26 13:57:47 +08:00
d330afdd36 add required* rules checks for map/slice 2021-02-24 01:20:06 +08:00
5db4bbc186 fix issue 1162 2021-02-24 01:07:09 +08:00
e00f2666ff Merge pull request #1176 from develop1024/master 2021-02-24 00:39:35 +08:00
0238cdd5ec 修改注释错误-os/gbuild/GetVar 2021-02-23 23:07:28 +08:00
2c34d96b9d add tls configuration for ghttp.Client 2021-02-23 22:00:11 +08:00
65b3630f6d Merge pull request #1174 from aimingo/master
style:  code style
2021-02-22 11:41:45 +08:00
54b629561e style: code style 2021-02-22 11:20:10 +08:00
285ad36e7d add short datetime string parsing support for package gtime 2021-02-21 22:24:51 +08:00
5adde275fc add switch variable for internal type tracing components 2021-02-14 22:00:56 +08:00
a3fa10d820 great! completed 'with' feature for package gdb 2021-02-09 18:00:43 +08:00
acf47f3907 orm with feature 2021-02-08 17:57:21 +08:00
b4d5335e43 add package gmeta for embedded struct of meta data feature 2021-02-07 21:23:09 +08:00
39fb842e9b Merge branch 'master' into feature/ormwith 2021-02-07 15:34:50 +08:00
7a5d86b44d README updates 2021-02-07 15:34:36 +08:00
397e11e124 improve package gdb for association feature 2021-02-07 14:39:32 +08:00
f4314c318e up 2021-02-07 10:40:02 +08:00
9bb5536163 Merge branch 'master' of https://github.com/gogf/gf into develop 2021-02-07 10:32:18 +08:00
2344701f22 README updates 2021-02-07 10:31:59 +08:00
3bb909ba4f improve comment for package gspath 2021-02-06 11:42:58 +08:00
8ae0bd148b improve ScanList for package gdb; improve Structs for package gconv 2021-02-05 17:42:05 +08:00
72251b880a improve package gconv for slice converting 2021-02-05 14:44:20 +08:00
fefde4c290 improve stack feature for package gdebug/gerror 2021-02-04 00:10:13 +08:00
3b2bae6128 improve soft deletion for package gdb 2021-02-03 23:11:17 +08:00
ae559b57de fix dryrun configuration for package gdb 2021-02-03 22:46:59 +08:00
6135085d61 improve package gtrace 2021-02-03 15:27:41 +08:00
40bdc76af1 improve package gtrace 2021-02-03 15:14:07 +08:00
d4f982a9cf Merge branch 'master' of https://github.com/gogf/gf 2021-02-02 15:18:37 +08:00
813841bb68 rename GetWithEnv to GetOptWithEnv for packge gcmd 2021-02-02 15:16:09 +08:00
930e63e6b9 Merge pull request #1154 from gouguoyin/master
formatMonthDaySuffixMap() misjudged suffix
2021-02-02 13:16:17 +08:00
ce40d139e7 fix issue of nil response handling for ghttp.Client 2021-02-01 21:51:42 +08:00
8368e11827 merge develop 2021-02-01 17:14:08 +08:00
e6b4662ec2 improve tracing feature 2021-02-01 17:10:50 +08:00
28f83d3d32 formatMonthDaySuffixMap() misjudged suffix
when day is 21,abbreviated as 21st,suffix is st ,is not th
when day is 22,abbreviated as 22nd,suffix is nd ,is not th
when day is 23,abbreviated as 23rd,suffix is rd ,is not th
when day is 31,abbreviated as 31st,suffix is st ,is not th
2021-01-31 15:40:27 +08:00
3e33d66ab4 fix issue https://github.com/gogf/gf/issues/1148 2021-01-30 23:05:02 +08:00
13248d6736 Merge pull request #1149 from tangjoin/master
Update client_request.go
2021-01-30 22:57:14 +08:00
8bd24724e7 Update client_request.go 2021-01-30 22:10:06 +08:00
80248e9a6e improve tracing 2021-01-28 14:09:13 +08:00
2734903886 tracing baggage 2021-01-28 13:51:23 +08:00
2451b40d3e improve package gtrace 2021-01-28 13:11:09 +08:00
9fb6227461 fix issue in signal handler for windows 2021-01-28 10:08:52 +08:00
a2b322a31b improve gtime.ParseTimeFromContent 2021-01-27 23:37:04 +08:00
69e1628a0d improve unit testing case for package gtimer 2021-01-27 23:08:43 +08:00
6307af1096 travis updates 2021-01-27 21:02:39 +08:00
6e4e1abf1e improve tracing by adding constants for attribute and event names 2021-01-27 20:25:57 +08:00
2c15aad0e7 add common tracing labels 2021-01-27 19:50:32 +08:00
152c472bc2 add common tracing labels 2021-01-27 19:24:04 +08:00
8f6f17c341 add common tracing labels 2021-01-27 19:15:14 +08:00
f2fe084988 improve tracing feature 2021-01-27 13:28:12 +08:00
f5ba665c59 improve package gcfg 2021-01-27 00:55:45 +08:00
9cc5d7a691 improve package gdebug/gfile 2021-01-27 00:20:23 +08:00
94adc50487 version updates 2021-01-26 21:20:06 +08:00
1c93c2b000 merge develop 2021-01-26 21:19:43 +08:00
6bad31f1be move tracing examples to new repo. 2021-01-26 20:07:40 +08:00
24e2c7926e go mod tidy 2021-01-26 16:53:39 +08:00
e3be3bac92 add tracing example for grpc 2021-01-26 16:50:16 +08:00
c72c7dbe9a improve tracing feature 2021-01-26 16:06:20 +08:00
52c17dfce0 add example for tracing feature 2021-01-26 14:33:35 +08:00
c01b520ba6 improve package gcache 2021-01-26 14:11:36 +08:00
796774efe4 improve package gcache 2021-01-26 13:33:24 +08:00
0baa52afee improve statement features for package gdb 2021-01-26 11:09:50 +08:00
4c6d9f5eff improve tracing feture for package glog/gdb/gredis 2021-01-26 01:19:55 +08:00
99dd889ff0 add tracing feature for package gredis 2021-01-25 21:59:44 +08:00
b89d8d2740 add tracing feature for package gdb 2021-01-25 21:17:32 +08:00
cc1e340585 add tracing middleware for ghttp.Client/Server; add package gtrace 2021-01-25 18:43:47 +08:00
3f2ae3ba62 add tracing feature for ghttp.Client 2021-01-25 14:54:38 +08:00
e622ece861 merge develop 2021-01-25 10:23:46 +08:00
9f2e69a9e6 improve model relation feature for package gdb 2021-01-25 00:04:01 +08:00
9b02f5220a imprive uint testing case for package gtimer 2021-01-24 22:33:47 +08:00
2dd2144dcd improve unit testing case for package gdb/gcron 2021-01-24 21:52:34 +08:00
a5f53f158a improve unit testing case for package gcron; improve package gdb; 2021-01-23 01:01:24 +08:00
2c7a257b5a remove parseTime parameter for mysql driver for package gdb 2021-01-22 23:49:17 +08:00
f579c724c6 fix issue in batch number for package gdb 2021-01-22 23:21:29 +08:00
ab9d7ed509 improve package gcron 2021-01-22 23:09:42 +08:00
9524263803 improve unit testing cases for package gcron 2021-01-22 23:07:11 +08:00
c27ddb1d79 opentelemetry 2021-01-22 23:04:29 +08:00
ce640048b8 improve package gcfg 2021-01-22 15:30:39 +08:00
e222d92fb5 improve unit testing case for package gcron 2021-01-22 15:19:11 +08:00
f1ed9b31b6 add g.Listen for automatic signal handling feature 2021-01-22 12:57:21 +08:00
da0669c739 improve middleware feature for ghttp.Client 2021-01-22 01:06:44 +08:00
5679972d8d Merge pull request #1130 from eyasliu/develop-ghttp-middleware
New feature: ghttp client middleware
2021-01-22 00:36:57 +08:00
0aca2f0501 fix issue in package g; improve package ghttp 2021-01-22 00:36:28 +08:00
0fb32b63e7 add signal handler feature for package gproc; improve package ghttp/g for signal listening feature 2021-01-21 21:14:17 +08:00
b38a4610eb improve unit testing case for package gtimer 2021-01-20 14:19:14 +08:00
59285709a6 fix issue in filds filter in join statements for package gdb 2021-01-20 13:09:59 +08:00
a304ca8f5b improve unit testing case for package gcron 2021-01-20 00:18:29 +08:00
333e5b27aa add more unit testing case for package gdb 2021-01-19 21:08:01 +08:00
5f4293a803 make unnecessaryly exported resource private for package ghttp 2021-01-19 19:33:21 +08:00
fe80881ec9 improve package ghttp 2021-01-19 19:18:39 +08:00
e1418a2caa fix blocking issue in roration feature for package glog 2021-01-19 16:44:37 +08:00
68247acab1 improve package gjson/gvar 2021-01-19 14:26:17 +08:00
6d05512c2f improve unit testing case for package gtimer 2021-01-19 12:35:10 +08:00
bf6d6a29c0 improve package gtmer 2021-01-19 11:27:23 +08:00
353286fd84 fix issue in gtimer 2021-01-19 10:40:07 +08:00
c801df497f fix issue in package gtimer 2021-01-19 00:12:22 +08:00
93a648ba15 fixing gtimer 2021-01-18 21:20:10 +08:00
826b9b1b1f fix issue in struct converting for package ghttp 2021-01-18 09:22:46 +08:00
e661b160d8 const name renaming 2021-01-17 22:10:45 +08:00
8b6d00b193 improve package gconv 2021-01-17 22:06:07 +08:00
093034acd1 copyright comment update 2021-01-17 21:46:25 +08:00
6f968a125e improve time converting for package gconv 2021-01-17 21:39:17 +08:00
5c9cee7fb9 improve package gconv 2021-01-17 20:56:38 +08:00
7676837337 fix abort test 2021-01-17 18:05:29 +08:00
c5145dc4f6 remove abort, actually the abort is unuse 2021-01-17 17:26:53 +08:00
91e29e23a4 improve package gcfg for searching priority 2021-01-16 22:31:48 +08:00
1e309e570d Merge branch 'master' into develop 2021-01-16 20:42:44 +08:00
8362322d63 Merge pull request #1129 from eyasliu/develop-ghttp-wrap-std-handler
add util: WrapF and WrapH to transform net/http handler to ghttp.HandlerFunc
2021-01-16 20:41:57 +08:00
aefa54f04b improve package gredis 2021-01-16 20:37:59 +08:00
2c5e6b379f improve package gres 2021-01-16 20:20:30 +08:00
c20f3f0595 add Wrapf and WrapH to transform net/http.HandlerFunc and net/http.Handler to ghttp.HandlerFunc 2021-01-16 17:53:26 +08:00
5b17108f71 trigger CI 2021-01-15 18:43:28 +08:00
1fee3eb5f0 fix review change 2021-01-15 13:58:16 +08:00
bc4d84b60f improve comment for package gtime 2021-01-14 00:27:01 +08:00
6a67dceca7 Merge pull request #1092 from tiansin/master
feat: 🎨 some time features.
2021-01-14 00:15:44 +08:00
9c8a68f742 add MarshalJSON for package gerror 2021-01-14 00:05:15 +08:00
2d67d31f90 improve benckmark for package grand 2021-01-13 23:38:10 +08:00
c1b52e0f35 add more unit testing cases for package gredis 2021-01-13 20:00:31 +08:00
55a7c01f73 feat: 🚑 Add function comment 2021-01-13 16:14:21 +08:00
6cf48f9479 improve package gstr 2021-01-13 10:56:17 +08:00
f9905f2bb5 gofmt code 2021-01-12 19:09:45 +08:00
c07c74bf1b fix lint 2021-01-12 19:01:33 +08:00
14536e9abc add http client middleware feature 2021-01-12 18:08:50 +08:00
73c68e48a1 improve package gvalid 2021-01-12 10:46:39 +08:00
a9aa021914 add json tag for configuration struct for package gdb/gredis/ghttp/glog/gview 2021-01-12 00:42:33 +08:00
2ae32ed2c2 add QueryTimeout/ExecTimeout/TranTimeout/PrepareTimeout for package gdb 2021-01-11 20:48:35 +08:00
8ee3793f8f add SessionCookieMaxAge configuration for ghttp.Server 2021-01-11 20:06:09 +08:00
6f5b0c393e add more unit testing case for package gdb 2021-01-11 19:30:22 +08:00
a4152347e5 improve comment for package ghttp 2021-01-10 23:37:20 +08:00
bb2dad6d5e improve package gdb of empty value handling for struct convertion 2021-01-09 23:02:16 +08:00
92b791eb08 improve Struct convertion for package gdb; improve IsNil function for package internal/empty 2021-01-09 21:05:47 +08:00
8365ce9d29 change name *Case to Case* for case functions of package gstr 2021-01-08 16:24:08 +08:00
e141b8e098 shutdown server gracefully when reveiving TERM signal 2021-01-08 00:58:58 +08:00
c7ce8cf943 fix issue in resource searching for package gcfg 2021-01-08 00:39:52 +08:00
788ade2db0 improve package gres 2021-01-07 19:34:46 +08:00
a9f332fdd6 version updates 2021-01-07 13:00:53 +08:00
c6f1ae9426 add file name configuration from command line or environment for package gcfg 2021-01-07 01:17:03 +08:00
b12c909fd6 add logging level configuration for package ghttp 2021-01-06 01:00:49 +08:00
1a62f22a5b Merge branch 'master' into develop 2021-01-06 00:39:54 +08:00
5c2574da7c improve package ghttp 2021-01-06 00:39:50 +08:00
9fbdb9712b improve package gtime 2021-01-04 19:50:44 +08:00
7bc42e6eaa improve Fields filtering for package gdb 2021-01-04 19:46:46 +08:00
b6b1bc8813 improve time converting for package gconv 2021-01-04 19:22:55 +08:00
a62d2589bc improve time zone feature for package gtime 2021-01-04 16:33:33 +08:00
e4069bdb93 improve package gtime 2021-01-04 15:46:51 +08:00
1e100ac0ec improve package gtime 2021-01-04 15:43:54 +08:00
9d865e4ac6 improve package gtime 2021-01-04 15:32:55 +08:00
b3b1418e11 improve packge gi18n 2021-01-04 14:43:17 +08:00
3ab32faccc improve package gins 2021-01-04 14:15:42 +08:00
2eb09efc81 fix issue of data race in unit testing case for package gtime 2021-01-04 14:03:22 +08:00
dd2dfbf58d fix issue of data race in unit testing case for package gtime 2021-01-04 13:50:23 +08:00
d549311210 fix issue in uint testing case for package gdb 2021-01-04 13:04:57 +08:00
8a91592839 fix issue in eq for package gview 2021-01-04 00:05:02 +08:00
4d962c5aa5 improve packge gdb for treat int8 as int64 for pgsql 2021-01-03 23:44:44 +08:00
d9bd3153ea improve time parsing for package gtime 2021-01-03 23:37:45 +08:00
4991e14dff improve error message when failed in Mkdir 2021-01-03 12:05:04 +08:00
5629020538 fix issue in incorrect datetime string argument for oracle 2021-01-02 21:06:51 +08:00
361742c4a0 fix issue in incorrect datetime string argument for oracle 2021-01-02 20:31:25 +08:00
4272ac16c7 README updates 2021-01-02 15:12:08 +08:00
6c08d5fd81 fix issue missing build-in variable Request for template parsing of ghttp.Response 2021-01-02 01:53:36 +08:00
2a9c20bfa2 README updates 2021-01-02 01:24:42 +08:00
8dab319a7f README updates 2021-01-02 00:51:53 +08:00
5d01c9fff3 version updates 2020-12-31 00:27:42 +08:00
020b6bde68 README updates 2020-12-30 16:42:50 +08:00
036bc03ebf improve error handling for package gconv 2020-12-30 13:27:27 +08:00
86e70ad55c improve package gerror 2020-12-30 13:18:43 +08:00
bdf23ef48f fix issue of error code lost in middleware handling for package ghttp 2020-12-30 12:56:24 +08:00
820befa1a0 improve insert function for package gdb 2020-12-29 20:30:29 +08:00
0d5b93bd07 fix issue in incorrect parsing error message for gview 2020-12-29 19:43:25 +08:00
dbafe01064 feat: 🎨 some time features. 2020-12-29 18:05:00 +08:00
51d9f7ff12 fix issue in configuration string parsing error when there're special chars(especially '?') in redis password 2020-12-29 16:49:15 +08:00
4beeeb92ac improve gerror.Stack 2020-12-29 14:28:26 +08:00
662f1ed6b7 add Query/Exec/Prepare back for gdb.Link 2020-12-29 14:01:49 +08:00
05703ec3d7 improve ghttp.RouterGroup.ALLMap 2020-12-29 13:39:40 +08:00
bfab4a4952 comment updates for package gdb 2020-12-29 13:30:15 +08:00
9d25e17fcb readme updates 2020-12-29 09:09:12 +08:00
4828ddcdd7 add example/unit testing cases for package gdb 2020-12-29 00:01:27 +08:00
d25a3909d1 improve context feature for package gdb 2020-12-28 23:03:13 +08:00
695d333d2f add example cases for package gerror 2020-12-28 14:59:49 +08:00
5f28adec36 add benchmark testing case for package gerror 2020-12-28 13:43:17 +08:00
799e8214f8 Merge remote-tracking branch 'upstream/master' 2020-12-28 11:06:38 +08:00
c893817e56 Merge branch 'master' of https://github.com/gogf/gf 2020-12-27 00:12:34 +08:00
65785db659 improve Model.Data for shallow value copy for value type of map/slice 2020-12-27 00:11:26 +08:00
85a7723b13 Merge pull request #1084 from tiansin/master
feat: 🐛 fix GetWhereConditionOfStruct where AND
2020-12-25 20:36:54 +08:00
ac827d3154 revert default interval from 100ms to 50ms 2020-12-25 20:31:09 +08:00
95b09aa5fe feat: 🐛 fix GetWhereConditionOfStruct where AND 2020-12-25 16:03:01 +08:00
4e79b90863 add gutil.SliceToMap 2020-12-25 15:34:54 +08:00
306c02bcd4 fix issue for gfile.ReadLinesBytes, and improve callback function definition for gfile.ReadLinesBytes/ReadLines 2020-12-25 11:37:47 +08:00
fc66a0715a comment updates for package internal/empty 2020-12-25 01:44:07 +08:00
9c7aecf0fd Merge pull request #1058 from viken2/master
improve function empty
2020-12-25 01:38:33 +08:00
9f5a51e854 fix Strings/String function for package gvalid, issue:1077 2020-12-23 21:13:47 +08:00
a7f19e9e45 README updates 2020-12-23 20:23:11 +08:00
9b5862b61f README updates 2020-12-23 13:28:12 +08:00
176533e1a5 README updates 2020-12-23 13:26:33 +08:00
c243637d44 improve gstr.TrimStr/TrimLeftStr/TrimRightStr 2020-12-20 22:02:14 +08:00
7c52a6f9f6 ass SetCtx for ghttp.Request 2020-12-18 22:57:08 +08:00
446f8e7110 comment update 2020-12-16 01:15:22 +08:00
7db1cfa898 add gutil.MapToSlice/StructToSlice 2020-12-16 00:50:42 +08:00
9a6aa01115 constant name changes; version update 2020-12-15 20:16:17 +08:00
4a88e0255d improve shutdown feature for ghttp.Server 2020-12-15 19:24:38 +08:00
edc56949b7 improve package glog for rotation feature 2020-12-15 13:03:12 +08:00
63bc06d0fe improve package gview 2020-12-15 00:09:55 +08:00
9b58b66172 fix issue of HAVING statement before ORDER BY 2020-12-14 23:34:23 +08:00
3517295e96 improve package gcdm 2020-12-14 23:00:22 +08:00
c685876e6f improve package gparser 2020-12-14 21:22:04 +08:00
cb2c9c43a8 rename constant names 2020-12-14 19:34:02 +08:00
751a567e84 add Is* functions for package gvar 2020-12-14 18:54:14 +08:00
0a99bb9a7d improve gconv.Interfaces 2020-12-14 16:56:41 +08:00
a2e7aec37f change constant variable names 2020-12-14 13:26:48 +08:00
102e2d07d9 improve package gcfg for automatic configuration file type checks; change const variables for package gcfg/glog/gtimer/gmode/gins/gi18n 2020-12-14 13:02:08 +08:00
5400d22bc2 improve function empty 2020-12-12 21:57:07 +08:00
8d3fd21be5 Merge pull request #1 from gogf/master
merge master
2020-12-12 13:15:30 +08:00
bb39ed136f Merge branch 'fix/json' 2020-12-12 01:42:56 +08:00
363f6eba44 remove automatic stack content printing for error that has stack infomation 2020-12-11 01:12:53 +08:00
0ca305a1bf improve package gerror 2020-12-11 01:08:15 +08:00
1d1e64b834 improve package gerror 2020-12-11 00:45:15 +08:00
688e327f15 improve unit testing case for package ghttp 2020-12-10 23:38:59 +08:00
8c7ec0e7d9 Merge branch 'master' of https://github.com/gogf/gf 2020-12-10 23:33:43 +08:00
84fef8dea3 add error code feature for package gerror 2020-12-10 23:33:24 +08:00
c1d2ad68b3 Merge pull request #1051 from dozysun/master
fix InsertIgnore didn't work
2020-12-10 20:17:43 +08:00
a577605726 improve package gtimer 2020-12-10 20:10:07 +08:00
71444736ae fix InsertIgnore didn't work
fix InsertIgnore didn't work
2020-12-10 14:40:58 +08:00
b7e41ec32c improve package gvalid 2020-12-09 21:00:30 +08:00
7fa09596b0 improve package gsession 2020-12-09 16:22:03 +08:00
7316e6648f change errors to gerror; update copyright in comment 2020-12-09 16:04:29 +08:00
e9d346ce4f improve package glog 2020-12-09 13:54:27 +08:00
4b91e709f7 Merge branch 'master' of https://github.com/gogf/gf into develop 2020-12-09 13:48:50 +08:00
7de89286da Merge pull request #1045 from prcseraph/master 2020-12-09 13:48:33 +08:00
569a953b43 inprove package gconv for empty string converting to number array 2020-12-09 13:39:09 +08:00
1e7f795c69 remove package github.com/json-iterator/go 2020-12-09 01:38:56 +08:00
d2ae383b83 improve unit testing case for package gdb 2020-12-09 01:33:02 +08:00
8978112433 add gdb.Raw for raw sql instead of prepare argument feature 2020-12-09 01:29:23 +08:00
117eaea720 add support for cert and key file reading from resource manager for ghttp.Server 2020-12-09 00:06:56 +08:00
278e85357d * 日志根据大小切片时,文件重命名读写冲突。 2020-12-08 18:54:42 +08:00
60ec59fa4a improve package gsession 2020-12-07 20:39:52 +08:00
0aa82ad020 improve package gpool 2020-12-07 18:57:40 +08:00
7bd319ddc7 Merge branch 'master' of https://github.com/gogf/gf into develop 2020-12-07 13:19:42 +08:00
7ceb667486 Merge pull request #1040 from Wlvs530/master
Not Callback ExpireFunc In Pool.Get()
2020-12-07 13:18:48 +08:00
80c4786afd Not Callback ExpireFunc In Pool.Get() 2020-12-05 13:21:18 +08:00
2f741d3b24 add genv.SetMap 2020-12-05 00:06:03 +08:00
d2b65f0f91 add gcmd.GetWithEnv/genv.GetWithCmd; remove package cmdenv; 2020-12-04 23:44:54 +08:00
c226782f23 improve package gcmd,internal/cmdenv 2020-12-04 23:29:20 +08:00
57a82ebcc0 improve gconv.Struct 2020-12-04 18:17:11 +08:00
416885a726 gdb driver example updates 2020-12-04 15:42:35 +08:00
9b4d2d9172 fix issue in unit testing case for package gjson/gparser 2020-12-04 15:41:26 +08:00
d4b2bf20bb gdb driver example updates 2020-12-04 15:37:14 +08:00
ce9a0555c5 improve gconv.Interfaces by adding support for type map as its parameter 2020-12-04 14:33:47 +08:00
5171250a9d improve gutil.Keys,gdb.Model.Fields,internal/structs 2020-12-04 14:22:50 +08:00
80b629916a fix issue in function Clone for package gmap/garray/gtree 2020-12-02 21:38:29 +08:00
ecaf0da228 improve package glog; add more unit testing case for package gmlock 2020-12-02 21:33:07 +08:00
8c0a905a9f improve package gconv for custom type converting 2020-12-01 15:57:06 +08:00
5a0326f666 fix issue in unit testing case for package gconv 2020-11-30 09:07:44 +08:00
790a651ac1 fix typo 2020-11-29 23:55:32 +08:00
6f93bd17f2 add context feature for package gdb 2020-11-29 23:54:38 +08:00
3419d66c4b add context feature for package gdb 2020-11-29 23:50:16 +08:00
cabf684ec9 add context feature for package gdb 2020-11-29 23:47:57 +08:00
2b6e6ce28e improve update counter feature for package gdb 2020-11-29 22:26:16 +08:00
32101189a2 Merge branch 'master' of https://github.com/gogf/gf into develop 2020-11-29 21:46:36 +08:00
600c081801 Merge pull request #1028 from arieslee/gdb-counter
add update counter method for package gdb.
2020-11-29 21:46:17 +08:00
0899a9d49a Merge pull request #1027 from arieslee/gvalid-phone-loose
Add 172-segment verification rules, add loose mobile number verificat…
2020-11-29 21:45:28 +08:00
c56f4eabca inprove gconv.Interfaces for struct type 2020-11-29 21:34:28 +08:00
bfe89e0b12 add build-in fuction json for package gview 2020-11-28 22:48:01 +08:00
6cb38cfa92 add update counter method for package gdb. 2020-11-28 14:56:21 +08:00
09bb0c9397 更新gdb.Update方法 2020-11-28 13:52:17 +08:00
fa47b0306d Add 172-segment verification rules, add loose mobile number verification rules. 2020-11-28 12:23:18 +08:00
55429ad589 fix data race issue in unit testing case of package gdb 2020-11-28 00:11:22 +08:00
9592fb099f Change time string argument wrapping with TO_DATE function for DriverOracle in package gdb 2020-11-27 23:11:55 +08:00
18ec6116ad improve time argument timezone handling for package gdb 2020-11-27 22:51:34 +08:00
9d0f306684 improve time argument timezone handling for package gdb 2020-11-27 21:03:22 +08:00
3eba8d690f add TimeMaintainDisabled configuration for automatic time maintaining feature 2020-11-27 13:28:18 +08:00
c0b59007ce improve configuration for package gdb 2020-11-27 13:24:05 +08:00
3485ba2a5d improve package gtime 2020-11-26 22:40:55 +08:00
43ecfc7484 Merge branch 'develop' of https://github.com/gogf/gf into develop 2020-11-26 22:12:48 +08:00
5ba53e56c9 improve join feature for sub-query for gdb.Model 2020-11-26 22:11:58 +08:00
af1d14ace6 Merge pull request #1021 from tiansin/develop
fix: 🐛 fix model chunk page
2020-11-26 21:40:45 +08:00
c02bf715c5 improve gutil.ListItemValues/ListItemValuesUnique supporting retrieving values from slice attributes 2020-11-26 21:13:44 +08:00
0c0e902b07 if CreatedAt/UpdatedAt/DeletedAt field name configured, just use it, ignore the default field names 2020-11-26 20:17:24 +08:00
750b53d7aa improve debug infor for argument of time.Time for package gdb 2020-11-26 19:53:44 +08:00
1d807c095a Merge branch 'master' into develop 2020-11-26 19:28:25 +08:00
69b5873bf9 fix: 🐛 fix model chunk page 2020-11-26 14:26:32 +08:00
60fc9b6417 add gerror.ApiCurrent impements for gerror.Error 2020-11-25 19:06:29 +08:00
0bc8944a08 change ghttp.NewClient to g.Client 2020-11-25 16:40:45 +08:00
33292f54e0 improve status handler by supporting multiple status handler for package ghttp 2020-11-25 16:37:41 +08:00
fc215ef0b2 add function ghttp.RouterGroup.ALLMap 2020-11-24 21:19:01 +08:00
65c67427d4 compatible with Case of https://github.com/pkg/errors 2020-11-23 16:32:57 +08:00
bc8142974f version update 2020-11-21 14:08:29 +08:00
fadb7a8f8f fix issue 1002 2020-11-21 13:20:32 +08:00
e1bfe90833 improve package gdb for structire retrieving in transaction operations 2020-11-21 12:24:32 +08:00
042dc0b33f improve package gdb for structire retrieving in transaction operations 2020-11-21 11:42:50 +08:00
8ca535dbf0 fix issue in session cookie feature 2020-11-21 11:18:21 +08:00
e20183e7a1 improve gutil.Keys/Values for embedded struct 2020-11-20 00:53:12 +08:00
df86ffb61e improve package glog for nil file pointer 2020-11-19 20:43:44 +08:00
bfcf133c91 improve sqlite.Open 2020-11-19 20:37:27 +08:00
24a377d3a8 fix issue in custom mapping for gconv.Struct 2020-11-19 14:52:19 +08:00
baf51bc68f merge develop 2020-11-18 10:57:14 +08:00
5f4b585164 version updates 2020-11-18 10:52:53 +08:00
17a11187b0 fix issue in gdb.Model.Fields 2020-11-18 00:32:09 +08:00
7caf7976cf add gdb.Model.Args 2020-11-18 00:16:34 +08:00
1a31792c14 add SpecialCharsMapOrStruct for package ghtml 2020-11-15 16:49:44 +08:00
d56eb49e41 improve performance for gconv.Struct/Structs using directly reflect set 2020-11-15 15:13:40 +08:00
a1236b5e16 donator updates 2020-11-15 11:08:26 +08:00
8f278be0dc improve build-in varables for view of ghttp 2020-11-14 10:24:06 +08:00
f8ab71e7f0 Merge branch 'master' of https://github.com/gogf/gf 2020-11-12 20:52:23 +08:00
9cca3a3ec1 version updates 2020-11-12 20:51:04 +08:00
97bcf2a438 Merge pull request #980 from lutherlau/patch-4
Update garray_sorted_str.go
2020-11-12 20:44:48 +08:00
85dd2e9f4f Merge pull request #978 from lutherlau/patch-1
Update gtimer_timer.go
2020-11-12 20:39:57 +08:00
23d62da87f Merge pull request #981 from lutherlau/patch-3
Update garray_sorted_int.go
2020-11-12 20:39:44 +08:00
b4d947fecd Merge pull request #979 from lutherlau/patch-2
Update garray_sorted_any.go
2020-11-12 20:39:17 +08:00
650c95af31 Merge pull request #982 from lutherlau/patch-5
Update gtree_btree.go
2020-11-12 20:38:51 +08:00
943116d495 appaned parameters to url if http method is GET for ghttp.Client 2020-11-12 20:09:05 +08:00
644df7c16e Merge branch 'master' of https://github.com/gogf/gf 2020-11-12 18:58:05 +08:00
638773b216 improve client dump for package ghttp 2020-11-12 18:57:18 +08:00
889e7914e2 Merge pull request #983 from coolhihi/master
Update gjson_api_new_load.go to make gjson work when sometimes the xml end with space or `\n`
2020-11-12 18:41:36 +08:00
68cc85f2b2 improve file extension handling for package glog 2020-11-12 18:38:58 +08:00
c273ce576b add default configuration for MaxOpenConnCount for package gdb 2020-11-10 21:19:15 +08:00
f8d57096a8 add slice parameter support for gdb.Model.Where 2020-11-10 13:43:12 +08:00
d7542e87ae improve gdb.Model.Count 2020-11-10 10:37:42 +08:00
b178210a31 fix issue in gconv.Map for embedded struct attributes converting 2020-11-10 09:53:12 +08:00
3e6a23b0e1 add more unit testing case for package gview 2020-11-08 18:01:09 +08:00
ee8d2afe58 add build-in function map/maps for package gview 2020-11-08 17:11:04 +08:00
11e102e137 fix issue in internal/structs.MapField 2020-11-08 16:21:09 +08:00
e06b62ecf2 add default value from struct tag for ghttp.Request 2020-11-08 15:44:04 +08:00
d178102f82 remove third party package 'structs'; improve performance for package internal/structs 2020-11-08 14:25:17 +08:00
e1dd5cce7d improve performance for gconv.Struct 2020-11-08 00:06:05 +08:00
1edc1f35fb add individual cache for package gdb/gfile 2020-11-07 20:00:35 +08:00
4df47be521 Make it work when the xml content end with \s* 2020-11-07 18:32:50 +08:00
9cb88bca5a improve fields quoting for gdb.Model 2020-11-06 21:32:10 +08:00
fa8cc1d3f4 improve gutil.Keys 2020-11-06 21:21:09 +08:00
9ae8a7ca33 improve Fields/FieldsEx by adding support for map/struct parameters for gdb.Model 2020-11-06 20:52:16 +08:00
f4da179140 there should be WHERE statement in Update/Delete operations 2020-11-06 00:00:41 +08:00
13330658cb add function Keys/Values for package gutil 2020-11-05 23:32:56 +08:00
9f04e46166 mark gconv.StructDeep/StructsDeep deprecated 2020-11-05 23:02:29 +08:00
1072ea3fb0 Update gtree_btree.go
bugfix: avoid overflow
2020-11-05 22:44:09 +08:00
ea9e8055a4 Update garray_sorted_str.go
bugfix: avoid overflow
2020-11-05 22:42:15 +08:00
784abf2a30 Update garray_sorted_int.go
bugfix: avoid overflow
2020-11-05 22:41:43 +08:00
ed4a70deff Update garray_sorted_any.go
bugfix: avoid overflow
2020-11-05 22:37:36 +08:00
fef20d10a2 Update gtimer_timer.go
bugfix: avoid overflow
2020-11-05 22:33:33 +08:00
176dcdc7cc fix issue in gconv.Struct for json string parameter 2020-11-05 22:19:34 +08:00
12ed05f846 improva package internal/empty by adding more common types assertion 2020-11-05 20:40:34 +08:00
5999f22f76 fix issue in embeded struct validation for package gvalid 2020-11-04 20:04:54 +08:00
c056fd2a06 improve word quoting for function FieldsEx 2020-11-04 19:53:50 +08:00
cb422f043e improve slice converting for package gconv 2020-10-30 22:26:26 +08:00
4ae89dc9f6 improve package internal/structs 2020-10-30 22:04:34 +08:00
4f6f07db1d temporaryly remove guid.N 2020-10-30 14:31:31 +08:00
cd981c7294 improve snowflake number generating for package guid 2020-10-30 12:47:39 +08:00
557d2967fa improve snowflake number generating for package guid 2020-10-30 12:40:35 +08:00
a7a70636dd improve snowflake number generating for package guid 2020-10-30 12:33:56 +08:00
2215661f89 comment update for package guid 2020-10-30 12:24:18 +08:00
a22b590b43 comment update for package guid 2020-10-30 12:22:09 +08:00
1b0b209662 add unique number generating for package guid 2020-10-30 12:11:21 +08:00
2a2761c54f donator updates 2020-10-29 21:11:52 +08:00
1c83d72f39 donator updates 2020-10-28 23:54:40 +08:00
fcea774b59 donator updates 2020-10-28 23:34:19 +08:00
da2ec21571 fix issue 2020-10-27 10:41:18 +08:00
ebb8d8a2f7 fix issue in 2020-10-27 10:40:47 +08:00
9706a9c768 version updates 2020-10-26 21:20:34 +08:00
cee67a8d4e improve urlencoding handling for parameters posted along with file uploading 2020-10-26 20:21:09 +08:00
87650557fd remove debugging codes from package gtime 2020-10-26 19:06:27 +08:00
d3bf52f12f fix issue in unit testing case for package gi18n 2020-10-26 19:00:11 +08:00
6b13a4849b improve package gi18n 2020-10-25 17:33:14 +08:00
8e380c0d9d improve package gtime/gconv for map converting 2020-10-25 11:33:30 +08:00
0caf4bfcec improve gconv.StructDeep 2020-10-25 10:47:47 +08:00
9c3b978b50 improve package ghttp and internal/structs 2020-10-22 15:16:31 +08:00
ab689a7792 improve gutil.Dump 2020-10-22 09:24:57 +08:00
846646d92d improve json validation rule for package gvalid 2020-10-22 09:11:38 +08:00
2eb2b89432 improve gconv.Struct* by doing the converting using json.Unmarshal if given params is json string/bytes 2020-10-21 14:09:16 +08:00
43441a8218 allow custom validation rule validate empty or nil values 2020-10-21 00:08:36 +08:00
561a541fa1 add custom CreatedAt/UpdatedAt/DeletedAt filed name configuration for package gdb 2020-10-20 21:01:39 +08:00
ffe9ecc141 improve package internal/empty 2020-10-20 14:07:01 +08:00
77f7884604 add function gutil.Try/g.Try;improve error string for gconv.Struct 2020-10-20 13:36:43 +08:00
0a203d1e22 fix issue in struct converting for ghttp.Request 2020-10-19 11:29:41 +08:00
f4f4550483 improve package gerror 2020-10-18 20:18:55 +08:00
e87226a092 improve package gerror 2020-10-18 11:29:09 +08:00
391a3ec9bd version update 2020-10-18 11:26:19 +08:00
dd5cd31ef5 add automatic data key to field name mapping feature for package gdb 2020-10-17 18:16:13 +08:00
de92e804fe Merge branch 'master' of https://github.com/gogf/gf 2020-10-17 17:17:27 +08:00
7725d9aaaf add Current/Next function for package gerror 2020-10-17 17:17:10 +08:00
bd3e25adea Merge pull request #946 from yuancjun/patch-1
Update ghttp_server_config.go
2020-10-15 20:41:07 +08:00
0b1d49af4b upgrade fsnotify to v1.4.9 2020-10-15 20:14:35 +08:00
7efa9e351e remove default initialization function and add lazy initialization feature for package gfsnotify 2020-10-15 20:07:21 +08:00
0b0141954b Update ghttp_server_config.go 2020-10-15 18:04:32 +08:00
82b531fbfb add domain support for domain of ghttp.Server 2020-10-14 21:18:11 +08:00
67fb626339 add configuration SessionCookieOutput for ghttp.Server 2020-10-14 20:52:26 +08:00
9044d5f05d fix issue in custom session id lost for ghttp.Request 2020-10-13 20:34:31 +08:00
47663aa1f1 fix issue of EOF in ghttp.Request when no data posted using form-data 2020-10-13 20:12:54 +08:00
63c0aab19c improve package gtime 2020-10-12 23:32:32 +08:00
261216f5e4 improve structure sql for package gdb 2020-10-12 23:22:56 +08:00
f88b799d67 add more unit testing case for package gdb 2020-10-11 22:21:03 +08:00
9c48dd172c add auto-json support for slice/struct attribute for data inserting of package gdb 2020-10-10 17:29:38 +08:00
09ce105eee improve gdb.Model.Fields/FieldsEx for package gdb 2020-10-10 14:00:10 +08:00
651aa895f8 improve function addWordBoundariesToNumbers for package gstr 2020-10-10 13:38:28 +08:00
0509e41198 recover number for unit testing case of package gconv 2020-10-10 00:04:55 +08:00
1b40d6a53a do tx.Rollback if there's panic in gdb.Transaction 2020-10-09 23:42:33 +08:00
f9189d48d1 remove type ValueFunc from package gcache 2020-10-09 23:36:39 +08:00
849874a247 improve adapter definition for package gcache 2020-10-09 20:59:49 +08:00
3f6510bae7 fix issue in gconv.Struct 2020-09-29 23:47:37 +08:00
a585a26c39 improve custom rule function type for package gvalid 2020-09-29 23:25:20 +08:00
9943966a86 improva function formatSql for package gdb 2020-09-29 22:53:44 +08:00
3617e51c01 improve gdb.Model.ScanList 2020-09-28 23:52:02 +08:00
c931032f08 comment update for gdb.Model.Unscoped 2020-09-27 23:37:40 +08:00
37b286eaa4 improve performance for gconv.Maps;comment update for package gcache 2020-09-27 22:35:02 +08:00
619287c273 improve cache feature for package gdb 2020-09-27 00:15:11 +08:00
aeb9b68298 improve adapter feature for package gcache 2020-09-26 22:44:07 +08:00
bae8f6315b comment updat 2020-09-26 21:13:09 +08:00
a6f70f8935 comment updat 2020-09-26 21:00:28 +08:00
acca6f4009 add adapter feature for package gcache 2020-09-26 20:47:29 +08:00
727fdd2391 improve unit testing case for association feature for package gdb 2020-09-25 08:33:22 +08:00
1d174e00c0 improve package internal/intlog 2020-09-24 23:46:19 +08:00
a5e3e2f5ba change g.SetDebug function to control the debugging information for framework 2020-09-24 23:40:44 +08:00
da43c2d52f improve example for package gview 2020-09-22 20:12:34 +08:00
262f27748c improve custom validation rule feature for package gvalid 2020-09-22 08:45:22 +08:00
a29aef7e1c improve package gvalid for custom rule 2020-09-21 23:51:30 +08:00
1671391195 comment updates 2020-09-21 22:56:48 +08:00
28b0d59c61 improve package gcfg/gjson for data loading 2020-09-21 21:30:58 +08:00
86433cef25 improve gtime.New, gconv.String 2020-09-18 23:59:49 +08:00
e96ccd5f71 v1.13.6 2020-09-17 23:49:03 +08:00
50a087bb3d Merge branch 'master' of https://github.com/gogf/gf 2020-09-17 23:41:23 +08:00
1ec049c52f improve gf server for routes check while starting 2020-09-17 23:27:10 +08:00
ec38805542 Merge pull request #908 from cai1111/patch-2
Update gdb_driver_mssql.go
2020-09-17 19:23:25 +08:00
4c8517d075 Update gdb_driver_mssql.go 2020-09-17 11:06:24 +08:00
edf06da6ea add struct which implements Interfaces function parameter support for gdb.Model.Insert/Save 2020-09-13 11:21:10 +08:00
eb43a2040e add ghttp.Client.RedirectLimit and gfile.ScanDirFileFunc 2020-09-09 22:26:46 +08:00
9d0ecc7d3e add more unit testing case for package gdb 2020-09-07 20:25:59 +08:00
ad943c5e02 improve gjson.New by using gconv.MapDeep for map/struct 2020-09-07 19:44:11 +08:00
bdb4fd0d25 donator updates 2020-09-07 19:10:04 +08:00
2440e05457 fix issue in limit operations for database driver oracle 2020-09-03 22:38:07 +08:00
1337c6c0d1 add sub query sql support for join functions 2020-09-03 21:57:58 +08:00
957689e07c up 2020-09-02 23:22:16 +08:00
3952d74f87 up 2020-09-02 21:36:21 +08:00
6dc4b81693 add max recursive depth for directory scanning for function gfile.Scan* 2020-09-02 21:25:02 +08:00
9cd953b7be improve function FieldsEx by filtering fields from custom fields specified by function Fields for package gdb 2020-09-02 20:37:02 +08:00
631810dda2 add function String for package gmap 2020-09-02 19:53:58 +08:00
8c12bc5506 change panic to internal logging for package glog 2020-09-01 21:22:19 +08:00
d4091a4826 improve some transaction operations by directly calling model operations, making their implements logic the same 2020-08-31 15:57:04 +08:00
a7c269886b improve support for dynamic database configurations in codes 2020-08-31 15:39:27 +08:00
f54593037b improve CURD functions for package gdb 2020-08-31 00:59:42 +08:00
0415cf6a08 fix issue in nil gtime attribute for model entity for package gdb 2020-08-31 00:39:12 +08:00
87c22d32b0 version updates 2020-08-26 14:49:53 +08:00
27dd15b403 improve initialization for logger of package glog 2020-08-26 14:37:02 +08:00
dd452c19ce add example for custom uploading file name for ghttp.Server 2020-08-24 23:05:30 +08:00
acc0846cf3 fix issue in unit testing case of package gvalid 2020-08-24 22:26:12 +08:00
5a6738841f travis ci update 2020-08-22 00:21:24 +08:00
bea451c9d6 improve date type support for package gdb; improve datetime string for gtime.StrToTime; improve function gtime.New for more types 2020-08-21 23:41:12 +08:00
676e904ec6 improve package gvalid 2020-08-21 00:00:00 +08:00
49aa5c61bc improve package gvalid 2020-08-20 23:37:02 +08:00
a2272b852c improve package gvalid 2020-08-20 23:28:58 +08:00
1fa77630f9 improve package gvalid 2020-08-20 23:28:10 +08:00
a841c4cc05 improve package gvalid 2020-08-20 23:25:36 +08:00
1874808e3b improve unit testing case for package gcache 2020-08-19 21:37:26 +08:00
149b67916b README updates 2020-08-19 21:10:40 +08:00
7fb6f58162 README updates 2020-08-19 21:09:25 +08:00
a309114a18 donator updates 2020-08-15 21:58:03 +08:00
35cbde9530 comment update for package gstr 2020-08-15 21:28:24 +08:00
b9211b182a comment update for function ghttp.Request. 2020-08-15 12:35:56 +08:00
81ec499ae9 Merge pull request #867 from pingyeaa/master
Solve the problem of invalid modification of request parameters
2020-08-15 12:33:24 +08:00
f2e276eabd add function Test_Params_Modify for ghttp_unit_param_test.go 2020-08-14 20:02:52 +08:00
f6dbaba1f8 add function ReloadParam for ghttp_request.go 2020-08-14 18:34:43 +08:00
65dcff052a add function ReloadParam for ghttp_request.go 2020-08-14 18:19:48 +08:00
e3861567c7 add function ReloadParam for ghttp_request.go 2020-08-14 16:22:37 +08:00
e89a20c725 add ReloadParam func to ghttp_request.go 2020-08-14 15:19:56 +08:00
a8acc6bd28 update unit testing case for package gdb 2020-08-14 00:51:22 +08:00
eb5efc735e improve unit testing case of ScanList for package gdb 2020-08-13 23:45:22 +08:00
737af527cd improve *Struct functions for ghttp.Request 2020-08-13 23:29:00 +08:00
875d2b7e63 donator updates 2020-08-13 19:25:51 +08:00
bf1cb0e1bd donator updates 2020-08-13 19:23:31 +08:00
2bfeb1b06c README updates 2020-08-13 18:59:13 +08:00
820e4302b7 improve function *Struct for ghttp.Request 2020-08-13 18:51:59 +08:00
84d761b418 add function AddWithRecover for package grpool 2020-08-12 23:53:05 +08:00
e5e27f2ac4 add function GetRouterMap for ghtt.Request 2020-08-12 21:01:17 +08:00
efca9b18a8 improve content type checks for package gjson 2020-08-12 20:53:47 +08:00
607821ecbc add function LoadContentType for package gjson 2020-08-12 20:38:48 +08:00
7cc1b239d4 add functions Update/UpdateExpire/GetExpire for package gcache 2020-08-12 20:13:13 +08:00
efa8de34da Merge pull request #860 from XWR940711/master
add func gcache.SetVar/gcache.SetExpire/gcacge.GetExpire.
2020-08-12 19:19:19 +08:00
bcf45e3c5a CI-glog失败重测 2020-08-12 10:32:40 +08:00
0a3cd1d2ab 修正方法代码.使用Benchmark测试. 2020-08-12 09:57:47 +08:00
3e621856c8 change the port range for unit testing cases of ghttp.Server 2020-08-12 09:10:50 +08:00
32e4d64ddb improve package gjson for automatic content type checking 2020-08-12 00:11:25 +08:00
46e45ca84b improve package gjson for automatic content type checking 2020-08-11 23:46:21 +08:00
fcb13bd8ee improve package gjson for automatic content type checking 2020-08-11 23:36:40 +08:00
eacad9b453 improve package gjson for automatic content type checking 2020-08-11 23:22:09 +08:00
ed479e2a13 improve package gjson for automatic content type checking 2020-08-11 23:20:22 +08:00
19937cb75d improve MapDeep for package gconv 2020-08-11 20:13:47 +08:00
a95093222c add GetRemoteIp for ghttp.Request; add *Var feature for ghttp.Client 2020-08-11 15:23:42 +08:00
7b599d1882 Merge branch 'master' of https://github.com/gogf/gf 2020-08-10 23:04:28 +08:00
4d501fd2f4 improve function Set for package gjson 2020-08-10 23:03:35 +08:00
c3d3053ded improve GetOrSetFunc for package gcache 2020-08-09 21:28:31 +08:00
14d5fd3e11 add translation format feature for package gi18n 2020-08-08 16:46:52 +08:00
9f79453334 improve ghttp.Server by closing the request and response body to release the file descriptor in time 2020-08-08 11:09:58 +08:00
c7f1c881c0 Merge pull request #850 from coderzhuang/master
fix: Access-Control-Request-Headers
2020-08-08 09:59:45 +08:00
c39c032b4e Merge pull request #844 from qinyuguang/scan
gcmd.Scan supports read line that contains whitespace
2020-08-08 09:58:32 +08:00
fa96c18308 add function MapOmitEmpty for package gutil 2020-08-08 09:53:32 +08:00
d90145a47f add goroutine id retrieving feature for package gdebug 2020-08-08 09:42:24 +08:00
4871f86346 adjust TestCache_Expire_SetVar Test Code. 2020-08-07 16:26:26 +08:00
919eaf1e9a adjust TestCache_Expire_SetVar Test Code. 2020-08-07 14:05:21 +08:00
8a84ca16d1 add func gcache.SetVar/gcache.SetExpire/gcacge.GetExpire.
add test TestCache_Expire_SetVar.
2020-08-07 13:24:41 +08:00
12b4fdd692 fix: Access-Control-Request-Headers 2020-08-04 11:57:42 +08:00
3d8451d5d0 comment update for gdb.Model.Page 2020-08-04 09:22:21 +08:00
cf88f28519 gcmd.Scanf supports read line that contains whitespace 2020-08-03 21:00:02 +08:00
15d99eee46 add more unit testing case for ghttp.Server 2020-08-03 20:49:19 +08:00
6d68277db8 improve cookie feature for ghttp.Server 2020-08-03 20:00:00 +08:00
3e3b5557f7 readme updates 2020-08-03 18:58:43 +08:00
ba1a9d9f8e gcmd.Scan supports read line that contains whitespace 2020-08-01 02:13:42 +08:00
3e1a7953ec Merge branch 'master' of https://github.com/gogf/gf 2020-07-31 09:57:45 +08:00
073fb2d717 improve sql logging structure for package gdb 2020-07-31 09:57:26 +08:00
7f33021184 Merge pull request #825 from chenall/gjson-support-utf8-with-bom
fix configfile with UTF8-BOM issue
2020-07-31 00:08:05 +08:00
b396096721 improve dry-run feature by adding global dry-run variable reading from environment or command options 2020-07-30 23:08:27 +08:00
0a5c6d832f add configration group name for logging content for package gdb 2020-07-30 23:00:20 +08:00
d279566114 Merge pull request #769 from fxk2006/master 2020-07-30 22:55:39 +08:00
2693cbb136 add more unit testing case for ghttp.Server 2020-07-30 22:45:50 +08:00
f7a9be4292 improve package glog for rotation feature 2020-07-30 21:09:45 +08:00
a926033b66 move Separator from const to variable for package gfile 2020-07-30 20:57:08 +08:00
dbcdd06b19 Merge branch 'master' of https://github.com/gogf/gf 2020-07-30 20:49:32 +08:00
ff5dab5c70 improve package glog for rotation feature 2020-07-30 20:49:11 +08:00
84b576418f Merge pull request #835 from XWR940711/master
add func gtimer.Entry.Reset()
2020-07-30 20:20:50 +08:00
253b124903 fix issue in database configuration for package gind 2020-07-30 20:18:18 +08:00
33dc5ddf79 fix issue in database configuration for package gind 2020-07-30 18:52:27 +08:00
a456fa537c fix logger configure issue for package gdb 2020-07-30 17:16:29 +08:00
9e1fb93e08 adjust gtimer.Entry.Reset() Test Code. 2020-07-30 11:00:19 +08:00
5d24f702be adjust gtimer.Entry.Reset() Test Code. 2020-07-30 10:37:48 +08:00
ca8e2c2986 version updates 2020-07-29 23:19:59 +08:00
2f0e5a45c5 improve package gcron 2020-07-29 23:03:31 +08:00
c4b28b0bc4 improve gtime.ParseDuration 2020-07-29 11:44:58 +08:00
6cc4747965 add func gtimer.Entry.Reset() 2020-07-29 11:22:46 +08:00
91cd34b26a improve multiple seperator chars handling for router of ghttp.Server 2020-07-29 00:32:54 +08:00
e35a2f028c add timeout feature for Do/Receive functions of package gredis 2020-07-28 23:48:12 +08:00
9cff2bd10f add function ParseDuration and time unit 'd' support for package gtime 2020-07-28 22:46:15 +08:00
6d406498db improve result data type converting for package gdb 2020-07-28 20:31:50 +08:00
939ae37baf example codes update for package gdb 2020-07-28 19:55:13 +08:00
4d6c8744e5 upgrade mxj 2020-07-25 15:31:51 +08:00
e252d8b740 add function ListItemValuesUnique for package gdb 2020-07-25 15:05:08 +08:00
9b8d63e21b improve graceful reload feature for ghttp.Server 2020-07-25 14:09:03 +08:00
437fc04620 improve testCfg_With_UTF8_BOM unit_test 2020-07-25 14:07:33 +08:00
04dee090a3 improve graceful reload feature for ghttp.Server 2020-07-25 13:50:04 +08:00
245c6d24a1 improve ghttp.Client 2020-07-25 11:24:35 +08:00
e92fd05f9f Merge pull request #815 from tikrgo/camelcaseConvert 2020-07-25 11:07:51 +08:00
937f8e6919 fix configfile with UTF8-BOM issue 2020-07-25 10:57:40 +08:00
f489e6273e fix issue 819 2020-07-25 10:54:48 +08:00
4f99bdbc87 Merge branch 'master' of https://github.com/gogf/gf into camelcaseConvert 2020-07-24 09:49:53 +08:00
1250b33220 将正则移到全局提高效率 2020-07-24 09:48:51 +08:00
b57aee4595 Merge pull request #800 from chenghonour/master
Add database method
2020-07-23 21:30:24 +08:00
d9da51933d improve gconv.Struct 2020-07-23 21:15:54 +08:00
9fca93e7d8 Merge branch 'master' of https://github.com/gogf/gf 2020-07-23 21:01:37 +08:00
854b2ed185 improve function convertValue for package gdb 2020-07-23 21:01:16 +08:00
cfac03bc40 Merge pull request #814 from xbkaishui/support-redis-tls
support redis tls
2020-07-22 19:49:29 +08:00
a3cb4a6ae8 驼峰转换下划线时,不连续大写字母首位加下划线规范 2020-07-22 16:15:06 +08:00
2798fa4444 revert unit test 2020-07-22 15:27:00 +08:00
8bac0614f5 format code 2020-07-22 15:13:40 +08:00
646280a6a9 remove tls unit test case 2020-07-22 15:08:32 +08:00
208bdffdf7 update comment 2020-07-22 14:02:21 +08:00
9e7291903f support redis tls 2020-07-22 13:28:45 +08:00
d56835fc00 go fmt 2020-07-21 13:28:25 +08:00
1d5e717a80 update err return 2020-07-21 12:40:13 +08:00
2f44d9ae18 add unit test 2020-07-21 12:37:04 +08:00
0627ab81d6 Merge pull request #810 from chenall/master
fix ghttp_client upload filename issue #809
2020-07-21 10:52:39 +08:00
8167a398fc add function GetHeader for ghttp.Request 2020-07-21 10:17:31 +08:00
6291751014 fix ghttp_client upload filename issue #809 2020-07-21 09:57:13 +08:00
ee5ddaab52 fix place holder for pgsql 2020-07-20 22:47:12 +08:00
207476be1f Merge pull request #807 from tiancai45/master
fix issue pq: syntax error at or near $
2020-07-20 22:15:20 +08:00
b9b470c2ae Merge branch 'master' into master 2020-07-20 22:14:29 +08:00
52b6e8ef9d fix place holder for mssql 2020-07-20 21:55:34 +08:00
48c84bf74a fix place holder for mssql 2020-07-20 21:48:44 +08:00
5be30b3684 fix issue in logging file rotation 2020-07-20 21:32:28 +08:00
54a2b13825 Merge pull request #802 from csrgxtu/bug/log-file-rotate
bug/log-file-rotate: fix big file even with rotate-by-size and rotate…
2020-07-20 21:30:52 +08:00
d44ddae3dc debug postgre 2020-07-20 19:13:15 +08:00
7bbc2459ba postgre 报错 pq: syntax error at or near $ 2020-07-19 23:24:35 +08:00
0cb77caa2a Merge pull request #803 from housemecn/master
update tencent site
2020-07-18 10:40:18 +08:00
3f5f76458d Update README_ZH.MD
update tencent site
2020-07-18 10:36:48 +08:00
835e07e8de Update README.MD
update tencent site
2020-07-18 10:34:32 +08:00
3fc5e43abe readme update 2020-07-18 10:21:17 +08:00
9c8cb26bd6 readme update 2020-07-18 10:17:05 +08:00
540f4d2d0c donation update 2020-07-18 10:06:26 +08:00
51be255821 remove gfcache usage from repo 2020-07-18 09:44:15 +08:00
7d278fea25 users update in readme 2020-07-18 09:40:39 +08:00
ca72d3b23a remove gfcache usage from repo 2020-07-18 08:32:35 +08:00
e3b8f374e5 Merge pull request #1 from gogf/master
pr from gf
2020-07-17 16:27:51 +08:00
534cd3be1c add table field method 2020-07-17 14:28:50 +08:00
78536de1b5 add database method 2020-07-17 11:28:47 +08:00
edc67d9ec3 bug/log-file-rotate: fix big file even with rotate-by-size and rotate-back-expire 2020-07-17 10:39:14 +08:00
4dd12434b7 add file cache feature for package gfile and remove package gfcache 2020-07-16 12:31:13 +08:00
f654bb2eda comment update for package gtree 2020-07-16 11:46:11 +08:00
205f98cfeb improve gconv.Struct for interface UnmarshalValue 2020-07-15 23:30:07 +08:00
69fa5bf464 improve package gtime for nil gtime.Time object 2020-07-15 20:37:13 +08:00
e7dc58ac6c unit testing case update for package gdb 2020-07-15 20:21:04 +08:00
2033299632 improve placeholder for pgsql 2020-07-15 20:15:09 +08:00
639d34d5d9 fix issue in incorrect debug sql information for package gdb 2020-07-15 20:10:54 +08:00
605181da32 fix issue in gins.Database 2020-07-15 19:17:42 +08:00
183f631190 improve Model.One for package gdb 2020-07-15 09:15:03 +08:00
64c99b9871 add configuration updating feature for package gcfg 2020-07-15 00:07:07 +08:00
d29b0a27ff Merge pull request #760 from kirileec/master
add a SetProxy function and a chaining function Proxy for ghttp.Clien…
2020-07-14 23:09:06 +08:00
aaa726e6dc add limit 1 for function One of package gdb 2020-07-14 21:42:28 +08:00
05cc0c4644 improve gconv.Struct for nil attribute interface 2020-07-14 21:34:29 +08:00
e1c0a92e60 improve the performance when converting struct that implements UnmarshalValue 2020-07-13 23:51:36 +08:00
c770e4779a Merge pull request #758 from wnstar/log
log added function name display
2020-07-13 23:21:49 +08:00
c135122ca1 improve package gconv for detailed handling of interface attributes 2020-07-13 23:13:50 +08:00
1d87df2afe add more unit testing case for package ghttp 2020-07-13 22:45:20 +08:00
8efc0ca0ea comment update for package gvalid 2020-07-12 10:33:24 +08:00
001d524ff7 readme update 2020-07-12 10:25:15 +08:00
5c5dce9dc3 comment update for admin controller of package ghttp 2020-07-12 09:56:07 +08:00
293256c2ca improve package gmode 2020-07-12 09:34:43 +08:00
4e027c1de3 improve argument handling for empty slice for package gdb 2020-07-11 09:53:16 +08:00
6712a33164 fix issue 785 in function Unique for packge garray 2020-07-10 22:26:02 +08:00
98531143a6 donator updates 2020-07-10 21:32:53 +08:00
71127ba308 improve package gins 2020-07-10 00:20:46 +08:00
0f6f571ccb remove the space trimming of the validation value for package gvalid 2020-07-08 20:53:56 +08:00
9b6936a4fb deprecate function DB.Table; improve the configuration node name case-insensitive and ignoring special chars 2020-07-08 20:48:29 +08:00
8b78609412 add more unit testing case for package gdb 2020-07-08 19:12:48 +08:00
4a31082f8c improve function Struct/StructDeep for package gconv 2020-07-08 11:32:35 +08:00
3643a69d8d improve function Struct/StructDeep for package gconv 2020-07-08 10:52:45 +08:00
adbaa4aa89 donator updates 2020-07-07 22:06:35 +08:00
0e025eda1b improve function Struct for package gconv 2020-07-06 22:37:37 +08:00
7c44bf8e94 Merge branch 'develop' of https://github.com/gogf/gf into develop 2020-07-06 21:18:51 +08:00
e6718f1113 improve function Struct for package gconv 2020-07-06 21:18:25 +08:00
f3f6adb03a read Client's timeout for net.Dialer
make sure Client.Transport is *http.Transport
2020-07-05 20:52:33 +08:00
977827e453 add examples for SetProxy function and Proxy chaining function 2020-07-05 20:52:33 +08:00
bcc9153991 add a SetProxy function and a chaining function Proxy for ghttp.Client to do HTTP request via proxy. #285 2020-07-05 20:52:32 +08:00
c04be14cd9 add custom validation rule feature for package gvalid 2020-07-05 18:55:38 +08:00
de8f29751d improve function ScanList for package gdb 2020-07-05 12:17:56 +08:00
12d58e4d08 add ScanList feature for gdb.Model 2020-07-05 11:54:37 +08:00
3ae44185f4 add ScanList feature for gdb.Result 2020-07-05 11:23:39 +08:00
1290f42f75 improving package gdb 2020-07-04 08:50:52 +08:00
17b91dcad7 add ListItemValues/ListItemValuesUnique functions and associated unit testing cases for package gutil/gvar 2020-07-02 23:40:34 +08:00
72da1642ee add more unit testing case for ghttp.Client 2020-07-02 19:12:01 +08:00
76d93b3a61 donator updates 2020-07-01 23:05:39 +08:00
7be0ee9566 donator updates 2020-07-01 23:02:07 +08:00
326e1f8da5 donator updates 2020-07-01 22:53:34 +08:00
e4e44ddd19 revert gvar.Var from interface to struct 2020-06-29 17:23:49 +08:00
46bdde9265 revert gvar.Var from interface to struct 2020-06-29 13:40:19 +08:00
09eba58927 add more unit testing case for ghttp.Client 2020-06-28 23:23:09 +08:00
0e884c78f5 fix issue of https://github.com/gogf/gf/issues/765 2020-06-28 23:03:41 +08:00
2f44721086 fix issue in reload feature in ghttp.Server 2020-06-28 20:52:33 +08:00
6e08eebcbe 修改sql打印debug信息,增加数据库配置的group名称,用于区分sql来源,尤其是多数据库配置的时候 2020-06-28 16:58:43 +08:00
d9422d00ac 修改sql打印debug信息,增加数据库配置的group名称,用于区分sql来源,尤其是多数据库配置的时候 2020-06-28 16:50:13 +08:00
efc0501548 Merge branch 'master' of https://github.com/gogf/gf 2020-06-22 21:56:29 +08:00
bb07c60838 rename CopySlice to SliceCopy for package gutil 2020-06-22 21:56:10 +08:00
330ea05ca3 Merge pull request #755 from wnstar/master
add SetRedirectLimit function to do HTTP client. #714
2020-06-22 21:21:05 +08:00
1f534b48a3 Merge pull request #757 from leoleoasd/patch-1
Fix typo in git ignore
2020-06-22 20:30:35 +08:00
aceae5eee3 add todo for package gpool 2020-06-22 20:08:27 +08:00
d4d66fd529 improve package gtime 2020-06-22 19:46:39 +08:00
b7686d6d37 log added function name display 2020-06-22 11:04:57 +08:00
Leo
b97e397354 Fix typo in gitignore 2020-06-22 09:41:02 +08:00
ab8fbf171e add SetRedirectLimit function to client 2020-06-21 19:17:39 +08:00
2c0cfa24b0 fix issue in package gjson for struct to map converting 2020-06-18 20:40:24 +08:00
f28a76d470 merge develop 2020-06-17 23:59:20 +08:00
f3525c84a3 fix issue in debug infor for soft deleting feature of package gdb 2020-06-17 23:47:47 +08:00
abe9b54112 embarrassing jsoniter of another incompatibility with stdlib json 2020-06-17 21:43:51 +08:00
b2aa59d893 import third-party library json-iterator to improve the performance for json operations 2020-06-17 21:16:25 +08:00
9e9865afa7 author updates 2020-06-17 18:58:24 +08:00
ecc439d4e8 author update 2020-06-17 14:44:16 +08:00
452f0fc99e add Scan/ScanDeep for package gvar 2020-06-17 11:40:37 +08:00
54f47845f6 entity feature developing for package gdb 2020-06-17 11:37:45 +08:00
cb238cd6d9 add todo for gconv.Convert 2020-06-16 20:44:57 +08:00
897a9f4584 Merge branch 'develop' 2020-06-16 20:42:26 +08:00
55f9b121de Merge pull request #738 from fxk2006/fix_SessionRedis 2020-06-16 20:41:53 +08:00
386f38af5e improve gconv.Struct 2020-06-16 20:18:40 +08:00
65cea430c2 improva gconv.Struct 2020-06-16 19:30:35 +08:00
4d38b508a3 improve gvar by changig gvar.Var from type struct to interface 2020-06-16 17:38:05 +08:00
5c774fd391 improve function Structs for package gconv 2020-06-16 11:37:00 +08:00
f6d760e90f 1、修复redis存储session时,最大过期时间问题: ttl.Seconds()返回float64在redis中报错 2020-06-16 11:19:08 +08:00
c3ffa40bad improve Response/ResponseWriter by implementing http.Flusher for package ghttp 2020-06-15 23:36:20 +08:00
5ce5d0e593 improve auto marshal for struct slice for package gredis 2020-06-15 23:19:38 +08:00
b83f1efde8 remove panic for stdout error for package glog 2020-06-15 22:57:27 +08:00
ca5f14c366 comment updates for package gtcp 2020-06-15 22:51:44 +08:00
95a8b51fb4 improve map slice converting for package gconv 2020-06-15 18:59:18 +08:00
2b64979730 Merge branch 'master' of https://github.com/gogf/gf 2020-06-15 16:48:17 +08:00
508cb7db88 add and improve Scan/ScanDeep feature for package gdb/gvar/gjson/gconv 2020-06-15 16:46:48 +08:00
e8d6d96883 fix issue in error field name lost for package gvalid 2020-06-14 17:28:48 +08:00
9378a6e7bf readme update 2020-06-13 16:22:49 +08:00
1d609fc5c7 fix issue in unit testing case for package ghttp 2020-06-13 14:52:36 +08:00
49d1e3dbaf fix issue of attribute name lost in package gvalid 2020-06-12 22:25:58 +08:00
b0e9334852 go.mod updates 2020-06-12 14:10:33 +08:00
95bd369959 improve function GetClientIp for ghttp.Request 2020-06-11 18:47:56 +08:00
a433890097 Merge pull request #721 from kuiye/master
add get client realIp
2020-06-11 18:45:42 +08:00
c9c3be517c fix issue in example of package glist 2020-06-11 18:43:35 +08:00
89e122cd31 marge getip func 2020-06-11 09:49:16 +08:00
27c2a03ea8 add example for package gset 2020-06-10 23:07:07 +08:00
b56eb3a948 example update for package garray 2020-06-10 19:50:22 +08:00
fb1b0bfd88 example update for package g/garray/gmap/gset/ghttp 2020-06-10 19:47:25 +08:00
dd10167ec2 example updates for package garray 2020-06-10 19:09:14 +08:00
3138ad10ec add get client realIp 2020-06-10 10:44:41 +08:00
080ca82605 release updates 2020-06-09 21:29:28 +08:00
0290de2360 improve dump feature for ghttp.Request 2020-06-09 20:46:04 +08:00
9b330adc1d Merge pull request #718 from sanrentai/master
improve mssql TableFields func
2020-06-09 19:04:56 +08:00
f3ff1ae08b improve example for package gmap 2020-06-09 16:24:54 +08:00
4f699af051 improve pointer type convertion for package gconv 2020-06-09 14:19:23 +08:00
7ebc7259cb improve mssql TableFields func 2020-06-09 14:02:43 +08:00
9d22edbdb8 donator updates 2020-06-08 23:08:58 +08:00
7e95058cb5 donator updates 2020-06-08 22:34:48 +08:00
f33753e0cd add example for package ghttp/glog 2020-06-08 20:21:35 +08:00
ac71e1d753 rename Dump to RawDump for ghttp.ClientResponse 2020-06-08 19:26:14 +08:00
8151b6efd6 add more example for package gredis 2020-06-08 19:17:24 +08:00
94de306c93 add zero time filtering for package gdb 2020-06-08 13:46:45 +08:00
51f8ea26de add example for package gredis 2020-06-06 18:12:42 +08:00
29d9bb17cd improve function Unscoped for package gdb 2020-06-06 16:28:16 +08:00
30501a882d improve function Struct for package gconv 2020-06-06 15:31:04 +08:00
f2f98e1d16 rename testing file names for package gdb 2020-06-06 14:38:05 +08:00
cbf465eeea improve body interface implements for ghttp.Reqest/Response 2020-06-06 13:34:58 +08:00
79c400e912 Merge branch 'master' of https://github.com/gogf/gf 2020-06-06 10:10:05 +08:00
cc4c49b5b0 add unit testing case for pointer attribute mapping for function Parse 2020-06-06 10:09:19 +08:00
96ea2c911d Merge pull request #696 from sanrentai/master
the sqlserver type money  should be converted to float64
2020-06-05 21:08:49 +08:00
131b11680a readme update 2020-06-05 20:36:05 +08:00
3c6ab96283 fix issue in function Walk and add more example for package gset 2020-06-04 21:46:22 +08:00
d2c4fa921a add more example for package gmap 2020-06-04 20:45:18 +08:00
dbb51a9328 improve package glist 2020-06-04 20:13:33 +08:00
55bfc3fa73 add more examples for package garray 2020-06-04 18:28:33 +08:00
d9c5182d1a gitignore updates 2020-06-04 17:56:32 +08:00
899fcbf2da add mor example for package garray 2020-06-04 17:55:43 +08:00
6e2c0d8706 comment and readme update 2020-06-04 17:29:16 +08:00
c4e599ce63 improve random bytes buffer hanlding for package grand 2020-06-04 14:45:56 +08:00
9cad9e4467 add more unit testing cases for package gstr 2020-06-04 00:03:30 +08:00
48019444ea README and DONATOR update 2020-06-03 23:49:12 +08:00
76d31a7fbb improve slice result handling by treating it as string slice for package gredis 2020-06-03 23:44:21 +08:00
facb9d93c0 fix issue of multiple slice arguments handling in function where 2020-06-03 21:36:16 +08:00
1d6bd46c5e README updates 2020-06-03 20:33:21 +08:00
8646dc1825 Merge pull request #702 from misitebao/master
更新 readme 中文版
2020-06-03 18:49:35 +08:00
2992bdeed7 修改之前的捐赠名称 2020-06-03 11:38:21 +08:00
c5601e6c88 更新 readme 中文版 2020-06-03 10:59:20 +08:00
ef1d9a561c improve the route feature for ghttp.Server 2020-06-03 00:09:51 +08:00
2d3b32c94a money 类型转换错误 2020-05-29 15:41:37 +08:00
269378aa0d fix issue in unit testing case for package gsession; version updates 2020-05-28 20:28:07 +08:00
6889542801 improve package guid 2020-05-27 11:26:05 +08:00
8e6f1f1740 improve performance of random buffer usage for package grand 2020-05-25 23:39:09 +08:00
b6ab1a992c improve empty checks for common interfaces implementer 2020-05-25 14:26:08 +08:00
a5a267567c comment update for package garray 2020-05-22 12:04:58 +08:00
f05f855c07 improve default max header bytes from 1KB to 10KB for ghttp.Server 2020-05-21 20:10:38 +08:00
bc5f773ba6 make WriteTimeout default to 0 for ghttp.Server 2020-05-19 19:16:47 +08:00
55308cc37c improve package gipv4 by formating the value retrieving fuctions to Get* 2020-05-18 23:50:31 +08:00
4d9db6edf0 improve package gconv for map converting 2020-05-18 20:58:19 +08:00
38111a64e3 improve files listing for ghttp.Server 2020-05-18 20:09:00 +08:00
bd8d3fca08 improve domain rule for package gvalid 2020-05-18 19:44:15 +08:00
89ccaa3915 improve function Do for package gredis, adding auto marshal feature for arguments 2020-05-18 19:18:53 +08:00
7c2cff7d99 add function GetVar for package gcache 2020-05-17 18:16:26 +08:00
788e15dbb6 comment update for package guid 2020-05-17 15:40:24 +08:00
a0172d9d7e README updates 2020-05-17 15:16:13 +08:00
bc1a7a1644 README updates 2020-05-17 15:11:07 +08:00
c98234d3e6 improve session feature by allowing custom session id creating function for ghttp.Server 2020-05-17 14:33:27 +08:00
45a94d23d5 improve session feature by allowing custom session id creating function for ghttp.Server 2020-05-17 14:33:21 +08:00
351de5ee6a fix concurrent issue in buffer handling of package grand 2020-05-17 12:46:28 +08:00
3559436d1e improve package guid 2020-05-17 08:50:37 +08:00
189f4c1637 improve package gsession 2020-05-16 22:08:16 +08:00
caead810e2 add package guid; improve performance of package grand 2020-05-16 21:56:31 +08:00
ebdc5d9c9d comment update for package grand 2020-05-16 16:08:30 +08:00
4164059211 add function B for package grand; improve package grand 2020-05-16 16:05:31 +08:00
bd27258c46 donator updates 2020-05-16 15:43:16 +08:00
ddf0605bc4 go mod tidy 2020-05-16 15:36:04 +08:00
991dbe50e0 add more functions for package gipv4; move package guuid to standalone package of gogf 2020-05-16 15:35:21 +08:00
8050efb835 improve package gfile 2020-05-16 14:06:35 +08:00
9355bc73a2 improve package gvalid 2020-05-16 13:31:24 +08:00
acc2a6a353 improve copy feature for package gfile 2020-05-16 00:50:01 +08:00
09e83e7b8d improve version functions for package gstr 2020-05-16 00:12:23 +08:00
c0df8a3d80 improve version functions for package gstr 2020-05-16 00:11:08 +08:00
33e890d225 improve version functions for package gstr 2020-05-16 00:10:12 +08:00
750e5df962 improve gstr.CompareVersion 2020-05-15 23:42:17 +08:00
74c65439fc add function ScanDirFunc for package gfile 2020-05-15 21:51:03 +08:00
f290bd7170 fix issue in http.File implements for package gres 2020-05-14 21:25:54 +08:00
d398b749d4 improve support for types of database pgsql 2020-05-14 21:15:44 +08:00
2fd5a1574a improve package gres 2020-05-14 20:32:01 +08:00
a7504f0629 add more unit testing cases for package gdb 2020-05-13 23:21:11 +08:00
3c35bb85ee improve unit testing cases for package gi18n/ghttp 2020-05-13 19:35:56 +08:00
6621edb04c improve i18n of chinese for package gvalid 2020-05-13 19:10:38 +08:00
b0c722e297 improve package gvalid 2020-05-10 22:34:16 +08:00
47a6284274 improve package gvalid 2020-05-10 22:32:10 +08:00
150b8edb70 improve package gvalid 2020-05-10 17:49:23 +08:00
aa5d3285eb improve package gvalid 2020-05-10 16:48:00 +08:00
993d6e3076 improve package gvalid 2020-05-10 10:56:11 +08:00
78ad9d8c2d improve error message of package gvalid 2020-05-10 09:05:52 +08:00
feff3ddce3 comment update for package ghttp 2020-05-09 19:19:42 +08:00
80fddad64d fix issue in PopRight function for package garray; improve json.Marshal for package garray 2020-05-08 21:08:06 +08:00
1e6dd0be02 readme updates 2020-05-08 19:16:52 +08:00
22ecf4f1b6 add context feature for package glog 2020-05-08 17:12:37 +08:00
5d21148657 comment updates for package ghttp 2020-05-07 23:05:33 +08:00
edb745ed92 version updates 2020-05-07 11:31:34 +08:00
61f4e0da6f improve package gcache 2020-05-06 21:09:02 +08:00
767afa3106 improve package gcache 2020-05-06 19:06:49 +08:00
16779359ee remove package gchan 2020-05-06 18:43:19 +08:00
770653fafa enable the route dump for unit testing of logging feature for ghttp.Server 2020-05-05 00:09:39 +08:00
0c021b6da7 add unit testing case of status handler feature for ghttp.Server 2020-05-05 00:01:09 +08:00
ec92b08f25 add function Maps for package gvar; add function GetMaps for package gjson; improve MapToMap* functions for package gconv 2020-05-04 23:42:51 +08:00
13e2353729 fix lock issue in function search for package garray 2020-05-03 23:08:18 +08:00
90d19a84ce improve package garray/gset, adding function ContainsI 2020-05-03 22:52:04 +08:00
b4c0b95d8a add support for old version of gres 2020-05-03 22:16:12 +08:00
b7e8255066 add support for old version of gre 2020-05-03 22:08:08 +08:00
5f8e6ad9ed comment update for package ghttp 2020-05-01 03:31:04 +08:00
c8d253eb56 change binary content from hex string to base64 string for package gres 2020-05-01 02:35:24 +08:00
4814624cff change binary content from hex string to base64 string for package gres 2020-05-01 02:16:42 +08:00
cc67f3d388 improve package gcompress 2020-05-01 01:47:02 +08:00
f7c2a51c9f fix issue in zip feature for package gcompress; improve package gres 2020-05-01 00:18:45 +08:00
3db83e1159 improve package gtimer 2020-04-30 22:22:35 +08:00
3bb002796c donator update 2020-04-30 20:46:27 +08:00
45170bc53e add ClientMaxBodySize configuration for ghttp.Server 2020-04-30 20:37:09 +08:00
b79ff84c6f add struct slice conversion for request parameters for ghttp.Request; improve package gconv 2020-04-30 16:53:47 +08:00
938c46fec9 readme update 2020-04-29 19:33:14 +08:00
8a13d94526 improve Record.Struct for package gdb 2020-04-29 09:12:13 +08:00
1e844d505a comment update for package ghttp/gconv; readme update 2020-04-29 00:14:29 +08:00
a123a2c086 improve struct conversion of empty result/record for package gdb 2020-04-28 21:03:25 +08:00
1eeeeb853e improve unit testing case of error logging for ghttp.Server 2020-04-28 15:21:17 +08:00
6e7224e306 improve error handling for gconv.Struct/ghttp.Server; add NewSkip/NewfSkip function for package gerror 2020-04-28 15:04:07 +08:00
9e064e2651 donator updates 2020-04-27 23:34:22 +08:00
8d9dd17eac add Walk function for package gset; improve fields handling feature for package gdb 2020-04-27 21:18:42 +08:00
cf1d3d3d2b improve package gdebug; add more unit testing case for package gdb 2020-04-27 17:56:04 +08:00
9480ffcdc0 improve function SetPath/AddPath for package gview 2020-04-27 17:07:00 +08:00
5db10add4a fix issue in unnacessary quoting of fields in select statement of gdb.Model 2020-04-27 16:30:53 +08:00
fa66bf5d9d improve cache feature of package gdb.Model 2020-04-26 21:31:55 +08:00
f69da3ace1 add function Transaction for package gdb 2020-04-26 17:47:19 +08:00
e01bfa05c3 listening ports change for unit testing cases of ghttp.Server 2020-04-26 17:13:48 +08:00
231238c157 improve parameter handing for ghttp.Request 2020-04-26 17:08:07 +08:00
7edec099ab improve raw request/response content dump for ghttp.Client 2020-04-24 00:00:52 +08:00
83eb8be064 Merge pull request #609 from kirileec/master
add Raw* method in ClientResponse to get request and response string
2020-04-23 22:58:04 +08:00
7af30df494 Merge branch 'master' into master 2020-04-23 22:57:23 +08:00
f026686fda fix issue in dupicated expiration handling in response cookies og ghttp.Client 2020-04-23 21:12:32 +08:00
35a50b9c6c readme update 2020-04-23 21:06:42 +08:00
010e2f951a downgrade the required golang version from v1.13 to v1.11 2020-04-23 20:38:25 +08:00
f7f86ad65a downgrade the required golang version from v1.13 to v1.11 2020-04-23 20:25:59 +08:00
1e19f447d1 improve ghttp.Client in context handling 2020-04-23 20:23:23 +08:00
8cc378331d add one unit testing case for ghttp.Server 2020-04-23 20:10:10 +08:00
4721f68fd8 add performance testing result 2020-04-23 19:51:08 +08:00
0d11c0a1f8 add performance testing result 2020-04-23 19:41:34 +08:00
5076613a8f add performance testing result 2020-04-23 17:25:11 +08:00
c5a44daa65 add performance testing result 2020-04-23 17:23:57 +08:00
520970b71f add performance testing result 2020-04-23 17:19:08 +08:00
ebfb08ee3f add performance testing result 2020-04-23 17:18:15 +08:00
9e38b2cb90 add performance testing result 2020-04-23 17:14:11 +08:00
71b1f00dc5 improve package gdb/gstr/gvalid 2020-04-20 22:36:28 +08:00
59d6830ab1 version update 2020-04-18 13:42:06 +08:00
8779a3f211 add function Walk for package garray; improve comment for package garray 2020-04-18 13:30:49 +08:00
c10149baa0 fix issue in stack trace for package gdebug; improve package gsmtp 2020-04-18 10:17:54 +08:00
4f87668780 improve retry feature for ghttp.Client 2020-04-16 15:43:21 +08:00
63f33d1d8c improve package gdb supporting gtime.Time parameter for Where condition 2020-04-15 18:02:32 +08:00
734aa5a6fe improve create_at,update_at,delete_at feature for package gdb 2020-04-15 12:56:41 +08:00
371aef224d donator updates 2020-04-15 11:41:44 +08:00
362e380ada improve SetConfigWithMap function for package ghttp/glog/gview; reveal some logger functions for default logger of package glog 2020-04-15 11:04:39 +08:00
e995bd8c9a add unit testing cases of https feature for ghttp.Server 2020-04-15 09:55:44 +08:00
81b211dd1a improve select operation details handling for package gdb 2020-04-15 09:37:46 +08:00
0515fc94cb add MapMerge/MapMargeCopy functions for package gutil; improve template view feature for indefinite parameters 2020-04-14 21:11:12 +08:00
46ee070f0a fix issue in package gfsnotify when gset changes 2020-04-14 00:20:39 +08:00
b17e3a6804 improve package gset 2020-04-13 23:44:43 +08:00
9160bee1af change comments 2020-04-11 12:16:53 +08:00
8e6018cfff improve soft deleting feature for package gdb 2020-04-11 10:14:49 +08:00
c08739b5a3 add function Having for gdb.Model 2020-04-11 10:11:52 +08:00
385a503d31 add soft deleting feature, improve chars handling for package gdb 2020-04-11 09:09:25 +08:00
ef286b0c15 add unit testing case for auto time and soft deleting features for package gdb 2020-04-09 22:48:21 +08:00
53aba2d4b8 add unit testing case of cache feature for package gdb 2020-04-09 22:00:02 +08:00
f22da4ba3a improve gconv.MapDeep with anonymous checks for attribute struct field 2020-04-09 15:34:23 +08:00
23c2f12672 improve MapDeep function for package gconv; improve gjson.New function for loading struct parameter 2020-04-09 13:37:27 +08:00
7fd53673ce add automatic time and soft deleting features: create_at/update_at/delete_at for package gdb; improve schema changing feature for package gdb 2020-04-08 21:26:14 +08:00
e64fd088b9 fix when no response 2020-04-08 20:11:06 +08:00
15672e7a09 #591 add Raw* method in ClientResponse to get request and response string 2020-04-08 19:24:03 +08:00
2ea1d2c7b2 update build-in template function substr/strlimit for package gview 2020-04-07 23:53:17 +08:00
90d751f98d add function SubStrRune/StrLimitRune/PosRune/PosIRune/PosRRune/PosRIRune for package gstr; remove unicode support in function SubStr/StrLimit for package gstr 2020-04-07 23:51:48 +08:00
25a91c732c improve String/Map converting for package gconv 2020-04-07 21:29:41 +08:00
01995f5501 improve function Marge for package garray using interface feature; improve slice converting using interface feature for package gconv 2020-04-07 21:25:52 +08:00
68abb3cf3d improve package glist for var initilalization feature 2020-04-07 20:58:58 +08:00
77cc323d0e improve package gset/gmap for initialization 2020-04-07 20:41:49 +08:00
c7a9c03495 improve package garray/gmap for initialization 2020-04-07 20:06:26 +08:00
f7850e3ed3 improve package garray 2020-04-07 11:29:42 +08:00
82125416a2 comment update for package ghttp 2020-04-06 22:31:45 +08:00
2c1e2155e3 improve function Server.Handler for package ghttp 2020-04-06 20:29:35 +08:00
2d30a53c3a remove function From for package gdb; add function g.Table; add ServeHTTP interface implements for ghttp.Server 2020-04-04 22:46:52 +08:00
ccceeae29c change third party package for yaml parsing to gopkg.in/yaml.v3 2020-04-03 19:51:33 +08:00
f22b98456f add default value of MaxActive configuration for package gredis 2020-04-03 15:18:35 +08:00
e7f1bd692b remove Content-Type header set in Response.WriteStatus for package ghttp 2020-04-03 14:16:26 +08:00
f82f7ab199 change default value of safe from false to true for gdb.Model 2020-04-03 10:16:57 +08:00
4d33b527b6 readme update 2020-04-03 09:32:04 +08:00
7bcc596308 add GetVar function for package genv; add DryRun feature for package gdb 2020-04-02 20:52:37 +08:00
be2d4b080e Merge pull request #601 from bdliyq/master
Get ghttp a chance to add custom host.
2020-04-01 19:55:25 +08:00
c96e5f5a9e readme update 2020-04-01 18:08:20 +08:00
3c23766674 readme update 2020-04-01 18:05:17 +08:00
718089fc11 Get ghttp a chance to add custom host. 2020-03-31 23:28:21 +08:00
8ab44dcb44 Get ghttp a chance to add custom host. 2020-03-31 21:50:15 +08:00
992522342c version/readme update 2020-03-30 23:56:26 +08:00
040898cdc3 improve unit testing case for package gmutex 2020-03-30 22:55:03 +08:00
343126ef22 fix usage for garray.PopRand 2020-03-30 20:56:00 +08:00
05760d1eac fix usage for garray.PopRand 2020-03-30 20:47:50 +08:00
c10f73f1f7 add zero time.Time filtering for omitempty feature of gdb.Model 2020-03-30 20:44:36 +08:00
7e0fa8e0cd improve package garray 2020-03-30 20:31:47 +08:00
6fe6218505 README updates 2020-03-29 20:23:10 +08:00
6059782de8 add unit testing case of basic auth for ghttp.Client; remove intlog for New function of package gspath 2020-03-29 19:36:49 +08:00
4844eea0ab add convenience function g.Client for ghttp.Client 2020-03-29 09:52:37 +08:00
8ecd62d3de add example for package gres 2020-03-28 21:32:29 +08:00
4c610b4f58 improve session storage file for ghttp.Server 2020-03-28 20:02:57 +08:00
1932c4ec44 Merge pull request #575 from wenzi1/master
Fix the bug of MSSQL paging
2020-03-28 19:59:31 +08:00
bd2e51ddca improve unit testing case for package glog 2020-03-28 00:47:34 +08:00
ddcb7121c1 improve temporary path producing from gfile.Join to gfile.TempDir 2020-03-28 00:41:12 +08:00
f1f575fd5c improve package gins/gfile/intlog 2020-03-28 00:37:23 +08:00
99adb7cdc4 comment update 2020-03-26 23:48:21 +08:00
6b7ea97777 improve quote handling of table string for package gdb; improve rotation feature for package glog 2020-03-26 22:25:43 +08:00
495b5758ec improve quote handling of table string for package gdb; improve rotation feature for package glog 2020-03-26 22:22:27 +08:00
ba56eb87b1 improve rotation feature for package glog 2020-03-26 20:58:57 +08:00
4258a3bbc9 improve StrToSize function for package gfile 2020-03-26 15:54:57 +08:00
4912331ddc improve mtime feature for gfile; improve rotation feature for glog 2020-03-26 09:29:36 +08:00
e87b7ecf5d improve unit testing case for package gfpool 2020-03-26 08:52:50 +08:00
23bce7bde6 reduce the goroutine count for unit testing cases of package gfpool/glog 2020-03-25 23:49:33 +08:00
926b664615 improve package garray for crossing border handling; improve rotation feature for package glog 2020-03-25 23:36:56 +08:00
fa8257c85b improve ghttp.Client 2020-03-25 17:13:05 +08:00
abb9c88c23 improve ghttp.Client 2020-03-25 15:17:18 +08:00
f89976cad5 improve ghttp.Client 2020-03-25 15:09:13 +08:00
0389778725 improve package glog for file lock 2020-03-25 00:03:52 +08:00
3c36285126 improve Model.Data function for package gdb 2020-03-24 20:58:11 +08:00
75054ee109 fix issue in rebinding feature for grou router of ghttp.Server 2020-03-24 19:48:10 +08:00
8447b1a42b add function LevelStr/StackWithFilter functions for package glog 2020-03-24 00:05:11 +08:00
e5265a1c46 add level string feature for package glog 2020-03-23 22:40:44 +08:00
6e8ef8d0b0 add level string feature for package glog 2020-03-23 22:36:06 +08:00
75c081afc9 fix issue of char '/' in URL.Path handling of ghttp.Server 2020-03-23 20:57:34 +08:00
060fd9eaba improve comment for package gdb 2020-03-23 20:44:20 +08:00
63e5a60344 improve package gdb 2020-03-22 23:26:15 +08:00
75dc1d82c1 example names change 2020-03-22 12:49:46 +08:00
a5e048eb5f example name changes 2020-03-22 12:34:12 +08:00
65bc1d5eb8 comment update for package gjson 2020-03-22 09:24:45 +08:00
bfa64705b5 update comment for package gsession 2020-03-22 00:15:59 +08:00
17aea8d7d4 improve unit testing cases by changing creating testdata path using gdebug.TestdataPath function 2020-03-21 23:47:33 +08:00
a6a01fd7f2 improve template cache for ParseContent function of package gview 2020-03-21 23:42:34 +08:00
41a9e91b4c improve example for package gpage 2020-03-21 23:13:31 +08:00
e2c1e11f95 improve package gjson 2020-03-21 21:32:02 +08:00
c2966817ce improve function gdebug.TestDataPath and update all usage codes 2020-03-21 19:41:05 +08:00
16958413bb improve autoencode feature for package gview 2020-03-21 19:31:58 +08:00
c0a0913d4b add more unit testing case for template feature of ghttp.Server 2020-03-21 13:45:33 +08:00
6d47810782 improve context feature for ghttp.Request; improve comment for package gjson 2020-03-21 13:32:43 +08:00
7a9ea2e546 improve context feature for ghttp.Request 2020-03-20 23:22:32 +08:00
7881b2dee4 improve unit testing cases 2020-03-20 22:34:56 +08:00
5f223ef049 Merge pull request #4 from gogf/master
update
2020-03-20 10:06:50 +08:00
e57942b374 improve unit testing cases 2020-03-20 08:56:17 +08:00
f18e6f078c improve unit testing cases 2020-03-20 08:49:40 +08:00
f667cbc2a2 Fix the bug of MSSQL paging 2020-03-20 00:33:20 +08:00
07e65c14a9 improve unit testing cases 2020-03-19 23:53:03 +08:00
0b6d04485e improve unit testing cases 2020-03-19 22:56:12 +08:00
36401a063d improve gutil.Dump, improve sqlite file searching when opening db file 2020-03-19 13:38:42 +08:00
849e7370d1 improve gutil.Dump, improve sqlite file searching when opening db file 2020-03-19 11:37:31 +08:00
f01dca0895 version updates 2020-03-17 22:36:05 +08:00
55137b2aa3 README, DONATOR updates 2020-03-17 22:35:09 +08:00
22540921b3 improve codes typing for package package gvalid 2020-03-17 22:23:29 +08:00
6174097a07 Merge pull request #3 from gogf/master
update
2020-03-17 22:11:51 +08:00
52de11b1fe Merge pull request #564 from arieslee/master 2020-03-17 22:08:31 +08:00
5a646179ad fix issue in limit...offset statement of postgresql for packagegdb 2020-03-17 21:38:49 +08:00
33ae93e050 improve CORS feature for ghttp.Server 2020-03-17 17:46:43 +08:00
f3d859159d improve router group for duplicated router registering for package ghttp.Server 2020-03-17 14:48:52 +08:00
4fb01e68f7 移除字符串ip地址与Long类型互转的方法,修改中文长度校验的方法 2020-03-17 14:26:36 +08:00
2812a247aa 添加验证中英文混合字符串长度的判断规则,按utf8计算,一个中文算一个字符,cn-length,cn-min-length,cn-max-length 2020-03-17 11:19:43 +08:00
2b46e765c4 change function time.Duration.Milliseconds to time.Duration.Nanoseconds for compatibility of Golang version < 1.13 2020-03-16 23:03:37 +08:00
c7f911cae2 change function time.Duration.Milliseconds to time.Duration.Nanoseconds for compatibility of Golang version < 1.13 2020-03-16 23:03:35 +08:00
9f0548c03d improve testdata directory retrieving for unit testing cases 2020-03-16 22:47:39 +08:00
c578df06a3 fix issue in unit testing case of package gfile 2020-03-16 20:51:19 +08:00
8ed3cf9c97 fix issue in unit testing case of package gcdg 2020-03-16 20:46:03 +08:00
2438f565e9 添加字符串ip地址与Long类型互转的方法 2020-03-16 11:18:06 +08:00
8230c72ec6 improve file uploading feature for ghttp.Request 2020-03-15 20:11:38 +08:00
d716037caa improve package gcfg adding default configuration file searching for instance 2020-03-15 19:56:07 +08:00
855a4ddb2c add file rotation feature for package glog; improve gpool/gfpool; fix issue in gfile.MTimeMillisecond 2020-03-15 19:32:29 +08:00
74be9fac18 add file rotation feature for package glog; improve gpool/gfpool; fix issue in gfile.MTimeMillisecond 2020-03-15 19:32:26 +08:00
e9fba5a166 readme updates 2020-03-14 17:15:25 +08:00
0a92df691b improve package gpool/gfpool; donator updates 2020-03-14 17:12:44 +08:00
e513cd10ed add Lock* functions for gdb.Model and improve Data/Where functions for gdb.Model 2020-03-13 17:21:30 +08:00
b702d98700 version updates 2020-03-12 10:05:38 +08:00
99f1d9d0ed improve package gudp 2020-03-11 23:59:43 +08:00
707b08c585 improve package gudp 2020-03-11 23:56:58 +08:00
f44c19868c improve package gudp 2020-03-11 23:54:35 +08:00
13ab139afc add more unit testing case for package gdb 2020-03-11 23:24:19 +08:00
cacb2f142b Merge pull request #548 from wenzi1/master
add Tables and TableFields method for sqlite
2020-03-11 23:18:59 +08:00
11f0317e92 add Array feature for package gdb 2020-03-11 23:17:41 +08:00
9a667c8803 add Tables and TableFields method for sqlite 2020-03-11 22:45:38 +08:00
c1cce17934 add unit testing cases for gudp 2020-03-11 16:08:17 +08:00
5a92d7de0d fix issue in router group registering for controller 2020-03-11 15:51:24 +08:00
53bf378868 Merge pull request #550 from fulltimelove/master 2020-03-11 15:07:30 +08:00
cd7c45c00c improve default connection pool configuration for gredis 2020-03-11 14:35:23 +08:00
f13a5ad82e 分组路由对象绑定时支持多方法绑定 2020-03-11 10:10:00 +08:00
2e9be609c8 fix issue in unit testing of gins 2020-03-11 09:22:13 +08:00
2f2f6e1ffe add Tables and TableFields method 2020-03-11 00:29:25 +08:00
f3bd2b67f7 change attribute Context to context.Context for ghttp.Request 2020-03-10 20:45:22 +08:00
645cecdffb improve template view instance initialization for instance of ghttp.Server 2020-03-10 20:13:36 +08:00
22e9965629 improve template view instance initialization for instance of ghttp.Server 2020-03-10 08:57:37 +08:00
24ea9f9245 Merge pull request #2 from gogf/master
update
2020-03-09 23:35:59 +08:00
9dbde6e8f1 change function HandleSqlBeforeExec to HandleSqlBeforeCommit for package gdb 2020-03-09 22:00:01 +08:00
fe0b34544d fix missing of pgsql driver support for package gdb 2020-03-09 21:56:53 +08:00
5e489d59b4 improve HandleSqlBeforeExec function for package gdb 2020-03-09 21:53:58 +08:00
61f49574a9 fix issue in unit testing case for gparser 2020-03-09 20:56:10 +08:00
2fabcb62a8 remove binary from git 2020-03-09 19:48:51 +08:00
3bc3b652c1 improve unit testing case for gjson 2020-03-09 09:00:38 +08:00
042a6f12f5 add map conversion support for result of HGetAll for package gredis 2020-03-08 23:16:06 +08:00
5acce82e63 add slice support for gconv.Map 2020-03-08 23:09:37 +08:00
4732bf46ad add Context map for internal context workflow parameter exchanges for ghttp.Request 2020-03-08 22:53:20 +08:00
5bed5a1532 improve unit testing case for driver feature og package gdb 2020-03-08 12:18:07 +08:00
5b7576430f improve unit testing case for driver feature og package gdb 2020-03-08 12:16:44 +08:00
356f4cd701 improve unit testing case for driver feature og package gdb 2020-03-08 12:04:24 +08:00
c444630d1e add workaround for package gdb for json infinite loop bug of Golang version < v1.14 2020-03-08 11:56:19 +08:00
8e40cded42 add custom driver feature for package gdb 2020-03-08 11:03:18 +08:00
0e52d467d3 improving package gdb 2020-03-08 00:17:42 +08:00
6665d62e7e improve package gfile 2020-03-07 20:28:00 +08:00
5bdf1a71b8 improve uploading file feature for ghttp.Server 2020-03-07 20:20:52 +08:00
a34ca0ff4b improve uploading file feature for ghttp.Server; improve package gfile/gstr/gdebug 2020-03-07 19:31:33 +08:00
7f0163d958 improve gconv.Struct* functions for custom types conversion 2020-03-06 23:22:08 +08:00
31f19b0eee improve package gcompress 2020-03-06 15:38:32 +08:00
93d0760898 add GetPage function for ghttp.Request 2020-03-06 11:01:03 +08:00
4863e7a6ae Merge pull request #529 from wenzi1/master 2020-03-05 22:02:16 +08:00
a161b44cc7 improve package gpage 2020-03-05 18:07:07 +08:00
7072244420 improve comment for ghttp.Server 2020-03-05 16:08:55 +08:00
f68b66e606 update comment for ghttp.Server 2020-03-04 23:32:27 +08:00
4e7c6c1fb4 improve CORS feature for ghttp.Server 2020-03-04 22:52:56 +08:00
d8a7e36478 improve router feature for ghttp.Server 2020-03-04 17:29:23 +08:00
8971ad8445 Add tables method of MSSQL, Oracle and PgSQL 2020-03-02 23:41:33 +08:00
270af8accb Merge pull request #1 from gogf/master
update
2020-02-29 22:46:00 +08:00
b0ef63fc9d improve bindArgsToQuery for surpport for pgsql/mssql/oracle for package gdb 2020-02-29 19:55:53 +08:00
6e1f8c3cfc version updates 2020-02-29 08:54:18 +08:00
e58d7e8dda add internal log for gi18n; improve unit testing case for ghttp.Server 2020-02-28 23:00:05 +08:00
3a3384cf06 Merge branch 'master' of https://github.com/gogf/gf 2020-02-27 17:09:44 +08:00
ef2a9f6fd1 fix issue in log paatern for ghttp.Server 2020-02-27 17:09:12 +08:00
63f756f731 Merge pull request #514 from kevinlincg/master
fix typo in gpool_bench_test.go
2020-02-26 23:38:33 +08:00
bb1c27c36a add more unit testing cases for glog 2020-02-26 23:26:24 +08:00
87cd0703c0 change internal log prefix from '[GF]' to '[INTE]' 2020-02-26 11:57:26 +08:00
6317d9de53 add ci for golang v1.14 2020-02-26 11:54:46 +08:00
7acf16fdba add UploadFile feature for ghttp.Server 2020-02-26 01:01:28 +08:00
a52b454d3e add UploadFile feature for ghttp.Server 2020-02-26 00:48:27 +08:00
816e075c52 add more unit testing cases for package garray 2020-02-25 23:19:37 +08:00
9882b361a8 add more unit testing cases for package gstr 2020-02-25 23:01:51 +08:00
4415dcf1c1 add HasPrefix/HasSuffix for package gstr 2020-02-25 21:03:07 +08:00
42fd583bfd add more inernal logging points for core components 2020-02-24 21:09:19 +08:00
c70bc7c96a improve pakage g/gins 2020-02-23 20:25:55 +08:00
02bd780a33 readme and donator update 2020-02-22 17:06:58 +08:00
24a2192ce2 README updates 2020-02-22 15:36:31 +08:00
d8ef8a1f5d add gf.debug options and GF_DEBUG env control params for internal logging feature 2020-02-22 14:51:44 +08:00
745a913cfb add FilterNil/FilterEmpty functions for package garray; add FieldsStr/FieldsExStr for gdb.Model 2020-02-22 14:26:36 +08:00
13dba407a2 fix parameter issue in benchmark of internal/rwmutex 2020-02-21 13:15:40 +08:00
34e7c5f809 rename grand.Str to grand.S; add different function Str for grand 2020-02-21 00:01:27 +08:00
d570624caa fix typo in gpool_bench_test.go 2020-02-20 09:01:09 +08:00
f18312419b improve CORS feature for ghttp.Server 2020-02-16 23:18:37 +08:00
89f869dd44 remove internal logging for gsession.StorageFile; improve example codes for CORS feature of ghttp.Server 2020-02-16 23:00:42 +08:00
20b64507b1 improve string conversion for gtime.Time 2020-02-16 22:39:12 +08:00
7443246e05 add gtime.TimeWrapper 2020-02-16 18:07:05 +08:00
f9e7823c14 improve configuration for package gdb 2020-02-16 16:36:39 +08:00
52943b283c go.mod updates; add search path configuration in file for package ghttp.Server 2020-02-16 16:34:30 +08:00
36403fdc08 improve configuration for mssql 2020-02-16 16:25:03 +08:00
0317f6812e add more unit testing cases for gtime 2020-02-16 15:11:21 +08:00
5169137069 improve unit testing case for CORS feature for package ghttp 2020-02-16 13:32:06 +08:00
7d9bccf912 README updates 2020-02-15 12:00:20 +08:00
14f56ea18f donator updates 2020-02-14 22:21:53 +08:00
1736d271d2 add more unit testing case 2020-02-14 22:13:41 +08:00
19755ad233 improve gcfg 2020-02-14 21:57:35 +08:00
cfdd043e4e add OctStr function for gstr 2020-02-12 10:48:15 +08:00
78917ed5cb comment updates for package ghttp 2020-02-11 10:00:10 +08:00
88684ca00a add panic if internal watcher creation fails for gfsnotify; improve codes and change comment from chinese to english for gdb 2020-02-10 20:37:53 +08:00
784983806a add InserIgnore feature for package gdb 2020-02-08 23:46:10 +08:00
cdb3b94e22 add NewWithTag function for gjson/gparser 2020-02-08 14:07:32 +08:00
83dcc4a5e0 fix issue for overwriting the route item if allowed 2020-02-08 11:17:09 +08:00
a6c0b281a3 add struct support for where condition statement of gdb 2020-02-07 20:58:47 +08:00
3120f24553 add struct support for where condition statement og gdb 2020-02-07 19:44:11 +08:00
ac9be6134b add global schema access support for mssql in gdb 2020-02-07 17:21:05 +08:00
4c1b4f7858 change time measuing unit from microtime to millitime for ghttp.Request; change graceful reload feature from true to false in default 2020-02-07 16:29:14 +08:00
1e45bf93d8 remove error printing when decoding error in communication feature of gproc 2020-02-06 19:21:17 +08:00
e8dd3979b6 add more unit testing cases for ghttp/gview 2020-02-06 15:17:10 +08:00
374ee4c0ea improve ghttp.Request for making the request body reusable for multiple times 2020-02-06 11:22:36 +08:00
95411aff77 improve ghttp.Request for making the request body reusable for multiple times 2020-02-06 11:14:38 +08:00
1999ef95c1 fix issue in gconv.Struct* functions panic when converting attribute value is nil 2020-02-05 22:06:24 +08:00
b15075fdfe fix issue in gconv.Struct* functions panic when converting attribute value is nil 2020-02-05 22:02:49 +08:00
4d2b244319 fix issue in gres.UnpackContent; fix issue in gtime.NewFromTimeStamp 2020-02-04 17:09:18 +08:00
4c3af63076 improve time string parsing for invalid datetime 2020-02-01 20:14:24 +08:00
91bbff6ced architecture updates 2020-01-23 15:04:12 +08:00
26aab44ec8 fix issue in char '-' support for parameter retrieving for ghttp.Request 2020-01-22 20:28:42 +08:00
2e10ce421b improve plugin feature 2020-01-21 22:18:49 +08:00
8eda69b11e improve the plugin feature for ghttp.Server 2020-01-21 17:18:03 +08:00
7d7b242968 Merge branch 'master' of https://github.com/gogf/gf 2020-01-21 15:42:19 +08:00
202419202f improve logger feautre, add unit testing cases for ghttp.Server; add SetDefaultLogger function for glog 2020-01-21 15:42:08 +08:00
55078beed1 Merge pull request #484 from chikaku/remove_redundant
Remove redundant code in gsession
2020-01-21 15:40:35 +08:00
d9f4e6eaa6 remove redundant code in gsession 2020-01-21 14:55:08 +08:00
2ba0913bea comment update for gtimer 2020-01-21 14:46:23 +08:00
8f2dcf21ff improve gconv.Map 2020-01-20 21:25:55 +08:00
01b06e0745 improve ghttp.BuildParams 2020-01-20 20:32:39 +08:00
665b5960c8 fix issue in minus number converting for gconv.Int 2020-01-20 20:18:24 +08:00
eb6a7a4728 add function UnmarshalValue feature for package garray/gmap/gset/gtype/gvar/gjson/gconv 2020-01-20 19:56:42 +08:00
7df53ff55e rename all timestamp function names from *Second to Timestamp* 2020-01-20 14:14:11 +08:00
8021f39710 version updates 2020-01-19 21:21:41 +08:00
f2af08270b improve gproc 2020-01-19 20:42:21 +08:00
c2f028848c readme updates 2020-01-18 22:35:07 +08:00
d9c7224861 readme updates 2020-01-18 22:21:37 +08:00
f59a1ada88 improve static service feature, add plugin feature for ghttp.Server 2020-01-17 21:12:52 +08:00
705ab1d33f improve garray; add RemoveValue function for garray 2020-01-17 19:48:50 +08:00
c07c4d7217 version updates 2020-01-16 21:26:34 +08:00
b867b2a0bc add return parameter name for function Cas of gtype;improve Response.Redirect* functions by adding optional parameter code 2020-01-16 21:04:28 +08:00
872d674182 fix issue in database 'time' type support in package gdb 2020-01-15 21:23:40 +08:00
4682abafdf fix concurrent issue in gdb.Model.Count 2020-01-15 10:38:02 +08:00
b7d194cf52 improva gcmd.Parser/gres 2020-01-15 09:36:58 +08:00
edf2366296 improve gzip feature for gcompress; add gzip compression for package gres 2020-01-15 00:15:56 +08:00
22af5be71f rename parameter name for gipv4.Ip2Long/Long2Ip 2020-01-13 14:50:06 +08:00
f662ff8051 add pprof unit testing case for ghttp; reame updates 2020-01-12 22:26:07 +08:00
8c51121b3b version updates 2020-01-11 10:40:13 +08:00
e9a0805801 add function Schema for gdb 2020-01-10 23:48:19 +08:00
afadbc6621 improve genv.Remove/gproc.Kill 2020-01-10 22:32:07 +08:00
ca546fc30b why the goland auto removed my genv import? 2020-01-10 09:39:54 +08:00
7c7c168c3d improve gproc.SearchBinary 2020-01-09 23:05:03 +08:00
16f0bb96db improve strict parsing feature for gcmd 2020-01-08 23:06:01 +08:00
33a899d32e add As function for gdb.Model; improve string quote handling for gdb 2020-01-08 21:24:33 +08:00
f3a208f02f fix issue in router value retrieving for ghttp.Request 2020-01-08 20:00:42 +08:00
81fd3d06bb make parser default unstrict for gcmd 2020-01-08 19:30:56 +08:00
9227139cf8 add schema changing feature for gdb 2020-01-07 22:14:32 +08:00
f2190e50b2 improve unit testing for gdb 2020-01-06 20:43:59 +08:00
c4537b4753 improve ghttp.Client.Get 2020-01-06 17:57:07 +08:00
167d58490b Merge pull request #455 from gnever/191229_gfile_add_readline_mst
Add ReadLines and ReadByteLines read file content line by line
2020-01-06 17:52:41 +08:00
d36aceb9f1 Merge pull request #463 from sth4me/patch-1
fix mysql debug time
2020-01-06 17:51:33 +08:00
eb31922124 fix mysql debug time
调试模式时间格式改为毫秒,原来是微秒.
2020-01-06 10:28:34 +08:00
bec9f5a847 add buildin function 'concat' for gview 2020-01-05 19:55:17 +08:00
506552c3a9 example codes update; donator updates 2020-01-04 17:19:50 +08:00
2bacc77224 improve JSON/XML parsing feature for ghttp.Request 2020-01-04 15:35:21 +08:00
bc53f265af improve gconv.Map/String 2020-01-03 20:23:10 +08:00
344f232c36 add Timestamp*Str functions for gtime; improve unit testing cases for gfile 2020-01-02 21:29:06 +08:00
27b677b0c0 improve Map converting feature for gconv; improve package gproc for local shell searching; improve JSON/XML response for ghttp.Response 2020-01-02 19:45:41 +08:00
a5a0e381bd add more examples for ghttp.Server 2020-01-01 16:45:43 +08:00
d528d7f5ab donator updates 2020-01-01 15:24:10 +08:00
821c71bd8d improve parameter parsing feature for ghttp.Request 2020-01-01 15:20:03 +08:00
604a10400d improve parameter parsing feature for ghttp.Request 2020-01-01 14:57:57 +08:00
9219471f67 improve parameter parsing feature for ghttp.Request 2020-01-01 14:26:00 +08:00
fe5d2e5685 improve parameter parsing feature for ghttp.Request 2020-01-01 14:18:00 +08:00
0a89daa513 add more unit testing cases for gdb.TX 2019-12-31 16:02:18 +08:00
d6e6ddf996 Add gfile.ReadLines and gfile.ReadByteLines read file content line by line 2019-12-29 19:24:56 +08:00
5dbda8aedc fix issue in unit testing codes in gfile 2019-12-29 14:15:17 +08:00
134e4cf28f improve gfile.CopyDir function; add Model function for gdb.Model 2019-12-28 13:55:05 +08:00
56a85abef7 add AutoEncode feature for gview 2019-12-26 11:03:59 +08:00
80c6ceaf26 fix issue 437 2019-12-25 21:22:06 +08:00
a10f428715 add Iterator* functions for garray; add ReplaceDir*/ReplaceFile* functions for gfile; remove gfile.Replace/ReplaceFunc functions 2019-12-25 20:56:39 +08:00
597f7468e9 fix issue in prefix feature for method operations of gdb 2019-12-23 23:14:54 +08:00
5db8851213 comment update for gtype 2019-12-20 23:23:50 +08:00
1d53d760d8 README/DONATOR update; improve ghttp 2019-12-19 15:38:34 +08:00
922e720d63 improve gdb/ghttp/gins; fix issue in gstr 2019-12-19 15:14:05 +08:00
50018773b7 add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:45:46 +08:00
df99036d41 add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:44:40 +08:00
ae0fa888f0 add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:40:07 +08:00
18892fb66d add iterate example for glist; improve variable name for ghttp.Server 2019-12-18 19:37:07 +08:00
5f2be10563 improve gdb/gtime 2019-12-17 21:06:34 +08:00
a5a88222a6 gofmt 2019-12-16 22:51:17 +08:00
4facdd5c9e gofmt 2019-12-16 21:22:42 +08:00
76bc9bd385 improve gdb.Model 2019-12-16 21:00:16 +08:00
364452f3bb improve gdb.Model 2019-12-16 20:50:27 +08:00
4996755f11 improve gcmd.Scan* 2019-12-14 22:48:53 +08:00
e33230a88f add package gbuild 2019-12-14 17:01:27 +08:00
951ce46932 fix data race issue in unit testing cases for gtcp 2019-12-13 18:50:54 +08:00
795c7395e6 fix data race issue in unit testing cases for gtcp 2019-12-13 17:40:29 +08:00
27cf47bcd3 improve table prefix and quote feature for gdb 2019-12-13 15:25:49 +08:00
58a25c6f61 fix data race issue in unit testing of gtcp 2019-12-13 14:26:07 +08:00
2d754f80b1 fix data race issue in unit testing of gtcp 2019-12-13 13:43:28 +08:00
f4e8fbe767 fix issue in unit testing codes for gtcp 2019-12-13 08:57:39 +08:00
458318d374 improve prefix and word quote feature for gdb; merge develop 2019-12-12 23:54:07 +08:00
e3f54e1353 improve tag and field retrieving feature for internal/structs; comment update for gdb 2019-12-12 23:38:46 +08:00
4374996073 add some Must* functions for gparser/gjson/gmd5/gsha1/gbase64 2019-12-12 11:40:23 +08:00
87295ef1fe improve process communication feature for gproc; add more slice converting functions for gconv 2019-12-11 21:22:41 +08:00
81d4082b6a fix issue in Retry.Interval type changed for gtcp 2019-12-11 14:54:38 +08:00
d7e19bc3f3 improve package feature for gtcp 2019-12-11 14:50:25 +08:00
34ef0ea792 add prefix feature for gdb 2019-12-10 21:14:15 +08:00
2804834540 rename GetRouterMap to GetRouterArray for ghttp.Server 2019-12-10 12:28:55 +08:00
add7dd5a45 merge develop 2019-12-09 23:22:49 +08:00
e40894ca45 add IsServiceHandler for ghttp.RouterItem 2019-12-09 23:19:39 +08:00
28825f5395 add gdebug.BuildInfo function; improving gproc 2019-12-09 21:53:44 +08:00
6ca5141020 some improving 2019-12-08 22:55:32 +08:00
fe4f8e1810 version updates 2019-12-05 19:46:50 +08:00
671157cb70 release updates 2019-12-05 12:34:33 +08:00
f775479c3f fix issue in ghttp.Request.GetRequest* 2019-12-05 10:44:31 +08:00
64bb72842e comment update for unit testing case of gdb 2019-12-04 22:38:58 +08:00
e1d4ba9d23 add GetError function for ghttp.Request 2019-12-04 19:50:49 +08:00
a1edd83add README/DONATOR update 2019-12-04 18:48:13 +08:00
f7d6883405 fix issue in gredis for int set/get 2019-12-04 18:43:16 +08:00
8448a70646 change minimum go version from 1.10. to 1.11; travis ci updates 2019-12-04 17:50:03 +08:00
4018bfa899 travis updates 2019-12-04 17:36:31 +08:00
3cc9ce74e1 add IsEmpty function for gdb.Record/Result 2019-12-04 17:01:30 +08:00
eac60d845f go.mod updates 2019-12-04 16:27:19 +08:00
835c045c92 fix unit testing case for gdb 2019-12-04 16:21:35 +08:00
be15f85eae remove sql.ErrNoRows error for select functions for gdb; improve configuration feature for gdb/glog/gview 2019-12-04 16:04:52 +08:00
3e27ea0259 change duration parameter type from interface{} to time.Duration for gcache/gfcache 2019-12-04 14:42:09 +08:00
6abe660287 export router map api for ghttp.Server; comment update for ghttp.Server 2019-12-04 13:55:08 +08:00
a06ca31530 improve middleware feature for ghttp.Server 2019-12-04 10:03:03 +08:00
890865251b improve routerMap handling for ghttp.Request 2019-12-03 17:16:52 +08:00
6af90cafee rename ghttp.Domain.AddBindMiddleware to BindMiddlewareDefault for ghttp 2019-12-02 23:05:05 +08:00
2e2363bb41 change routergroup parameter name 'g' to 'group' for unit testing cases of ghttp 2019-12-02 23:00:48 +08:00
108ced2b0b improve route priority handling for ghttp.Server 2019-12-02 21:26:12 +08:00
fcba650348 add more unit testing case for gview 2019-12-02 20:27:21 +08:00
1b8a082942 change view configuration name from 'view' to 'viewer' in gins 2019-12-02 20:08:45 +08:00
40570cdb03 change logger configuration name from 'logging' to 'logger' in gins 2019-12-02 19:55:45 +08:00
10451864e6 improve parameter handling for ghttp.Requset 2019-12-01 21:41:29 +08:00
55e2646367 comment update for ghttp.Server 2019-12-01 21:05:46 +08:00
c88839edb1 comment update for ghttp.ServerConfig 2019-12-01 14:24:56 +08:00
2a2cfc289c improve ghttp.Client 2019-12-01 14:07:36 +08:00
8bbeb186c2 add Exit feature for ghttp.Response 2019-11-30 20:41:53 +08:00
be4bf39719 comment update for container 2019-11-30 18:33:51 +08:00
459c69839a comment update for container 2019-11-30 18:28:11 +08:00
a5407e57d9 comment update for ghttp.Client 2019-11-30 10:24:19 +08:00
5c749e7762 improve parameters handling for ghttp.Request 2019-11-30 09:42:07 +08:00
b3fafc64f8 improve parameter handling for ghttp.Request 2019-11-29 22:02:19 +08:00
c7b0763ab0 comment and unit testing case update for gdb 2019-11-28 23:51:05 +08:00
0cfdf60de5 change model default unsafe for gdb 2019-11-28 23:23:11 +08:00
096bff791d change model default safe for gdb 2019-11-28 23:21:27 +08:00
0cce858641 improve configuration feature for ghttp.Server/gview/glog 2019-11-28 23:19:37 +08:00
bb45d8d578 improve template cache feature for gview 2019-11-28 14:29:58 +08:00
7e43aa6b9d improve parameter parsing for ghtto.Request; add configuration feature for gview 2019-11-28 11:18:09 +08:00
4ee7c82bf1 fix issue in empty slice converting panic for gconv.Struct 2019-11-28 08:46:38 +08:00
85caa40a3d fix issue in empty slice converting panic for gconv.Struct 2019-11-27 23:38:33 +08:00
f4654bf446 fix comment issue in example codes for gmap 2019-11-27 23:19:07 +08:00
94ed0bf9c9 fix issue in ghttp.Request.GetView 2019-11-26 15:12:58 +08:00
22e3705d3e improve ghttp.GracefulServer; add more unit test case for ghttp.Server.Middleware 2019-11-26 14:56:05 +08:00
9b1cc6e9c7 add special handle for configuration of mssql for gdb 2019-11-22 19:45:42 +08:00
9429c8ff83 improve gd.Model.Clone 2019-11-21 22:21:57 +08:00
056c6d4688 remove Array type case from internal/empty.IsNil checks 2019-11-21 21:57:50 +08:00
382356bc8d improve gerror for stack information; fix issue in gconv.String for nil *time.Time type 2019-11-21 21:49:00 +08:00
1deb3510f0 improve gerror, ghttp for error stack logging; improve custom view feature for ghttp.Request 2019-11-20 18:45:09 +08:00
dd7ae1b07a unit test case updates for gdb 2019-11-20 13:36:31 +08:00
04a8755162 travis updates 2019-11-20 12:34:03 +08:00
682f99a763 travis updates 2019-11-20 12:29:34 +08:00
61282d6dab travis updates 2019-11-20 12:27:23 +08:00
ad540f7c25 update travis for adding mysql password; add custom view feature for ghttp.Response 2019-11-20 12:09:26 +08:00
a4f191c1c6 fix issue in gdb.Model for repeated condition statements; remove concurrent safety feature of gview; add default template file feature for gview 2019-11-19 21:50:17 +08:00
43531c2680 improve glog for debug configuration; add GetInt*/GetUint* functions for ghttp.Request 2019-11-19 17:26:06 +08:00
635f5d36fd improve log feature of ghttp.Server; remove trace for Notice/Warning functions for glog 2019-11-15 22:50:31 +08:00
1becc4932c add more functions for gtcp; remove default domain set for cookie feature of ghttp.Server 2019-11-14 15:41:28 +08:00
e36dd06f22 Merge pull request #342 from myvfpx/master 2019-11-08 23:45:48 +08:00
8f2c62d444 improve logging feature for ghttp.Server 2019-11-08 19:52:49 +08:00
21efde1a38 fix issue in session feature of ghttp.Server 2019-11-08 09:06:01 +08:00
d8b6466ed0 fix issue in ghttp.Server 2019-11-07 21:02:24 +08:00
d7b0228e9e add build-in function 'replace' for gview 2019-11-07 20:56:17 +08:00
9da1277b47 improve session of file storage for ghttp.Server 2019-11-07 20:42:13 +08:00
a3fd0c9a4a improve session of file storage for ghttp.Server 2019-11-07 20:36:33 +08:00
ad7375b44b improve configuration feature for ghttp.Server 2019-11-07 16:40:34 +08:00
05120b585d improve configuration feature for glog/ghttp.Server 2019-11-07 11:32:25 +08:00
9e32d74c8c improve ConfigFromMap function for ghttp.Server 2019-11-06 20:23:41 +08:00
0e62510c6f improve configuration feature, add instance feature for package glog; add package guuid for UUID feature 2019-11-06 20:22:20 +08:00
c492de4fa8 improve multipart form parsing for ghttp.Server 2019-11-06 15:37:29 +08:00
6308380541 update example for uploading files feature for ghttp.Server 2019-11-06 10:39:59 +08:00
2609db1aec improve file uploading feature for ghttp.Server 2019-11-05 19:47:35 +08:00
6c54e73dbd add example for memory storage og gsession 2019-11-05 17:33:06 +08:00
21abe62633 improve gfsnotify; add cache for tempalte file content 2019-11-04 22:42:49 +08:00
e30b2b0732 improve gsession/gmap/gtree 2019-11-04 21:26:16 +08:00
dcb74ee9df comment update 2019-11-01 20:36:09 +08:00
82bf21e831 improve gfsnotify 2019-11-01 15:31:26 +08:00
66355354fc improve gfsnotify/gview and container 2019-10-31 23:37:33 +08:00
4204125dce improve gipv4.IsIntranet 2019-10-31 15:13:34 +08:00
e6aa9d3a46 add EncodeFile/EncodeFileToString functions for gbase64 2019-10-31 14:42:01 +08:00
9416cd1274 add CopyMap function for gutil; improve ghttp.Request 2019-10-30 23:26:57 +08:00
8b5ab846b2 improve unit test case for gmutex 2019-10-30 23:01:24 +08:00
a15b93be90 comment update for package gtcp/gipv4/gipv6 2019-10-30 19:55:50 +08:00
38ee5f7d53 improve performance of gdebug 2019-10-30 15:12:19 +08:00
6f9bbbf416 add debug info for ghttp.Server 2019-10-29 20:15:13 +08:00
143bc3d8e3 travis updates 2019-10-29 20:02:28 +08:00
ea75b1a936 travis updates 2019-10-29 20:00:46 +08:00
0dde8c735e add debug info for ghttp.Server 2019-10-29 19:59:24 +08:00
1ab7f00b91 add FieldsEx function for gdb.Model 2019-10-29 19:45:21 +08:00
3ef42bfbf0 improve internal/intlog 2019-10-29 17:15:02 +08:00
05fec23457 improve internal/cmdenv 2019-10-29 17:13:29 +08:00
7225e49aa0 add package intlog for GF internal logging usage; improve redis storage feature for gsession 2019-10-29 16:45:42 +08:00
14e9deb254 add more unit test cases for gsession 2019-10-29 10:01:05 +08:00
f9569b387f add ConnectTimeout configuration for gredis 2019-10-29 09:49:29 +08:00
a0722ed51f add redis session support for gsession 2019-10-28 20:48:52 +08:00
e9ace9b17a update comment for grpool/glog 2019-10-28 17:16:50 +08:00
4791d10761 fix issue in hijack error for websocket of ghttp.Server 2019-10-28 17:01:08 +08:00
c686b1c080 improve datetime coverting for gdb 2019-10-28 16:42:30 +08:00
056d6ebbd9 improve interface design for gsession.Storage 2019-10-28 16:07:01 +08:00
baa2cb68de donator updates 2019-10-26 11:38:18 +08:00
e4909b318b Merge branch 'develop' of https://github.com/gogf/gf into develop 2019-10-26 11:03:17 +08:00
f1b7cb37c6 add configuration feature for glog 2019-10-26 10:58:07 +08:00
734728fa9c improve time handling for gdb 2019-10-25 19:54:02 +08:00
b373ace065 update comment for gqueue.Len 2019-10-25 17:32:03 +08:00
bc7b5c8626 fix issue in status checks for static file serving 2019-10-25 17:04:17 +08:00
f2b45622d6 add debug for domain group testing 2019-10-25 16:57:54 +08:00
77cb219057 enable route map printing for domain group testing 2019-10-25 16:44:54 +08:00
cf34d7bd56 fix issue in gconv.Interfaces; improve storage interface for gsession 2019-10-25 13:49:03 +08:00
5adc9be0d9 gofmt 2019-10-25 10:43:59 +08:00
58b2efc900 version update 2019-10-24 21:05:23 +08:00
28326606f5 fix issue in resource file handler for ghttp.Server 2019-10-24 20:22:37 +08:00
91c98bbb60 fix issue in group router feature for domain 2019-10-24 19:44:30 +08:00
63cd1128a7 Merge pull request #346 from danvinhe/feature-optimize_grand.Str 2019-10-23 22:51:58 +08:00
c0236d7dfa improve gstr.SplitAndTrim 2019-10-22 13:57:21 +08:00
d4051df5b6 improve gdb/gstr/gconv/garray 2019-10-21 19:13:25 +08:00
88045417ff fix issue in field type check for gdb 2019-10-17 20:57:49 +08:00
500efb5601 fix issue in template for ghttp.Server 2019-10-17 20:31:03 +08:00
97fe8235da fix issue in session expiring for file storage of gsession; add Pop/Pops functions for gset/gmap 2019-10-16 23:33:06 +08:00
e1164e935b improve configuration for gdb; add more unit test case for ghttp.Server 2019-10-15 21:20:38 +08:00
b26330aee1 rename cacheTime to cacheExpire and change its type from int to time.Duration for gdb.Model; fix issue in string support of function Data for gdb 2019-10-15 17:44:47 +08:00
2b083709b5 add gmap.ListMap/TreeMap support for gdb.Where 2019-10-14 23:27:48 +08:00
0ac45dc379 rename file name from link_map to list_map for package gmap 2019-10-14 22:43:31 +08:00
650916c22a version updates 2019-10-14 13:46:45 +08:00
2804183325 fix issue in content-type response for ghttp.Server 2019-10-14 13:46:16 +08:00
2dc2610621 improve gdb; README update 2019-10-13 23:05:48 +08:00
1736e71e6b add debug for unit test case of 2019-10-13 22:40:23 +08:00
69ee5375b9 improve Join/String functions for garray/gset/gmap; add AddIfNotExistFunc/AddIfNotExistFuncLock functions for gset 2019-10-13 22:31:28 +08:00
3ac0a66887 improve unit test cases for gspath 2019-10-13 21:42:04 +08:00
20e873a1fc version updates 2019-10-13 00:40:06 +08:00
142484d89c add support for like statement in map key for Where function, improve error format for gdb 2019-10-13 00:37:25 +08:00
76a9f4ca14 fix security issue in static file feature for ghttp.Server 2019-10-12 23:56:03 +08:00
c4e5679d5c fix issue in missing passing MaxIdle/MaxActive configuration to underlying redis pool for gredis; add extra output for unit test cases of ghttp.Server 2019-10-11 23:33:21 +08:00
b08d7c3c38 change Join function feature for garray 2019-10-11 23:17:29 +08:00
5092d8e6c5 improve status handling and add error logger for ghttp.Server; fix issue in defer error warpping for some packages 2019-10-11 22:54:25 +08:00
74d625ff97 add Get*Int32/Get*Int64/Get*Uint32/Get*Uint64 functions for ghttp.Request 2019-10-10 10:40:38 +08:00
f1119e28e8 add Get*Int32/Get*Int64/Get*Uint32/Get*Uint64 functions for ghttp.Request 2019-10-10 10:33:14 +08:00
3082c7f761 fix issue in StrLimit for gstr 2019-10-10 00:04:38 +08:00
5f36614dd7 remove UseNumber for json decoding in package gjson 2019-10-09 20:33:26 +08:00
1dcc7a4887 improve http status handling for middleware of ghttp.Server 2019-10-09 15:26:50 +08:00
41e9d35487 improve middleware feature for ghttp.Server; fix issue memory usage in big file downloading 2019-10-09 00:33:58 +08:00
977c8b7ee3 version updates 2019-10-01 17:54:29 +08:00
939e6244ee comment update for gtcp/gudp 2019-10-01 17:53:49 +08:00
e764b2393d change params order of Insert* functions for glist; improve gstr.IsNumber 2019-10-01 16:35:44 +08:00
6384e75ed9 improva container for json marshal/unmarshal interface 2019-10-01 16:03:18 +08:00
195cae6577 add new functions and mark deprecated for some functions for gdb 2019-10-01 11:29:02 +08:00
c8cf46a5a7 add Create function for gvar; add Uints/SliceUint function for gconv 2019-10-01 10:42:34 +08:00
eba97277b2 add more unit test cases for ghttp 2019-10-01 09:33:26 +08:00
4e19fbc5fb add separate put/delete functions for ghttp.Request 2019-10-01 09:06:35 +08:00
494b5bbae2 fix issue in unit test case for gvar 2019-09-30 17:30:24 +08:00
987ce709e5 add UnmarshalJSON for gtime; add ineterface MapStrAny support for gjson.New 2019-09-30 17:23:23 +08:00
35ad4d869f fix issue in cycle import for gtime 2019-09-30 15:51:15 +08:00
39d654e3f2 update comment for gtime 2019-09-30 15:26:32 +08:00
7fe9c641f4 add UnmarshalJSON func tion for gset 2019-09-30 14:37:05 +08:00
ee1414c010 add UnmarshalJSON func tion for gmap/gvar 2019-09-30 14:23:15 +08:00
8eb1b685a5 improve UnmarshalJSON function for garray 2019-09-29 22:16:36 +08:00
46768d6f91 add UnmarshalJSON function and corresponding unit test cases for package grray 2019-09-29 20:47:59 +08:00
bb6fed3dc2 add UnmarshalJSON function and corresponding unit test cases for package gtype 2019-09-29 20:12:59 +08:00
47e74d27bf add MarshalJSON function to implement the interface MarshalJSON for json.Marshal for gtype 2019-09-29 15:59:09 +08:00
b830f9b96d improve ghttp.Server.Request for parameter retrieving; add Option feature for gdb; update example for hook feature of ghttp.Server 2019-09-29 14:27:09 +08:00
c85162a8a0 improving gdb.Model/gmap 2019-09-26 20:01:48 +08:00
ef4e128af7 fix issue in cors 2019-09-26 15:54:13 +08:00
cce8ac5118 The 'letters' already contain numbers, so just grab characters randomly from this. 2019-09-26 11:00:59 +08:00
cb7c3a9fa4 fix issue in index folder feature for ghttp.Server 2019-09-25 10:56:44 +08:00
b0f859cc91 improve example codes 2019-09-24 23:41:18 +08:00
6d4da529ee add websocket unit test case for ghttp 2019-09-24 21:08:28 +08:00
6c7e536eeb fix issue in gbase64/ghttp 2019-09-24 20:39:00 +08:00
36c2648be8 improve ghttp.Response; move gflock to new repo 2019-09-24 20:19:18 +08:00
419b58452f 修改身份证尾数验证规则,新增银行卡号验证规则 2019-09-24 10:38:20 +08:00
b1835ea4e8 添加身份证号尾数验证规则,添加银行卡号验证规则 2019-09-24 10:21:37 +08:00
a876b6133d fix issue in unit test case og grand 2019-09-23 23:24:36 +08:00
03ff358da8 update ci/readme/donator 2019-09-23 23:08:58 +08:00
037f74c549 Create FUNDING.yml 2019-09-23 22:32:31 +08:00
a8caf4ad21 RELEASE updates 2019-09-23 22:00:04 +08:00
51d9fe5253 add AllowDomain option for ghttp.CORS; add IsSubDomain function for gstr; improve grand.Intn 2019-09-23 19:25:03 +08:00
3218c89f17 improve gfile/gstr/ghttp 2019-09-23 16:21:19 +08:00
02e467fb57 rename MapStruct* functions to MapToMap* for gconv and according packags 2019-09-19 23:23:41 +08:00
ec994f3080 add more examples of middleware feature for ghttp.Server; release updates 2019-09-19 21:17:54 +08:00
1181ab499c improve error handling in hook feature for ghttp.Server 2019-09-19 20:25:01 +08:00
5424935fd9 rename AddMiddleware to BindMiddleWareDefault for ghttp.Server; add more unit test cases fpr gstr 2019-09-19 20:19:07 +08:00
b9fbfb91bd improve middleware feature of ghttp.Server; add MapStrAny function for gmap/gtree 2019-09-19 19:44:46 +08:00
62f66b4fec remove unnecessary stack trace of gf for stack printing 2019-09-19 13:13:39 +08:00
eef9da9a41 improve parameters parsing for ghttp.Server 2019-09-19 09:09:12 +08:00
7d32be3b6c improve perameter parsing for ghttp.Server 2019-09-18 23:20:45 +08:00
c2ad9f5fb9 fix issue in gyaml for invalid decoding result of type map[interface{}]interface{} 2019-09-17 20:53:20 +08:00
4847fecdaa Merge branch 'master' of https://github.com/gogf/gf 2019-09-17 19:48:19 +08:00
f75383e0c5 fix issue in quote word for gdb 2019-09-17 19:45:51 +08:00
f683dccb6f Merge pull request #335 from LetMyPplGo/master
added tests for gsmtp
2019-09-17 10:44:15 +08:00
6fb106b618 added tests for gsmtp 2019-09-17 00:06:46 +03:00
97956ad903 version/release update 2019-09-16 23:07:57 +08:00
5d72a5b5ae improve gcmd 2019-09-16 20:57:43 +08:00
1d7ded562c add quote support for table named with '.'; improve case conversion for strings named with '.' for gstr 2019-09-16 17:15:39 +08:00
0d87b601cc fix issue in data filter for gdb.Model 2019-09-16 16:54:52 +08:00
33fbedffb8 gix issue in Config variable for ghttp.Response.View 2019-09-16 15:49:31 +08:00
2cfcbc82e1 RELEASE updates 2019-09-16 11:10:38 +08:00
e1721cb1b6 add package gmode for release mode management 2019-09-16 11:08:41 +08:00
1d264a6545 add package gmode for release mode management; add error returning for template rendoring for gmvc.View/ghttp.Response 2019-09-16 10:44:07 +08:00
565e48f6f1 add more example for package gres; RELEASE updates 2019-09-15 21:47:47 +08:00
2b20c77bc0 improve example for gi18n 2019-09-15 13:47:44 +08:00
1665d92136 improve session expire algorithm for gsession 2019-09-15 12:17:44 +08:00
f128cb9f61 improve session storage interface for gsession 2019-09-15 11:30:38 +08:00
6d55b30b39 add example for group router of ghttp.Server 2019-09-14 23:36:02 +08:00
953ea55899 improve status handling for response of ghttp.Server 2019-09-14 22:57:57 +08:00
966c93af00 improve middleware and error logging for ghttp.Server 2019-09-14 22:53:28 +08:00
41a0b52939 RELEASE updates 2019-09-14 00:43:06 +08:00
8281d9cdd1 improve gfile.MainPkgPath; update RELEASE.MD 2019-09-14 00:17:49 +08:00
b0ece3bd8f Merge branch 'master' of https://github.com/gogf/gf 2019-09-13 22:14:08 +08:00
19a856549a improve codes details 2019-09-13 22:08:18 +08:00
65bd31bb65 Merge pull request #316 from LetMyPplGo/master 2019-09-13 21:16:16 +08:00
a3830f0820 Merge pull request #326 from wenzi1/master 2019-09-13 21:15:22 +08:00
5f8656eb41 Merge pull request #332 from hailaz/master
improve dbBase.doBatchInsert()
2019-09-13 21:14:38 +08:00
141bee9c49 add ConfigByMap function for ghttp.Server; improve gsession for file storage 2019-09-13 20:49:16 +08:00
aa44c0fb11 improve session for ghttp.Server; improve i18n for gview 2019-09-12 00:00:59 +08:00
79e2d30849 improve gsession for file storing 2019-09-11 23:26:38 +08:00
e8a9c7ac72 update comments for package gaes/gdes; update function names for gdes 2019-09-11 23:22:15 +08:00
006054d13a fix issue in session for ghttp.Server 2019-09-11 22:57:29 +08:00
b39d653fe9 add package gsession; mv gkvdb to new repo 2019-09-11 21:19:45 +08:00
d9e7d4249f improve dbBase.doBatchInsert() 2019-09-11 16:48:00 +08:00
34ad4ae166 Merge pull request #7 from gogf/master
sync master
2019-09-11 16:40:27 +08:00
69684f5023 improve gredis instance initialization for gins 2019-09-10 20:38:23 +08:00
2ed1854f0c improve gres with file separator replaced to / 2019-09-10 14:21:11 +08:00
09da0f7388 improving gview with ghttp for controller 2019-09-09 23:02:40 +08:00
7f943c6b5f improving gview with i18n 2019-09-09 22:56:54 +08:00
ed3fc529ed Failed to return when Gini file grammar error
Failed to return when Gini file grammar error
2019-09-08 23:25:45 +08:00
2eb0511ef5 Failed to return when Gini file grammar error
Failed to return when Gini file grammar error
2019-09-08 23:24:00 +08:00
8bc1f457c7 Merge pull request #1 from gogf/master
update
2019-09-08 22:58:40 +08:00
77a727e1d7 improve i18n with gview 2019-09-08 21:12:11 +08:00
16cc3c0fca fix issue in gredis unit test cases 2019-09-06 18:08:58 +08:00
96106ace92 remove deprecated functions and fix corresponding unit test cases 2019-09-06 17:59:55 +08:00
13e528abb6 remove deprecated functions and fix corresponding unit test cases 2019-09-06 16:59:38 +08:00
0d5dfe59b9 remove deprecated functions 2019-09-06 16:44:40 +08:00
8fd88307f7 add errors printing when i18n files loading failed for gi18n 2019-09-06 15:43:57 +08:00
57244a9553 added the example for gsmtp 2019-09-06 01:18:41 +03:00
fb8aac38dd server address verification
simple Email address check for from & to
default port=25 for server address
2019-09-06 00:53:23 +03:00
8f953dabe5 fix issue in ghttp.Session.GetMap* 2019-09-05 23:48:54 +08:00
d63c2882fd update unit test case for gfile.IsEmpty 2019-09-05 20:18:49 +08:00
952eb7df15 add Scan/Scanf functions for gcmd; improve gfile.IsEmpty 2019-09-05 20:00:01 +08:00
dfc76ddb76 add IsEmpty function for gfile 2019-09-05 19:22:11 +08:00
b0cddc29e4 add more functions for gcmd 2019-09-05 15:16:25 +08:00
dfc61cb273 rename StrArray to StrArray for garray 2019-09-05 14:26:08 +08:00
05922e4f21 add more common types for package g 2019-09-05 14:25:20 +08:00
6cf4bf81e5 improve gcmd with arguments parser 2019-09-05 11:38:36 +08:00
ad43989944 improve procedure of ghttp.Server 2019-09-04 20:22:31 +08:00
31e7037e3e add example for session handling of ghttp 2019-09-04 20:12:29 +08:00
425d45e502 improve error text for session saving error 2019-09-04 20:04:04 +08:00
9ddb148fcb fix issue in memory usage of gkvdb in unit test cases of ghttp 2019-09-04 19:44:13 +08:00
e4d34abd7e fix unit test cases for ghttp/gres 2019-09-04 19:23:19 +08:00
16103c43eb fix unit test cases for ghttp/gres 2019-09-04 19:10:15 +08:00
7fad4b686c improve gcompress/gres for packing files 2019-09-03 23:18:54 +08:00
cd00ac446b improve CORS feature for ghttp.Server 2019-09-03 17:18:16 +08:00
e2906fba0b improve type conversion for gdb 2019-09-03 00:06:24 +08:00
acd5e72f6c improve gdb for configiration 2019-09-02 20:35:29 +08:00
8f1fd259d4 Merge branch 'master' of https://github.com/gogf/gf 2019-09-02 19:06:53 +08:00
d9041da426 Merge branch 'develop' 2019-09-02 19:06:01 +08:00
269ddb04af fix issue in gfile.Replace* 2019-09-02 19:05:32 +08:00
b1c2b9f4e0 improve gconv.Bool for NO/YES; improve gdb for model generation 2019-09-02 15:48:25 +08:00
7e9fe8ea98 improve resource feature in ghttp.Server 2019-09-01 22:22:08 +08:00
af81bf2bde Merge branch 'develop' 2019-09-01 22:14:45 +08:00
55addaa8ea improve gres and add more unit test cases for gres 2019-09-01 22:14:31 +08:00
6ccc4d119f improve export data as hex for gres 2019-09-01 21:34:15 +08:00
c05a91cdc9 README update 2019-09-01 00:31:15 +08:00
077d8b9f48 Merge branch 'develop' 2019-09-01 00:30:19 +08:00
15a6680833 add package gi18n 2019-09-01 00:30:01 +08:00
6c61704e60 adding package gi18n 2019-08-31 18:04:12 +08:00
cfa0b99cd8 README update 2019-08-30 22:19:50 +08:00
c0bb8bef06 README update 2019-08-30 22:15:54 +08:00
86f9d5c39d README update 2019-08-30 22:15:13 +08:00
33f2ae5fc4 fix spell issue of const names for gproc 2019-08-30 21:07:46 +08:00
ea1277d76c add case functions for gstr and according unit test cases 2019-08-30 20:51:23 +08:00
ee89a06b3e improve model feature 2019-08-30 20:29:12 +08:00
a31108e753 fix issue in gring/ghttp 2019-08-26 23:51:01 +08:00
2bf9bc98a7 improve gkvdb, container 2019-08-26 23:35:44 +08:00
d67975249c fix issue in unit test case for gkvdb 2019-08-26 22:54:59 +08:00
d3a2bef9ba improve debug sql with arguments auto bound 2019-08-26 20:57:37 +08:00
b7f67e3162 add StackWithFilter function for glog, and improve gdb/ghttp 2019-08-26 20:09:24 +08:00
1a20edc0b0 improving gdb and glog 2019-08-26 19:39:04 +08:00
f80ba1473e fix issue in stack skip feature for glog; fix issue in slice parameter for gdb 2019-08-24 23:08:17 +08:00
89a8203949 comment update for gpage 2019-08-22 23:30:28 +08:00
fd6321e71b update donator; update unit test case for gdb; fix issue in bool convertion for []byte for gconv 2019-08-22 23:24:45 +08:00
7dffd9d1ff add package gkvdb; add kvdb storage feature for ghttp.Server 2019-08-22 21:04:30 +08:00
51a156420d improve gres for empty path passed 2019-08-19 22:54:37 +08:00
c92323c681 gofmt 2019-08-19 22:42:31 +08:00
10e03eef3b add resource feature for gcfg 2019-08-19 21:02:44 +08:00
e151055521 improve resource feature for ghttp/gview 2019-08-19 20:17:13 +08:00
1f8408b622 improve gdb 2019-08-19 19:21:27 +08:00
98ddadb131 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-08-19 19:09:48 +08:00
a5ac12545a Merge pull request #286 from wenzi1/master 2019-08-19 19:07:46 +08:00
e58384d815 update example for gres 2019-08-16 00:37:12 +08:00
ab381dacfe add resource feature support for gview 2019-08-16 00:29:14 +08:00
9162fde14a improve resource feature for ghttp.Server 2019-08-15 19:27:32 +08:00
6cf1714a07 improve resource feature for ghttp.Server 2019-08-15 19:20:39 +08:00
c402e17605 修改mssql中的datetime类型的处理 2019-08-14 22:44:57 +08:00
25746e9844 adding gres 2019-08-14 22:18:31 +08:00
a8a8dbeab8 adding gres 2019-08-14 22:16:33 +08:00
6113df2b3e adding gres 2019-08-14 22:03:52 +08:00
8f7363df41 删除mssql中的convertValue方法。
修改测试案例中的datetime类型的字段在查到数据后做转换
2019-08-14 19:16:45 +08:00
dafc79bf80 adding gres 2019-08-14 00:13:42 +08:00
9ae537cafc adding gres 2019-08-13 21:06:11 +08:00
162df6b250 fix issue in number overflow from int64 to int for ghttp.Session/ghttp.Cookie/gcache 2019-08-13 20:15:09 +08:00
12f28dfc95 improving gtree/gres 2019-08-13 13:45:01 +08:00
5d7d8abbde add oracle/mssql/postgres unit test cases 2019-08-12 17:12:16 +08:00
b960faec45 to support automated testing of postgres 2019-08-12 16:57:08 +08:00
9a057b757d add package gini 2019-08-12 16:53:07 +08:00
296c4b750b add oracle/mssql/postgres unit test cases 2019-08-12 16:50:57 +08:00
7ecc47e127 adding gres package for resource feature 2019-08-10 23:36:38 +08:00
d03180ff4d Merge pull request #284 from pibigstar/master
feat(travis): exit ci when test failed
2019-08-10 21:17:16 +08:00
c1c52b072e feat(travis): exit ci when test failed 2019-08-10 19:55:01 +08:00
72be3803ec update unit test cases for ghttp 2019-08-10 18:07:24 +08:00
5cb4a8557d fix issue for unit test case of gutil 2019-08-10 17:59:34 +08:00
7787135549 improve status checks if there're middlewares registed for ghttp.Server 2019-08-10 17:46:11 +08:00
56368500a3 add header support for session feature of ghttp.Server 2019-08-10 16:39:46 +08:00
846c6a579e improve ghttp.RouterGroup 2019-08-10 14:10:47 +08:00
573179060e improve gjson 2019-08-09 20:33:21 +08:00
fda345577a add package gdebug; improve gconv/gfile/gset 2019-08-09 20:05:36 +08:00
8387710473 fix issue in gset.Pop; improve internal/debug 2019-08-09 09:51:56 +08:00
3af3fd1428 fix issue in gset.Pop; improve internal/debug 2019-08-09 09:51:52 +08:00
c7c6e2866e add Unsafe* functions for gconv 2019-08-09 09:14:48 +08:00
7172ae0232 fix issue in invalid error stacks for glog; improve internal/debug and gutil for stack printing 2019-08-08 22:58:49 +08:00
4eac97a7d8 add Master/Slave functions for gdb 2019-08-08 17:43:21 +08:00
352e4c088a improve gcfg: it returns all values if pattern is '.'; add more functions for gcfg 2019-08-07 16:58:01 +08:00
4d5814fc43 improve grand 2019-08-07 16:21:31 +08:00
6d13b91d37 improve grand 2019-08-07 16:20:19 +08:00
0376c99b5a update unit test cases for ghttp 2019-08-06 23:10:37 +08:00
77d9e472b7 add middleware feature for ghttp.Server; improve router group feature for ghttp.Server 2019-08-06 20:40:04 +08:00
2911ebb5d7 add middleware feature for ghttp.Server 2019-08-03 23:57:20 +08:00
f4d01f56c6 add middleware feature for ghttp.Server 2019-08-03 18:08:10 +08:00
878305fee3 add middleware feature for ghttp.Server 2019-08-03 17:14:54 +08:00
0460a53f53 add middleware feature for ghttp.Server 2019-08-03 15:54:12 +08:00
e622f6aff2 improve gconv to support struct field of interface{} conversion 2019-08-01 19:53:28 +08:00
9e96a30ea2 update unit test cases for garray/gparser 2019-08-01 17:31:48 +08:00
d188fbdf5a improve gyaml with gopkg.in/yaml.v3; update unit test cases for gfile/gyaml/gtime/garray 2019-08-01 17:12:58 +08:00
06c16bf560 remove thirdparty diectory, add go.mod for package dependences 2019-08-01 14:07:25 +08:00
29ea9e3237 travis updates 2019-08-01 11:42:51 +08:00
b01add2925 update project structure 2019-07-29 21:01:19 +08:00
a98ad9577b improve gjson/gparser/gcfg/gvar 2019-07-29 20:37:49 +08:00
ef8351151d merge master 2019-07-29 20:03:23 +08:00
f6bb3c848e Merge branch 'master' of https://github.com/gogf/gf 2019-07-29 19:52:24 +08:00
3fd4cbbbfd add MapStruct/MapStructDeep/MapStructs/MapStructsDeep functions for gconv 2019-07-29 19:52:05 +08:00
b102e0dbc5 add unit test cases for ghttp.RouterGroup 2019-07-28 17:58:43 +08:00
1c0e8f77c8 Merge branch 'develop' of https://github.com/gogf/gf into develop 2019-07-28 17:40:56 +08:00
bebcb70b14 merge master 2019-07-28 17:40:11 +08:00
165602ae0a improve default instance name handling 2019-07-28 17:37:13 +08:00
a36e00efeb improve ghttp for session storage with redis server 2019-07-28 13:10:34 +08:00
bd4d273e1c improve ghttp for session 2019-07-28 11:50:12 +08:00
216a928861 add IsEmpty for gvar; add CompareVersion for gstr 2019-07-27 15:36:52 +08:00
a157c3f940 add Map/Contains/Build functions for genv 2019-07-27 14:40:22 +08:00
5a23459b23 update unit test cases for gfile 2019-07-27 11:41:12 +08:00
538b282f43 improve internal/debug,glog,garray,gfile 2019-07-27 11:34:04 +08:00
86f51f1e4a improve gfile 2019-07-26 23:01:12 +08:00
622f76d5fb improve glog/gmd5/gcmd 2019-07-26 22:33:49 +08:00
65e06b12ae improve dir list for ghttp; add ISO8601/RFC822 functions for gtime 2019-07-25 23:25:30 +08:00
b714f7db69 add *Bytes functions for ghttp.Client; improve gcmd/gfile 2019-07-25 21:01:04 +08:00
1063922682 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-07-24 22:49:48 +08:00
2c6168129a improve gfile/ghttp for file serving 2019-07-24 22:48:43 +08:00
45465c1bd1 version updates 2019-07-24 21:49:25 +08:00
8acecc88f9 improve internal/debug, gdb packages 2019-07-24 21:21:08 +08:00
575349929b improve gcompress 2019-07-24 15:58:56 +08:00
3913a89434 add Replace function for gfile 2019-07-24 15:29:10 +08:00
1bc8c9e3e2 add UnZipContent function for gcompress 2019-07-24 15:05:02 +08:00
b4a0cca9c4 add Name function for gfile; add ZipPath/UnZipFile functions for gcompress 2019-07-24 14:48:16 +08:00
78b13ef4e1 concurrent safety updates for unit test cases for internal/mutex,internal/rwmutex,grpool 2019-07-23 23:40:57 +08:00
a49df101cd change default value from unsafe to safe for garray/gmap/glist/gset/grong/gtree/gjson/gparser 2019-07-23 23:20:27 +08:00
7ff4a00063 Merge pull request #250 from hailaz/master 2019-07-23 21:51:17 +08:00
2636f8acf1 improve skip checks for internal/debug 2019-07-23 13:50:38 +08:00
9042a885fa version updates 2019-07-23 10:17:30 +08:00
ef837bd9c6 add quotes for tx for gdb 2019-07-22 23:51:47 +08:00
6a76725d64 add quotes for fields and table name for gdb 2019-07-22 23:48:39 +08:00
697dbdc604 add unit test case for types 2019-07-22 23:03:55 +08:00
86f98f3710 fix issue in gqueue in closing channel for limited queue 2019-07-22 21:57:17 +08:00
470c696976 Comment updates for gjson 2019-07-22 21:20:38 +08:00
e61bd174c8 fix issue in gcfg for config content loading 2019-07-22 21:03:54 +08:00
c71b9bc122 fix unit test cases 2019-07-22 15:31:35 +08:00
c5339cbbe7 fix unit test cases 2019-07-22 15:10:40 +08:00
29020b0ac0 improve gconv 2019-07-20 16:41:17 +08:00
0a0530af0a comment updates for gcache 2019-07-20 13:17:38 +08:00
a5783ab860 improve unit test case for gdb.Tx 2019-07-19 14:13:11 +08:00
ae2de91b4c improve gcmd 2019-07-19 14:10:02 +08:00
ceecbef586 fix issue in unit test cases for gdb.Tx; improve gcmd; add gfile.SelfName function 2019-07-19 13:32:44 +08:00
2fa558b25f improve gjson 2019-07-18 20:06:42 +08:00
f465b478d6 improve gstr/gjson/gconv 2019-07-18 18:59:49 +08:00
a4abac4916 improve unit test cases for gdb; add more functions for gjson; improve ghttp.Response.WriteStatus function 2019-07-17 23:24:27 +08:00
9f9cb097d9 修复gvalid.CheckStruct()的msgs覆盖tag的msg存在的bug。 2019-07-17 20:07:43 +08:00
5ab64e31fd improve benchmark test cases for gset/glist 2019-07-16 20:45:57 +08:00
ac6a8b9b74 improve benchmark test cases for gmap 2019-07-16 20:30:10 +08:00
f43d252d08 improve style for stack output for glog/gerror 2019-07-16 19:49:21 +08:00
185f9efb9c remove third/golang.org/x/text/encoding 2019-07-16 18:52:50 +08:00
47d423036f improve gjson 2019-07-16 17:27:21 +08:00
7fae21f255 improve gjson 2019-07-16 17:11:01 +08:00
3fce835da0 improve performance for gjson.Load* functions; add GetQueryVar/GetPostVar functions for ghttp.Request 2019-07-16 16:23:03 +08:00
0b62ccf941 improve gmutex 2019-07-16 10:25:10 +08:00
f7c5d7fc7f gvalid补充修代码注释,移除错误的代码修改。 2019-07-15 21:14:46 +08:00
e484685282 improve debug feature for gdb; add skip support for file line print for glog 2019-07-15 19:54:13 +08:00
9c857705ff Merge branch 'feature_1.8.0' 2019-07-15 17:41:27 +08:00
76f680de33 fix issue in debug for gdb 2019-07-15 17:40:21 +08:00
1181b6ae3a add MarshalJSON interface implements for garray/gmap/gtime/gvar/gtree 2019-07-13 17:48:16 +08:00
8a7f4ab156 RELEASE updates 2019-07-13 17:18:48 +08:00
99d43a7ddc comment updates for gmutex 2019-07-13 16:56:20 +08:00
bd97d7d94e improve gmutex 2019-07-13 16:41:23 +08:00
73235f1967 修复gvalid多条数据校验时,规则key没有对应校验数据导致校验异常的问题。 2019-07-13 15:20:41 +08:00
1ebc8092a6 Merge pull request #6 from gogf/master
sync master
2019-07-13 14:30:34 +08:00
edd93c39a3 improve gerror 2019-07-13 14:24:44 +08:00
88c43d1772 Merge pull request #5 from gogf/master
sync master
2019-07-13 12:35:33 +08:00
a0a8eb4700 TagMapField改回调用MapField 2019-07-13 11:47:20 +08:00
28e5c33e81 comment updates for gdb 2019-07-13 11:35:22 +08:00
f24847576d 先移除新增的两个gvalid的test文件。 2019-07-13 10:52:02 +08:00
dfaf27e9e5 先还原对gvalid.Check()的修改。 2019-07-13 10:50:01 +08:00
32d5b28423 先还原对gvalid.Check()的修改。 2019-07-13 10:48:46 +08:00
0b8ca3313e 矫正gvalid.CheckStruct()字段别名记录的注释。
优化gvalid.CheckStruct()中属性的tag解析循环。
2019-07-13 10:47:52 +08:00
e6bb5e82a3 version updates 2019-07-13 09:57:40 +08:00
a24b97b004 Merge branch 'feature_1.8.0' of https://github.com/gogf/gf 2019-07-13 09:57:10 +08:00
08eeff7f1c RELEASE updates 2019-07-13 09:55:10 +08:00
769f31e69a RELEASE updates 2019-07-13 09:53:53 +08:00
cdf92b64d6 Merge pull request #4 from gogf/master
sync master
2019-07-13 09:22:12 +08:00
6d1ca028e7 fix issue in unit test case for ghttp 2019-07-12 23:20:36 +08:00
a228356399 RELEASE updates 2019-07-12 22:57:40 +08:00
3521f1b641 add more unit test cases for gdb for slice parameter feature 2019-07-12 22:37:49 +08:00
1dedf3d83b RELEASE updates 2019-07-12 22:33:34 +08:00
da4c01c011 Merge branch 'master' of https://github.com/gogf/gf into feature_1.8.0 2019-07-12 22:02:16 +08:00
9cd445ad40 improve gvalid tag for gvalid package 2019-07-12 21:37:48 +08:00
ff4ef7e240 Merge pull request #247 from 2892931976/gf-chj 2019-07-12 21:02:19 +08:00
4de574ee86 auto create struct for ghttp.Request.GetToStruct 2019-07-12 20:56:45 +08:00
0481b4025b gvalid test 20190712 10:20 2019-07-12 10:23:28 +08:00
9495b858fd RELEASE updates 2019-07-11 21:28:06 +08:00
5576adbd0b update ghttp. 2019-07-11 19:47:15 +08:00
b8da86bce8 Merge pull request #243 from iReadX/dev 2019-07-11 19:45:49 +08:00
a926d3dadd merge master 2019-07-11 19:06:32 +08:00
a95624ab19 add big-endian support for gbinary; improve gdb for bit type support 2019-07-11 18:58:31 +08:00
cf745422f3 Fixed use cname in gvalid tag.
Added gvaild data type support for array, slice, map.
Added array, slice, map data test in gvaild unit test.
2019-07-11 15:41:10 +08:00
10e042454c fix issue in bit type conversion for mssql in gdb 2019-07-11 15:41:06 +08:00
yc
759be06ebc Function BuildParams add 'UnUrlEncode' param, default false. 2019-07-11 10:02:44 +08:00
aea37272ea merge master 2019-07-10 23:16:39 +08:00
2f17d37f7b add v tag for gvalid; add p tag for ghttp; add c tag for gconv 2019-07-10 23:04:04 +08:00
df8623c4e2 Merge pull request #3 from gogf/master
sync master
2019-07-10 10:30:21 +08:00
5c9766fb1b Merge pull request #235 from jroam/master 2019-07-09 21:04:37 +08:00
a3d2e03425 merge master 2019-07-09 15:49:09 +08:00
717dae8f5d improve unit test cases for gpool 2019-07-09 15:41:50 +08:00
373dbde42c version updates 2019-07-09 15:36:04 +08:00
125af33941 gvalid and gfcache test 20190709 15:06 2019-07-09 15:10:02 +08:00
b43e36a79d improve configuraion style for gdb 2019-07-09 15:08:26 +08:00
145fccdf6e improve configuraion style for gdb 2019-07-09 14:50:56 +08:00
f9c478f250 improve package feature for gtcp 2019-07-09 14:03:43 +08:00
5da822fdc4 add some garray unit tests 2019-07-09 13:41:38 +08:00
5abf1b5742 Merge branch 'feature_1.8.0' of https://github.com/gogf/gf into feature_1.8.0 2019-07-09 13:27:34 +08:00
9ac3841342 add time.Duration parameter support for gfcache 2019-07-09 13:19:28 +08:00
1f315c5b8d add time.Duration parameter support for gcache 2019-07-09 13:15:53 +08:00
b9440587d0 add Offset function for gdb.Model; improve schema changing feature for gdb 2019-07-09 12:50:38 +08:00
835a971f89 add slice parameter support for method operations for gdb 2019-07-09 12:04:24 +08:00
0bba2092af add one slice passing all parameters support for gdb.Model.Where 2019-07-09 11:34:45 +08:00
c3240218f8 merge master 2019-07-09 11:11:49 +08:00
9e392985b8 Merge branch 'feature_1.8.0' of https://github.com/gogf/gf into feature_1.8.0 2019-07-09 11:11:03 +08:00
a7d30dd1d5 improve gfile 2019-07-09 11:02:33 +08:00
fa96d881e1 Merge pull request #232 from skiy/feature-filecopy 2019-07-09 10:55:11 +08:00
9ca9d6c4bd add Cause function for gerror 2019-07-09 10:40:26 +08:00
7ad66db491 README updates 2019-07-09 10:27:47 +08:00
1dbda3872b README updates 2019-07-09 10:25:59 +08:00
3619a46f52 README updates 2019-07-09 10:23:25 +08:00
6a93d166c5 improve gjson/gparser/gvar/gcfg with adding more converting functions 2019-07-09 09:43:53 +08:00
c84e62febe add morte unit test cases for gdb.Model 2019-07-09 08:47:23 +08:00
8ff21d6936 adding support of slice parameters for gdb.Model.Where 2019-07-09 08:40:28 +08:00
3b0012ec30 fix issue in gbase64.Decode 2019-07-09 08:07:50 +08:00
62a3f1693d add some garray tests 2019-07-08 23:25:47 +08:00
ed6796dde0 Update garray_z_unit_string_test.go 2019-07-08 17:53:57 +08:00
46721d7552 update garray unit tests. 2019-07-08 17:34:32 +08:00
a9a5a78e02 Merge pull request #39 from gogf/master
日常更新
2019-07-08 16:04:20 +08:00
7c4431ceeb add copyfile & copydir test 2019-07-08 11:37:02 +08:00
8cfdc8f27f file and folder copy 2019-07-08 01:26:00 +08:00
691baf5c16 comment updates 2019-07-07 09:47:33 +08:00
8669057681 remove debug line 2019-07-06 21:44:31 +08:00
b439aedce5 RELEASE updates 2019-07-06 17:35:03 +08:00
2504e405a7 add sql.ErrNoRows feature for querying of gdb 2019-07-06 17:13:17 +08:00
6426409bf9 add debug configuration support for gdb 2019-07-06 16:51:50 +08:00
9cf4ea5c91 rename Priority to Weight for gdb 2019-07-06 16:14:45 +08:00
86343abcf8 merge master 2019-07-06 16:02:05 +08:00
d0fe2d2f75 fix issue in gdb.Model.Scan 2019-07-06 15:51:32 +08:00
49ef4fd266 add more example for gconv.Map 2019-07-06 15:02:02 +08:00
929a57ceb8 add Structs/StructsDeep function for gconv; add auto-creating struct/struct pointer for gconv.Struct function when parameter pointer is typeof **struct 2019-07-06 11:10:32 +08:00
c6f94ed95a Update garray_z_unit_string_test.go 2019-07-05 15:27:56 +08:00
949ac459fc Update garray_z_unit_string_test.go 2019-07-05 15:07:28 +08:00
32fc6868aa Merge pull request #2 from gogf/master
sync master
2019-07-05 08:58:19 +08:00
82394cd70e Update garray_z_unit_string_test.go 2019-07-04 22:49:50 +08:00
4670a5d2e2 TODO++; version updates 2019-07-04 19:22:11 +08:00
273d992493 fix issue in gfsnotify in recursive inotify watcher registering 2019-07-04 19:06:06 +08:00
1c71340719 gfcache test 20190704 15:00 2019-07-04 15:03:56 +08:00
ed61c2ee22 improve gconv.Map for priority tags 2019-07-04 14:27:43 +08:00
363dede57c gvalid test 20190704 11:16 2019-07-04 11:19:59 +08:00
b29c6add47 rename internal/structtag to internal/structs; add more feature for internal/structs; improve gvalid to support recursive validation for struct; improve gconv.Struct/Map functions 2019-07-04 11:11:41 +08:00
8d01e565c5 gfsnotify example updates 2019-07-03 22:27:50 +08:00
47e0fb95d5 add package internal/structtag; improve ghttp.Request.Get*ToStruct functions to support substruct with 'param' tag; improve gtest.compareMap; improve gconv.Map using internal/structtag 2019-07-03 22:09:35 +08:00
23d346b291 improve gdb.Model.Struct/Structs/Scan in error handling, it returns sql.ErrorNoRows if no records received after querying 2019-07-03 19:38:52 +08:00
105cdf6fe6 20190703 14:25 2019-07-03 14:28:20 +08:00
5135264d56 Merge branch 'develop' of https://github.com/gogf/gf into develop 2019-07-03 14:25:49 +08:00
c3ff1a3db3 merge master 2019-07-03 14:25:29 +08:00
d62c1dedf3 Merge pull request #1 from gogf/master
sync master
2019-07-03 11:03:54 +08:00
bd105a188f Merge pull request #38 from gogf/master
日常更新
2019-07-03 10:29:43 +08:00
09affd3981 update tests 2019-07-03 10:20:40 +08:00
8e7e18e22d update test 2019-07-03 10:17:17 +08:00
e03fd80fd4 sync gf master 2019-07-03 10:02:17 +08:00
adc3201dcf Update garray_z_unit_string_test.go 2019-07-03 09:39:16 +08:00
3a681e5b1a Update garray_z_unit_string_test.go 2019-07-03 09:21:37 +08:00
c90ed0d424 comment updates for gfsnotify 2019-07-02 23:57:49 +08:00
418cbb420b TODO updates; version updates 2019-07-02 23:48:38 +08:00
c948f0c287 improve gdb.Update/Delete feature to support orderby/limit features 2019-07-02 23:14:40 +08:00
285b45d19d Update garray_z_unit_string_test.go 2019-07-02 22:37:06 +08:00
783f1c8457 Update garray_z_unit_string_test.go 2019-07-02 22:27:31 +08:00
daa7f12994 Update garray_z_unit_string_test.go 2019-07-02 22:22:51 +08:00
e63e989d41 fix issue of dead lock in gcache.doSetWithLockCheck 2019-07-02 19:22:06 +08:00
31921905a9 update unit test cases for gaes because of changes of gbase64 2019-07-02 17:40:16 +08:00
5572ab858e improve gbase64 2019-07-02 17:30:18 +08:00
961ca0879d improve gbase64 2019-07-02 16:56:10 +08:00
5d464494b6 Update garray_z_unit_string_test.go 2019-07-01 22:26:20 +08:00
4ca2513d00 Merge pull request #37 from gogf/master
日常更新
2019-07-01 20:49:44 +08:00
15d69ed950 sync gf master 2019-07-01 20:41:13 +08:00
39bd2616c4 add go.sum to gitignore 2019-06-30 22:22:24 +08:00
6302789c41 improve package gerror; add support for gerror formating output in glog 2019-06-30 22:21:08 +08:00
0ff31012c8 donator updates 2019-06-30 19:31:18 +08:00
5c7b25c960 add some tests 2019-06-30 13:03:22 +08:00
10102f2db9 improving gerror 2019-06-30 12:54:06 +08:00
6f5b5e4dc2 Update garray_z_unit_int_test.go 2019-06-30 12:52:30 +08:00
007c8a7b64 Merge branch '完善garray测试' 2019-06-30 12:44:57 +08:00
009ce9063e improve gerror/glog 2019-06-29 23:35:32 +08:00
58a405bfa8 add package gerror; improve internal/debug,glog package 2019-06-29 18:17:33 +08:00
42214f17fc Update garray_z_unit_int_test.go 2019-06-29 18:16:40 +08:00
b5f117e932 Merge branch '完善garray测试' of https://github.com/jroam/gf into 完善garray测试 2019-06-29 17:58:24 +08:00
b0f158047c Update garray_z_unit_int_test.go 2019-06-29 17:48:44 +08:00
d5f7ca634d add package internal/debug; add gutil.Stack/PrintStack; rename Backtrace to Stack for glog 2019-06-29 10:45:50 +08:00
aa6110c619 Merge branch 'master' of https://github.com/gogf/gf 2019-06-27 14:33:57 +08:00
a9660fe9fa add valid tag for gvalid 2019-06-27 14:33:39 +08:00
0801245871 sync gf master 2019-06-27 10:35:56 +08:00
278fd3515f edit garray of tests 2019-06-27 10:21:49 +08:00
56588f3f7f add some garray unit tests 2019-06-26 23:29:47 +08:00
a5d01cb547 sync gf master 2019-06-26 23:08:36 +08:00
fabf5d1ad5 Update gmd5.go 2019-06-26 22:57:03 +08:00
ebae3a4929 Update gudp_conn.go 2019-06-26 22:55:19 +08:00
8e6640ed79 Merge pull request #199 from pibigstar/master 2019-06-26 22:50:43 +08:00
e4c42bde89 edit some imports 2019-06-26 22:42:05 +08:00
f7515edde9 Merge pull request #36 from gogf/master
improve ghttp.Client
2019-06-26 22:02:43 +08:00
2b0da75412 improve ghttp.Client 2019-06-26 13:55:23 +08:00
04c422c3af Merge branch 'master' into 完善garray测试 2019-06-26 10:00:40 +08:00
339ca74ff4 Merge branch 'master' of https://github.com/gogf/gf into gogf-master 2019-06-26 09:59:00 +08:00
741a13379a edit some garray inut tests 2019-06-26 09:53:41 +08:00
da907f35bd improve group router for ghttp 2019-06-25 23:26:47 +08:00
133531b6a0 README updates 2019-06-25 23:17:14 +08:00
5fa0f8dd7e up 2019-06-25 23:06:12 +08:00
7247413a48 Merge branch 'master' of https://github.com/gogf/gf 2019-06-25 23:03:39 +08:00
591158adc5 improve router registry for ghttp 2019-06-25 23:03:29 +08:00
5d83383105 Merge pull request #212 from hailaz/master 2019-06-25 23:02:06 +08:00
5ad809f49e vet the go format 2019-06-25 19:26:02 +08:00
56a62bb4c2 gofmt 2019-06-25 19:01:27 +08:00
afb4a233be Merge pull request #215 from 2892931976/gf-chj 2019-06-25 19:00:02 +08:00
c0aebe023c remove example codes for gcanner 2019-06-25 18:40:55 +08:00
055c6a668e add some garray tests 2019-06-25 18:17:10 +08:00
735c5fc7ed add some garray tests 2019-06-25 16:32:12 +08:00
c066fff971 仓库位置更改 2019-06-25 16:03:14 +08:00
89373ebcd6 增加代码风格检查 2019-06-25 16:03:14 +08:00
51cf232691 gutil test 20190615 15:47 2019-06-25 15:50:06 +08:00
3bfff2347f Merge branch 'master' into 完善garray测试 2019-06-25 09:34:17 +08:00
7d83604540 Merge branch 'pr/34' 2019-06-25 09:26:30 +08:00
f25571a0a9 Improve gmlock, gmutex, grpool, gmutex unit testing sleep time. 2019-06-24 19:34:53 +08:00
05c7ba5f29 improve ghttp.CORSDefault 2019-06-24 19:05:07 +08:00
dcf7772589 Improve gmlock, gmutex unit testing sleep time. 2019-06-24 18:04:35 +08:00
3806f9db07 Improve gflock unit testing. 2019-06-24 17:33:56 +08:00
0f14002b05 Improve gflock unit testing. 2019-06-24 17:17:24 +08:00
1bf53d8b89 Improve gflock unit testing. 2019-06-24 17:15:46 +08:00
8eb10a58ad Improve gflock. 2019-06-24 17:15:30 +08:00
9985378062 rename gmutex unit test file. 2019-06-24 15:04:33 +08:00
38ad5d457b Improve grpool unit testing. 2019-06-24 15:01:12 +08:00
ebed433dde Merge pull request #209 from guoyahao/master 2019-06-24 13:41:18 +08:00
2b02f7e210 Improve gmutex unit testing. 2019-06-24 12:50:00 +08:00
1434800982 Improve gmlock unit testing. 2019-06-24 09:27:31 +08:00
327e33b827 gutil test 20190623 20:41 2019-06-23 20:44:03 +08:00
d2a053c1d7 no message 2019-06-23 17:53:10 +08:00
abe14e049a gutil test 20190623 16:42 2019-06-23 16:45:30 +08:00
4b9db0c794 fix issue for gmd5/gcrc32 2019-06-22 23:06:44 +08:00
b118cd8f27 README updates 2019-06-22 22:06:39 +08:00
83669964f5 README updates 2019-06-22 22:06:13 +08:00
9248fd6b28 add internal/errors 2019-06-22 22:05:39 +08:00
bb935967ac add MarshalJSON function for gjson/gparser to implements the interface MarshalJSON for json.Marshal 2019-06-22 17:02:36 +08:00
b7e0f1f983 improve grpool 2019-06-22 15:05:15 +08:00
6ee6c007c5 update gmutex and its benchmark test cases 2019-06-22 14:42:27 +08:00
9a507b54d7 add Remove/Clear functions for gmlock 2019-06-22 11:45:58 +08:00
c88f516759 remove mutex usage from gflock 2019-06-22 11:29:51 +08:00
912b743a1e improve Range/SubSlice functions for garray 2019-06-22 11:03:50 +08:00
d546424f18 improve gmutex 2019-06-21 22:37:07 +08:00
fe179fff42 gofmt 2019-06-21 22:23:07 +08:00
adf2ddb510 继续完善garray的测试 2019-06-21 17:46:42 +08:00
f30c9020fa Merge branch 'master' into 完善garray测试 2019-06-21 14:08:54 +08:00
1b3073f3f9 Merge pull request #33 from gogf/master
日常更新
2019-06-21 14:05:46 +08:00
615161ac9d 继续增加garray测试 2019-06-21 14:04:52 +08:00
02e06e7c6e improve unit test cases for gmlock.Mutex 2019-06-20 09:20:41 +08:00
d15268eb22 improve codes 2019-06-20 00:04:06 +08:00
e48415d932 README updates 2019-06-19 23:58:50 +08:00
e5fa341f39 improve codes 2019-06-19 23:56:14 +08:00
234d734981 Merge pull request #201 from hailaz/master 2019-06-19 23:32:22 +08:00
d771ed9209 improve codes 2019-06-19 23:28:37 +08:00
37d72cb8b3 完善garray单元测试 2019-06-19 18:19:31 +08:00
1154f9601b Improve gmlock unit testing. 2019-06-19 17:50:50 +08:00
322513f99b Merge pull request #9 from gogf/master
同步主库
2019-06-19 15:14:58 +08:00
6e7ac60d4d README updates 2019-06-19 15:06:15 +08:00
405840607f fix issue in gmlock.Mutex.TryRLock 2019-06-19 15:04:50 +08:00
8417e7ef65 Merge branch 'gogf-master' 2019-06-19 11:44:17 +08:00
ac2fe44d8e 同步主库 2019-06-19 11:43:59 +08:00
3030d7f032 同步主库 2019-06-19 11:11:00 +08:00
dcf7138694 README updates 2019-06-19 09:09:13 +08:00
97df154b78 gofmt 2019-06-19 09:06:52 +08:00
d74034e08e Update garray_z_unit_int_test.go 2019-06-18 23:20:46 +08:00
674590e247 improve ghttp.RouterGroup 2019-06-18 22:04:17 +08:00
d41cc7c3b6 Merge pull request #32 from gogf/master
日常更新
2019-06-18 21:45:01 +08:00
ab48800401 improve gaes 2019-06-18 20:58:47 +08:00
ea456c5faa DONATOR updates 2019-06-18 20:52:24 +08:00
83d1442781 change strings.ReplaceAll to strings.Replace to adapt go1.11 2019-06-18 19:44:28 +08:00
5888b0e06a fix issue in gmlock 2019-06-18 19:19:43 +08:00
3120d0bd7a Merge pull request #6 from gogf/master
同步主库
2019-06-18 17:58:47 +08:00
a7dcc2c9c6 improve gmlock 2019-06-18 17:39:28 +08:00
17898cc747 improve gmlock 2019-06-18 17:31:48 +08:00
7bebf062be Improve gmlock unit testing. 2019-06-18 11:46:43 +08:00
048c3d5025 Merge pull request #195 from zseeker/master
gaes encryption and decryption add CFB mode
2019-06-18 11:44:54 +08:00
0adcdc6b4a Merge pull request #192 from jroam/master 2019-06-18 11:42:44 +08:00
19d7ad734b Update gqueue_unit_test.go 2019-06-18 11:20:10 +08:00
6c657dff37 Merge pull request #5 from gogf/master
同步主库
2019-06-18 09:12:16 +08:00
78ccbeac3b add Cas function for gtype; improve gmlock 2019-06-18 08:37:21 +08:00
2a0eae8975 gaes encryption and decryption add CFB mode 2019-06-18 04:07:35 +08:00
28d25e7812 Update gqueue_unit_test.go 2019-06-17 23:16:22 +08:00
fe795d49f3 fix gfile test of a bug
fix  gfile test of bug
2019-06-17 22:46:36 +08:00
9fad898ee3 Update gqueue_unit_test.go 2019-06-17 22:03:41 +08:00
9a42142ce7 Merge branch 'master' of https://github.com/gogf/gf into gogf-master2 2019-06-17 21:51:38 +08:00
9db8ed2dfc README updates 2019-06-17 20:34:45 +08:00
619a539f2e update unit test cases for gfpool 2019-06-17 20:21:41 +08:00
ae8eb4a1f1 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-06-17 20:20:25 +08:00
9a469e64da Merge pull request #187 from goflyfox/master 2019-06-17 20:19:58 +08:00
f7d1613d62 improve gqueue 2019-06-17 19:54:00 +08:00
80655bce50 add gfpool test:delete error 2019-06-17 18:39:27 +08:00
b3b0ba775c update gfpool test:error 2019-06-17 18:09:56 +08:00
4713739d1a update gfpool test:delete err 2019-06-17 17:52:10 +08:00
53b5de330e Update gqueue_unit_test.go 2019-06-17 11:40:40 +08:00
fd4843c3a1 Update gqueue_unit_test.go 2019-06-17 11:31:03 +08:00
97d2b9e1f9 Update gqueue_unit_test.go 2019-06-17 11:04:56 +08:00
5896dadaad Merge pull request #4 from gogf/master
同步主库
2019-06-17 09:20:58 +08:00
0ab60cb770 Update gqueue_unit_test.go 2019-06-16 23:26:49 +08:00
5b71e92776 Update gqueue_unit_test.go 2019-06-16 23:24:03 +08:00
211678c7d3 Merge branch 'master' into 测试gqueue 2019-06-16 23:16:18 +08:00
d25793ed03 Merge pull request #30 from gogf/master
fix issue in gqueue.Close
2019-06-16 23:14:02 +08:00
98cae011a5 fix issue in gqueue.Close 2019-06-16 23:10:50 +08:00
59ae6f9c10 Merge pull request #29 from gogf/master
日常更新
2019-06-16 23:06:59 +08:00
474d1669d9 fix issue in gqueue.Close 2019-06-16 23:00:47 +08:00
563a1408ea fix issue in gqueue.Close 2019-06-16 23:00:00 +08:00
168c08a6f6 Create gqueue_unit_test.go 2019-06-16 22:55:07 +08:00
82783072ef Merge pull request #28 from gogf/master
fix issue in gqueue.Close
2019-06-16 22:22:12 +08:00
11972ef96c fix issue in gqueue.Close 2019-06-16 22:19:59 +08:00
468ba21283 Merge pull request #27 from gogf/master
日常更新
2019-06-16 22:06:39 +08:00
78b0cae892 先取消本地测试 2019-06-16 22:05:15 +08:00
866482a8e8 fix issue in gqueue.Close 2019-06-16 21:52:41 +08:00
c342310389 add example for garray/gchan/glist 2019-06-16 20:38:05 +08:00
0eb028f0b5 README updates 2019-06-16 20:25:08 +08:00
4ffe4f2262 add returned error for ghttp.ClientResponse.Close 2019-06-16 18:54:48 +08:00
677549ec15 add some gqueue tests 2019-06-16 16:41:12 +08:00
68d8e25bc4 update gfpool test2 2019-06-16 00:07:06 +08:00
4f007fdd44 update gfpool test 2019-06-16 00:04:46 +08:00
54392941f3 add gfpool normal test 2019-06-15 23:45:58 +08:00
ebdad47f2d Merge pull request #181 from goflyfox/master 2019-06-15 23:00:47 +08:00
cb4e36f591 update rwmutex test2 2019-06-15 22:19:37 +08:00
cd30efaaa1 update gcmd test 2019-06-15 22:11:08 +08:00
7c234e0437 golint for gvar 2019-06-15 22:06:47 +08:00
d973c5d5c7 improve communication feature for gproc 2019-06-15 21:41:20 +08:00
a7f15a4e00 change gqueue unit tests 2019-06-15 21:40:36 +08:00
6b5484bf55 Merge branch 'master' into develop 2019-06-15 20:42:48 +08:00
ab38b709b2 add gqueue tests 2019-06-15 18:44:22 +08:00
4118038198 Merge branch 'master' into 测试gqueue 2019-06-15 18:36:54 +08:00
142154c0df add gqueue unit tests 2019-06-15 18:35:36 +08:00
07ae90d64d Merge pull request #26 from gogf/master
日常更新
2019-06-15 18:34:50 +08:00
8a69fd09fc Merge pull request #185 from hailaz/master 2019-06-15 18:34:34 +08:00
c02f502bd8 fix issue in gqueue.Size 2019-06-15 18:30:09 +08:00
d5d6b8c303 comment unused gbtree.BTree.isFull function 2019-06-15 18:03:07 +08:00
5c592afebe Improve gtree unit testing. 2019-06-15 17:51:48 +08:00
8402a2b710 Merge pull request #3 from gogf/master
同步主库
2019-06-15 16:57:46 +08:00
fe152dfa63 comment updates for gtree; fix issue in gtree.AVLTree.Remove 2019-06-15 16:53:36 +08:00
e695983d4d improving gproc 2019-06-15 16:07:36 +08:00
a5ab2ba332 gutil test 2019 06 15 14:20 2019-06-15 14:23:28 +08:00
c6e5a52104 add test file 2019-06-14 23:47:00 +08:00
1b4a879eda Merge pull request #182 from jroam/master 2019-06-14 23:09:33 +08:00
c5aa493d24 README updates 2019-06-14 20:42:15 +08:00
a88363e34c Merge branch '测试glist' 2019-06-14 14:58:33 +08:00
0f1261d0e3 完成glist测试率 2019-06-14 14:58:00 +08:00
c41d11df9f Merge pull request #25 from gogf/master
fix更新
2019-06-14 10:50:05 +08:00
1e680c7a8b fix issue in gcache 2019-06-14 10:44:56 +08:00
e981143ead fix issue in gspath 2019-06-14 10:35:12 +08:00
3e2d5e0bdb update mutex test2 2019-06-14 10:28:24 +08:00
1f19ed71aa update mutex test 2019-06-14 10:20:15 +08:00
4de6881c89 Merge pull request #24 from gogf/master
日常更新
2019-06-14 10:00:18 +08:00
5baa82da8f add gcmd test 2019-06-14 00:35:18 +08:00
48f610a216 add mutex and rwmutex test 2019-06-14 00:03:13 +08:00
e4e58791a6 add empty test 2019-06-13 23:50:12 +08:00
46c42ec249 add unit test cases for cmdenv/gcmd 2019-06-13 22:58:58 +08:00
d068c1418e Merge branch 'master' into develop 2019-06-13 22:40:20 +08:00
41db3a32f4 Merge pull request #180 from jroam/master 2019-06-13 22:37:19 +08:00
b3a00becf3 sort_int恢复成主库代码 2019-06-13 22:18:45 +08:00
d1d8cd8482 用gofmt格式化代码 2019-06-13 21:44:14 +08:00
1228907d59 comment updates for internal 2019-06-13 21:14:46 +08:00
57b54414d6 merge master 2019-06-13 21:00:14 +08:00
548a0c47af README updates 2019-06-13 20:52:36 +08:00
4934564b7b Merge pull request #179 from hailaz/master 2019-06-13 20:32:07 +08:00
7348d14fef shut error printing in unit test cases for gcfg/gview 2019-06-13 20:29:40 +08:00
9cddb7ed9a improve unit test cases for gparser 2019-06-13 20:21:18 +08:00
8c84de3f73 improve unit test cases for gparser 2019-06-13 20:20:43 +08:00
96529a4c1c update unit test cases for gjson/gcfg/gcompress/gparser 2019-06-13 19:41:43 +08:00
c7a729fe06 Merge branch 'master' of https://github.com/gogf/gf 2019-06-13 19:29:19 +08:00
23d404f681 add glog.Expose for glog; add Trim operation for glog.Logger.Write; fix issue in gjson.Remove for slice 2019-06-13 19:29:09 +08:00
887aeee2d4 Merge pull request #178 from piaohao/master 2019-06-13 19:09:55 +08:00
622dbfda31 完成garray测试覆盖率,达90%. 2019-06-13 17:02:30 +08:00
80cf3e833b 非test文件 恢复 原样 2019-06-13 12:41:20 +08:00
d305d25935 gparse测试用例 2019-06-13 12:30:35 +08:00
81502cfb6d gjson,gredis测试用例编写 2019-06-13 11:58:43 +08:00
5950a3fcc3 gpool unit test. 2019-06-13 11:42:51 +08:00
55f5e6d7aa improve gcharset 2019-06-12 23:50:37 +08:00
e2070e785c Merge pull request #23 from gogf/master
bug更新
2019-06-12 22:58:08 +08:00
905d5abed6 Merge pull request #171 from hailaz/master 2019-06-12 22:56:39 +08:00
211e06d04d Merge branch 'master' of https://github.com/gogf/gf into gogf-master 2019-06-12 22:56:23 +08:00
7aaf9e9228 fix issue in garray.Contains/New*ArrayFromCopy 2019-06-12 22:45:13 +08:00
a901e7177c 添加garray测试未完成 2019-06-12 22:37:17 +08:00
afc2bcfb28 gjson测试用例完善 2019-06-12 22:14:31 +08:00
8da204fbd8 remove test file of gchan 2019-06-12 21:10:49 +08:00
5aa3212fe1 gofmt geg/third 2019-06-12 21:06:57 +08:00
17d49510c4 add example for gcharset; fix issue in gxml 2019-06-12 21:02:00 +08:00
4af8ae1470 Merge branch 'master' of https://github.com/gogf/gf 2019-06-12 20:50:27 +08:00
3a5c660693 refract gcharset 2019-06-12 20:49:40 +08:00
9e65100a06 gcompress,gcfg,gparser模块测试用例编写 2019-06-12 19:22:02 +08:00
399e47c548 修改测试 2019-06-12 18:14:54 +08:00
abdf8e696c gtype unit test use AssertEQ replace Assert. 2019-06-12 17:52:30 +08:00
4a2e217625 Merge pull request #175 from 2892931976/gf-chj 2019-06-12 17:47:54 +08:00
52d0280137 Merge pull request #157 from wenzi1/master 2019-06-12 17:42:11 +08:00
5be9765eb7 add TODO for gfile.Search 2019-06-12 17:40:50 +08:00
cdb9488752 edit tests 2019-06-12 17:14:08 +08:00
0388113870 Merge branch 'master' of https://github.com/gogf/gf into gogf-master 2019-06-12 17:04:11 +08:00
c6dfb4d4f8 add some test 2019-06-12 16:52:02 +08:00
4a40b58b63 框架中增加字符集转换的标准库 2019-06-12 12:12:00 +08:00
407068a0bf add ghash basic test 2019-06-12 11:33:30 +08:00
165330ec68 gchan unit test 2019-06-12 11:21:10 +08:00
6e7d08fbfb fix issue in garray.Search 2019-06-12 10:11:54 +08:00
1ae77f56e5 添加garray测试代码 2019-06-11 23:32:08 +08:00
fccac04980 donator updates 2019-06-11 21:19:32 +08:00
469f9c7ce5 comment update for gflock 2019-06-11 21:14:48 +08:00
d6d37248f6 框架中增加字符集转换的标准库 2019-06-11 21:09:03 +08:00
cb1084b770 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-06-11 20:59:17 +08:00
e6d4459992 comment update for gcache 2019-06-11 20:57:43 +08:00
1afb5a4bc5 框架中增加字符集转换的标准库 2019-06-11 19:41:26 +08:00
c124f172b2 Merge pull request #170 from piaohao/master 2019-06-11 19:32:57 +08:00
dbd4a7c1d4 框架中增加字符集转换的标准库 2019-06-11 19:28:24 +08:00
a4d30ef206 Merge branch 'qiangg_comment' into develop 2019-06-11 18:40:56 +08:00
0a616173ef add hash function for gview.ParseContent to improve performance in consurrent usage 2019-06-11 18:39:54 +08:00
597f210f85 去掉自动版本号 2019-06-11 18:11:47 +08:00
24bd83feb0 添加一些garray测试代码。 2019-06-11 18:11:17 +08:00
3855786905 gtype unit test 2019-06-11 17:49:29 +08:00
1f670a1ab2 gspath模块及gview模块测试用例编写 2019-06-11 17:49:05 +08:00
d97fda794c 框架中增加字符集转换的标准库 2019-06-11 17:25:30 +08:00
c034d25299 gspath模块及gview模块测试用例编写 2019-06-11 17:24:26 +08:00
dd6152fe8a 使用encoding库做字符集转换 2019-06-11 16:03:09 +08:00
485fe572ff 完成gset模块测试覆盖率90%以上。 2019-06-11 10:51:00 +08:00
15bf5d9a4d Merge pull request #2 from gogf/master
同步主线
2019-06-11 10:37:53 +08:00
08aa7c4e4c comment update for gcache 2019-06-10 23:54:40 +08:00
442c658be0 增加gset的测试支持
覆盖率达到85.1%
2019-06-10 23:38:19 +08:00
5aa8ce1c6b Merge branch 'master' into qiangg_comment 2019-06-10 23:09:32 +08:00
ad8ece68c6 Merge pull request #166 from zhongdalu/master 2019-06-10 23:03:27 +08:00
74525ba8f7 Merge pull request #164 from goflyfox/master
add gregex,gaes,gcrc32 test
2019-06-10 23:01:26 +08:00
46d46afaaf add gaes test:update assert type 2019-06-10 22:42:46 +08:00
13eb1150a5 fix issue in gfile.MainPkgPath 2019-06-10 21:32:40 +08:00
f98db6d21c comments for gcache update 2019-06-10 21:23:49 +08:00
zdl
c695dfd92e delete go version 2019-06-10 20:52:06 +08:00
zdl
ffd78d76e1 添加 genv 测试 1 2019-06-10 20:44:30 +08:00
zdl
e479c41667 添加 genv 测试 2019-06-10 20:24:11 +08:00
9f8c481992 Merge pull request #167 from piaohao/master 2019-06-10 20:21:41 +08:00
3320d12994 gcache测试用例完善 2019-06-10 19:58:00 +08:00
be6f522cf3 add gaes test4:optimize Encrypt Decrypt test 2019-06-10 19:53:07 +08:00
zdl
b0b6871bbb 添加 genv 测试 2019-06-10 19:50:45 +08:00
59ae6217cd add gaes test3: add encrypt assert content 2019-06-10 19:37:02 +08:00
334cd7ad51 add gregex test 2019-06-10 18:59:42 +08:00
501c3680d9 add gaes test 2019-06-10 17:26:32 +08:00
ebcc81c1ee Merge pull request #19 from gogf/master
日常更新
2019-06-10 16:12:51 +08:00
6814372a89 add gcrc test2 2019-06-10 15:55:43 +08:00
zdl
d5d14b7efc test gset TestSet_New 2019-06-10 15:49:43 +08:00
3a72686774 add gcrc test 2019-06-10 15:05:11 +08:00
aa73c5ed53 version updates 2019-06-10 09:01:19 +08:00
cc0a385c22 RELEASE updates 2019-06-09 11:56:58 +08:00
0b8c9713e6 improve grpool 2019-06-09 10:37:35 +08:00
e400a94ffb improving grpool 2019-06-09 10:33:16 +08:00
136ad3b0b5 add more unit test cases for hook feature of ghttp.Server 2019-06-08 19:38:46 +08:00
f9826104d8 improve gconv 2019-06-08 19:25:20 +08:00
c0c97b76fb update lead string position for glog 2019-06-07 23:00:34 +08:00
a908e4d4b1 fix issue in session initialization for ghttp.Server 2019-06-07 22:27:37 +08:00
e5c255200c 框架中增加字符集转换的标准库 2019-06-06 15:19:18 +08:00
00db4f5ed9 优先使用标准库的左字符集转换,标准库不支持的使用mahonia做转换 2019-06-06 15:11:32 +08:00
29ead3ff3e Merge pull request #4 from gogf/master
update
2019-06-06 14:52:12 +08:00
055074246e add TryLockFunc/TryRLockFunc for gmlock.Mutex 2019-06-05 23:50:24 +08:00
4bbe51fb4b add Close function for gtcp.Server/gudp.Server 2019-06-05 22:12:22 +08:00
841224372b update comment for gmlock 2019-06-05 21:58:27 +08:00
d1f0fa1a47 fix issue in concurrent safety for gview.Parse; rename glog.*fln functions to glog.*f 2019-06-05 20:22:57 +08:00
6fecf8bb01 update example 2019-06-05 18:41:11 +08:00
6d44f02a38 fix issue in internal/empty 2019-06-05 18:40:26 +08:00
1458e486d7 v1.6.17 2019-06-04 23:39:33 +08:00
dc29822e69 improve gtcp; add tls support for gtcp 2019-06-04 23:33:46 +08:00
dae7722da1 Merge branch 'master' into develop 2019-06-04 18:35:06 +08:00
16d978dc58 fix issue in gfile.MainPkgPath 2019-06-04 18:30:02 +08:00
5d3c154b45 improve gtcp 2019-06-04 18:26:32 +08:00
00a8ef63b6 improve gtcp 2019-06-03 23:53:59 +08:00
6ac437a3a5 merge master 2019-06-03 21:33:16 +08:00
33b24eba01 Merge pull request #147 from jroam/master 2019-06-03 21:00:26 +08:00
3a99c6e5f5 improve TryCatch function for gutil 2019-06-03 20:58:30 +08:00
4c5d2839bd donators updates 2019-06-03 20:34:19 +08:00
85b104bafa update benchmark test cases for gregex 2019-06-03 16:59:33 +08:00
74e5d03a78 Modify documentation 2019-06-03 16:55:18 +08:00
cc43324ede modify some instructions. 2019-06-03 16:41:27 +08:00
e4f9e1000d fix issue in status handler for ghttp.Server 2019-06-03 16:39:45 +08:00
62829b0698 modify some instructions 2019-06-03 16:39:39 +08:00
2551e990cb add gtime formats of 'U' 2019-06-03 16:30:34 +08:00
45c34319b5 Merge pull request #18 from gogf/master
日常更新
2019-06-03 09:28:29 +08:00
75dcc566b3 improve grpool to ensure atomicity for function Add 2019-06-03 09:09:40 +08:00
4f1047e853 add KeepAlive configuration for ghttp.Server 2019-06-02 22:19:52 +08:00
79f765c961 update example for gconv 2019-06-02 16:34:31 +08:00
eead2fad2c version updates 2019-06-02 13:46:05 +08:00
455c9e09ab README updates 2019-06-02 13:45:21 +08:00
4665c3565c README updates 2019-06-02 13:44:24 +08:00
7456b4b4ad README updates 2019-06-02 13:43:11 +08:00
32a6454065 README updates 2019-06-02 13:40:42 +08:00
c52640c672 README updates 2019-06-02 13:32:03 +08:00
d62ef17290 improve glog 2019-06-01 22:36:12 +08:00
216af6a662 updates glog 2019-06-01 20:34:57 +08:00
35d860427e add GetLastSql function for gdb 2019-06-01 20:31:29 +08:00
9206574bae add json tag most priority for gjson.New 2019-06-01 20:01:45 +08:00
9c6f54131f updates unit test cases for gdb,grpool 2019-06-01 19:37:00 +08:00
d67b95c593 add async logging feature for glog 2019-06-01 19:34:03 +08:00
2bf2f1b822 improve grpool 2019-06-01 15:11:32 +08:00
9ad94eccad add json output support for glog 2019-06-01 11:01:57 +08:00
6e8a900f25 fix issue in gjson/gparser in loading xml content; add *time.Time support for gdb 2019-06-01 00:02:05 +08:00
d9aa9e4480 improve grpool 2019-05-31 22:54:57 +08:00
fe74818a37 Merge pull request #3 from gogf/master
update
2019-05-29 16:32:20 +08:00
7335126064 mark deprecated for *fln functions of glog; fix issue in gfile.MainPkgPath in Windows 2019-05-29 15:18:12 +08:00
945dd71251 TODO updates 2019-05-29 11:53:10 +08:00
652aa29370 Merge branch 'master' of https://github.com/gogf/gf into develop 2019-05-29 11:26:27 +08:00
7034e2015e add FormatTo/LayoutTo functions for gtime; use custom ExpireFunc to close poool items when pool is close for gpool 2019-05-29 11:25:11 +08:00
0a890ad871 Merge branch 'qiangg_gdb_struct_inherit' into develop 2019-05-28 21:41:23 +08:00
b52bb1124e Merge branch 'master' into develop 2019-05-28 21:41:08 +08:00
41f33af51b add gconv.StructDeep/MapDeep functions for gconv; add struct inherit converting support for gdb 2019-05-28 21:41:00 +08:00
6b4763c7da Update README.MD
README updates.
2019-05-27 11:00:04 +08:00
be07889a45 Merge branch 'develop' into qiangg_gdb_struct_inherit 2019-05-24 20:07:20 +08:00
1b3243c09c comment update for gfile/gaes/gcrc32/gdes/gmd5/gsha1 2019-05-24 19:59:08 +08:00
fee1c9eccf Create FUNDING.yml 2019-05-24 19:24:25 +08:00
084f6c31cb comment updates for gfile 2019-05-23 21:58:04 +08:00
592bf76eb0 add browser mode support for ghttp.Client.Post 2019-05-23 21:20:46 +08:00
6f0aee1cc5 version updates 2019-05-23 20:43:09 +08:00
3575e20137 update Writer feature of glog 2019-05-23 20:34:06 +08:00
f69f529258 Merge branch 'master' into develop 2019-05-23 19:14:19 +08:00
3e7416ca7d add Skip for glog 2019-05-23 19:14:16 +08:00
cf324c5d8c Merge pull request #2 from gogf/master
update
2019-05-23 13:05:52 +08:00
9da883a50c comment updates 2019-05-23 11:49:33 +08:00
ea3e03aaba example updates for glog 2019-05-23 09:26:37 +08:00
8d9fdfeafc change parameter to unnecssary for glog.Header/Stdout; version updates 2019-05-22 21:43:56 +08:00
b2a8285ecb remove unnecessary pkg gscanner; update comment for gsmtp 2019-05-22 21:20:17 +08:00
162e8f7e51 comment updates for glog 2019-05-22 20:31:14 +08:00
6c658813cd refract glog to improve performance 2019-05-22 09:19:21 +08:00
0839ea385f refract glog to improve performance; 2019-05-21 23:57:03 +08:00
68fa235412 add gjson.GetJsonMap; refract glog to improve performance; 2019-05-21 21:52:17 +08:00
417ce4b470 Merge branch 'master' into qiangg_gdb_struct_inherit 2019-05-20 18:33:45 +08:00
48deaa5f57 improving package feature for gtcp 2019-05-20 08:59:16 +08:00
e9f7b8bc0c README updates 2019-05-18 14:55:15 +08:00
e31861af2e README updates 2019-05-18 13:52:18 +08:00
1af482d950 improve gfile.MainPkgPath 2019-05-17 21:37:48 +08:00
dd2436925b remove package feature for gudp, considering UDP protocal has its own border for message handling 2019-05-17 00:17:45 +08:00
b92b69564b improve gfile.MainPkgPath 2019-05-16 23:41:09 +08:00
a4fa163333 Merge pull request #1 from gogf/master
update
2019-05-16 15:08:08 +08:00
635d228c86 adding inherit struct support for gdb 2019-05-16 13:56:49 +08:00
75725db6fb remove gmlock for print of glog; add time.Time support for gdb 2019-05-15 23:53:48 +08:00
5cd8475143 add time.Time support for convertParam function of gdb 2019-05-15 16:47:39 +08:00
5629f37939 version updates 2019-05-14 22:38:03 +08:00
08ec04d8b6 fix issue in unit test case of gredis 2019-05-14 22:37:13 +08:00
c0b46f364a version updates 2019-05-14 22:02:09 +08:00
303d03d43c Merge pull request #17 from gogf/master
日常更新。
2019-05-14 21:36:00 +08:00
8c5f74e8bb add DoVar/ReceiveVar function for gredis 2019-05-14 21:34:38 +08:00
94832262e3 version updates 2019-05-13 22:37:31 +08:00
aefbfd52e9 add more example for gtree 2019-05-13 22:37:05 +08:00
f3f0689bd4 rename LinkMap to ListMap for gmap 2019-05-13 22:26:39 +08:00
5198d4c5fc add unit test cases for gtree.AVLTree/BTree 2019-05-12 22:56:13 +08:00
123f2d3e4e remove return value from RLockFunc/LockFunc for gset 2019-05-12 21:26:01 +08:00
3c750c3c92 copy treemap logics to new file 2019-05-12 21:22:07 +08:00
17b29cd19f improve performance for Map/Keys/Values functions for gmap; add unit test cases for gtree.RedBlackTree 2019-05-12 21:11:26 +08:00
cf1077bec4 add LinkMap for gmap package 2019-05-12 20:43:52 +08:00
4e2e4e95e0 add gmap.HashMap/TreeMap/AnyAnyMap for gmap; add unit test cases for TreeMap 2019-05-11 20:47:25 +08:00
61d64e7ae4 remove gvar.VarRead 2019-05-11 18:47:35 +08:00
883797c495 fix issue in gconv 2019-05-11 18:03:49 +08:00
0113971877 version updates 2019-05-11 17:59:56 +08:00
664b0c06a6 gjson updates 2019-05-11 17:56:14 +08:00
bd4c75a98e add AVLTree container for gtee 2019-05-10 22:29:06 +08:00
d35840409b add BTree container for gtree package 2019-05-10 21:31:35 +08:00
abaef9ba87 add gtree.RedBlackTree container 2019-05-10 13:38:06 +08:00
b15d8bdd2e adding gtree.RedBlackTree 2019-05-09 22:53:42 +08:00
718997327a add default value for gcfg.Get* functions; rename gconv.TimeDuration to gconv.Duration, and do corresponding changes to caller packages 2019-05-09 17:14:24 +08:00
fdfefbb94d add default value feature for gjson/gparser; update default value type for ghttp.Request 2019-05-09 14:19:27 +08:00
2b865a55ac update gjson/gparser 2019-05-08 22:04:36 +08:00
8138215597 comments update 2019-05-08 21:03:04 +08:00
7cc0c7a1cc rename map type of gmap; rename BatchSet/BatchRemove to Sets/Removes for gmap/gcache 2019-05-08 17:21:18 +08:00
50f561dbd2 Merge pull request #16 from gogf/master
日常更新
2019-05-08 13:36:03 +08:00
4c647aaa19 refacting gmap 2019-05-07 22:28:34 +08:00
48b1d616c5 update code format for gtime 2019-05-07 10:22:50 +08:00
693c37d6d6 Merge pull request #116 from jroam/master
add some var flags gtime.format
2019-05-07 10:18:22 +08:00
d525c04826 公开几个常用功能方法 2019-05-06 15:03:14 +08:00
c170edbdfc add ghttp.Request.GetUrl to get current request URL 2019-05-06 13:52:34 +08:00
66e40155a9 add http/https scheme for log of ghttp.Server; add transport setting to ignore tls cert for ghttp.Client; version updates 2019-05-06 09:35:39 +08:00
59ad1a9b00 fix issue in incorrect every running logics of gcron.AddOnce 2019-05-05 22:57:13 +08:00
a5b536e218 去掉不常用参数e 2019-05-05 22:49:52 +08:00
0e6c2e790d copy mysql driver to third folder 2019-05-04 23:02:07 +08:00
5761e73061 优化一些参数性能 2019-05-04 18:14:05 +08:00
34c761e9db rename mysql driver from 'mysql' to 'gf-mysql' to avoid multiple imports error 2019-05-04 00:25:02 +08:00
87e3813636 remove go-sql-driver-mysql from third, add Register function to manually register 'mysql' driver 2019-05-04 00:10:02 +08:00
361ff0315c version updates 2019-05-03 17:04:42 +08:00
2bb227d058 update gtcp exxamples 2019-05-03 15:47:25 +08:00
99dc69e839 update gtcp exxamples 2019-05-03 13:28:27 +08:00
d78fde8099 edit a func's name 2019-04-30 22:31:52 +08:00
5d0c8956d6 edit some errs and fmt some codes 2019-04-30 11:45:26 +08:00
c9537af062 add package feature for gudp; gtcp updates 2019-04-29 23:54:47 +08:00
dfb5b3a8ce Merge pull request #15 from gogf/master
日常更新
2019-04-29 14:30:24 +08:00
a177e44583 edit some infos 2019-04-29 14:29:33 +08:00
7ae03729f3 add package support for gtcp 2019-04-28 23:55:23 +08:00
898ec21a25 del mod contents of 'go1.12' 2019-04-28 23:00:07 +08:00
6d7d8dec02 add var 'e' of gtime.format 2019-04-28 22:53:03 +08:00
ea7e2ec5ec remove go version limit in go.mod 2019-04-28 21:10:22 +08:00
a5b8e2aa2f add var 'w' of gtime.format 2019-04-28 18:12:43 +08:00
123333d9c2 edit some info 2019-04-27 22:59:06 +08:00
0c4fa1d96a fmt files 2019-04-27 22:50:44 +08:00
e5805e8c69 Merge branch 'master' of https://github.com/jroam/gf 2019-04-27 22:44:59 +08:00
bf2d45a012 add gtime.format var 't' 2019-04-27 22:37:36 +08:00
a7122788b1 add 'W' to gtime.format func(doing) 2019-04-26 17:52:45 +08:00
237c58f2b0 Merge branch 'master' of https://github.com/gogf/gf 2019-04-26 13:46:47 +08:00
efa23e4a1d README updates 2019-04-26 13:46:42 +08:00
c109cee7ef Merge pull request #115 from touzijiao/master
Merge pull request #115 from touzijiao/master
2019-04-26 13:44:51 +08:00
e111d39c54 测试文件 2019-04-26 10:38:27 +08:00
66306464e1 add Pop/Pops functions for gset 2019-04-26 08:57:48 +08:00
dd34ac1722 add build-in function 'eq/ne/lt/le/gt/ge' for gview to replace the same functions in stdlib 2019-04-25 23:23:24 +08:00
34cb222b33 remove temprary function map parameter for gview when parsing template file and content 2019-04-25 22:14:20 +08:00
a0276f7e81 add param 'z' to gtime.format func 2019-04-24 23:12:48 +08:00
d39ef156de garray updates 2019-04-24 22:23:32 +08:00
f464dc7fb8 add NewFrom/NewIntSetFrom/NewStringSetFrom functions for gset; add more example for gset 2019-04-24 18:52:24 +08:00
d29b27a5df add Merge/Sum functions for gset 2019-04-24 18:15:50 +08:00
5346ca9046 use golint checked 2019-04-24 18:08:10 +08:00
6d5b552bb7 add param of 'N','s' to gtime.format 2019-04-24 18:03:29 +08:00
aadc6aa504 Merge pull request #114 from proptypes/master
fix: #112
2019-04-24 14:07:37 +08:00
e8c3dfa13e fix: #112
closes #112
2019-04-24 11:31:13 +08:00
836d62f4aa Merge pull request #14 from gogf/master
日常更新
2019-04-24 09:34:50 +08:00
9eea93cc6e change param type from string to interface{} for ghttp.ClientRequest 2019-04-23 20:12:44 +08:00
308cb55b6b version updates 2019-04-23 19:44:28 +08:00
75ada78f8f remove parameter bind from ghttp.RouterGroup.Bind 2019-04-23 19:39:35 +08:00
ecd86e3a12 add layout example for package gview 2019-04-23 19:11:38 +08:00
c1aa5eb717 Merge pull request #98 from qq976739120/gmap-test
新增测试方法
2019-04-23 18:56:58 +08:00
d2fed1198b Merge pull request #110 from jroam/master
增加gtime包下,format方法能直接格式化星期的数字型的值
2019-04-23 18:54:43 +08:00
a9f9261dbd add gregex.ReplaceFuncMatch/ReplaceStringFuncMatch functions for package gregex 2019-04-23 14:15:12 +08:00
161e0d6e97 edit var name to "weekMap" 2019-04-23 09:59:13 +08:00
3efe511f42 优化星期英文值和数字值的格式化功能 2019-04-22 23:13:35 +08:00
5d04c2e50a fix issue in gfile.MainPkgPath 2019-04-22 22:33:11 +08:00
7b26b7ea4c fix issue in gstr.Chr 2019-04-22 21:37:11 +08:00
9d1063c6b2 Merge branch 'master' of https://github.com/gogf/gf 2019-04-22 15:48:16 +08:00
5ff7632d32 add support of layout feature for gview; fix issue in gstr.Chr 2019-04-22 15:47:59 +08:00
e6fb41504c 简写"w"参数的注释,增加周六值测试 2019-04-22 14:10:46 +08:00
a800f731dd 优化格式化星期值性能 2019-04-22 13:55:53 +08:00
f1a9fbb74e Merge branch 'master' of https://github.com/jroam/gf 2019-04-22 10:51:40 +08:00
cf81a73526 增加gtime包下,format能直接格式化星期的数字型的值 2019-04-22 10:51:24 +08:00
65036fffe8 Merge pull request #13 from gogf/master
日常更新
2019-04-22 10:49:28 +08:00
a69934a7e3 添加星期值的int形式 2019-04-21 19:36:06 +08:00
9400457bf2 Merge pull request #107 from wenzi1/master
add encoding package unit test
2019-04-19 18:29:11 +08:00
5060329721 Merge branch 'master' of https://github.com/wenzi1/gf 2019-04-19 17:11:10 +08:00
07ab1d60e8 add encoding package unit test 2019-04-19 17:04:43 +08:00
7377a82e19 Merge pull request #8 from gogf/master
Merge pull request #80 from wenzi1/master
2019-04-19 12:06:00 +08:00
f82e3ac808 Merge pull request #80 from wenzi1/master
增加gbinary单元测试
2019-04-18 22:50:24 +08:00
1a6cd1de04 Merge pull request #7 from gogf/master
update latest code
2019-04-18 20:22:17 +08:00
90e6f685b7 Merge pull request #12 from gogf/master
日常更新
2019-04-18 17:55:19 +08:00
0fc825dac1 add gcompress packge unit test 2019-04-18 12:34:01 +08:00
dbb27efe3e rename io to writer for glog.Logger 2019-04-18 09:11:14 +08:00
2d3d2e783e add default writer for glog to be integrated with other package; comments update for glog 2019-04-17 23:50:37 +08:00
6ae1defa35 Merge pull request #6 from gogf/master
pull
2019-04-17 16:56:18 +08:00
d55e77fb90 README updates 2019-04-17 09:50:57 +08:00
7fb9ae71e7 Merge pull request #103 from jroam/master
增加gfile模块的测试代码
2019-04-17 09:47:51 +08:00
9419555149 add BindFuncMap funtion for gview; README updates 2019-04-17 09:46:31 +08:00
ab634f8beb del some test code 2019-04-16 23:15:22 +08:00
9503b80d57 edit tempdir 2019-04-16 23:07:53 +08:00
bc870226e5 Merge pull request #11 from gogf/master
日常更新
2019-04-16 22:52:03 +08:00
7e106ae011 Merge pull request #81 from pibigstar/master
add the crypto test
2019-04-16 22:38:26 +08:00
958e00e231 fmt test code file 2019-04-16 22:14:42 +08:00
ab187d225d edit yml 2019-04-16 22:12:29 +08:00
9f5711d41d edit testpackage's name 2019-04-16 22:11:44 +08:00
cdb2773127 Merge branch 'master' into test_gfile 2019-04-16 18:35:25 +08:00
d12532ccc1 set a definite value for an assertion #66 2019-04-16 15:49:42 +08:00
53e9f05a10 make the details perfect #66 2019-04-16 15:49:42 +08:00
60e7ab95bc increase coverage for crypto #66 2019-04-16 15:49:42 +08:00
ae552e2b46 increase coverage for crypto #66 2019-04-16 15:49:42 +08:00
145b52f343 increase coverage for crypto #66 2019-04-16 15:49:42 +08:00
57b8fac0d5 add the crypto test 2019-04-16 15:49:42 +08:00
Jay
16a4a5ba46 Gmap测试修改 2019-04-16 14:28:25 +08:00
3d37c83532 Update TODO.MD 2019-04-15 23:49:47 +08:00
b02fa701b8 add test_gfile test of ci 2019-04-15 23:31:17 +08:00
37b7c82c64 Merge branch 'master' into test_gfile 2019-04-15 23:30:21 +08:00
1deb27df06 Merge branch 'master' of https://github.com/gogf/gf into gogf-master 2019-04-15 23:24:38 +08:00
84ed3d5767 add move and rename testfun 2019-04-15 23:14:48 +08:00
fc909a3db2 travis ci updates 2019-04-15 23:06:42 +08:00
2f7d4cd80d fix issue in Add function for gtype.Float32/Float64 2019-04-15 22:55:12 +08:00
03ccbf3613 edit TestStat fun 2019-04-15 22:52:19 +08:00
1868465319 edit TestTruncate fun 2019-04-15 22:47:09 +08:00
ff473e2fcc edit ci yml 2019-04-15 22:17:58 +08:00
a3c38eec86 edit ci yml 2019-04-15 22:12:28 +08:00
2015c847e8 fmt test file 2019-04-15 18:14:38 +08:00
1b583ed984 pull ci yml 2019-04-15 15:41:51 +08:00
11191c746a edit test 2019-04-15 15:34:35 +08:00
abedd3c5bf edit test 2019-04-15 15:30:44 +08:00
501ba5135b edit test 2019-04-15 15:27:49 +08:00
a76c98c348 暂时去掉search测试 2019-04-15 14:01:09 +08:00
9dcdc1a339 edit ci yml 2019-04-15 13:47:25 +08:00
6d1f386203 edit travis.yml 2019-04-15 11:49:07 +08:00
ff9bbf0a49 edit test 2019-04-15 11:41:05 +08:00
66e24c8d40 Merge branch 'master' into test_gfile 2019-04-15 11:26:11 +08:00
34f117c631 Merge pull request #9 from gogf/master
日常更新
2019-04-15 11:22:16 +08:00
21f2f16889 go test 2019-04-14 23:21:03 +08:00
f6fa7c422d 测试小调整 2019-04-14 22:41:11 +08:00
6903b84bb6 调整测试文件生成目录 2019-04-13 23:00:57 +08:00
0978b8fb4f 初步完成测试代码重构 2019-04-13 18:27:01 +08:00
d014583e88 重构测试代码中 2019-04-13 13:14:30 +08:00
a747f51b9d 重构测试代码 2019-04-12 18:15:31 +08:00
8300885ab6 Merge pull request #5 from gogf/master
update gtest
2019-04-12 17:59:02 +08:00
Jay
b489eed4ef 新增测试方法 2019-04-12 10:59:05 +08:00
0b57771d76 用fmt格式化代码 2019-04-12 09:47:55 +08:00
8a32a8271c fix issue in empty router group error of ghttp.Server 2019-04-12 00:19:15 +08:00
c3e716dafd Merge branch 'master' of https://github.com/gogf/gf 2019-04-11 23:07:28 +08:00
119a11eb8d README updates 2019-04-11 23:07:22 +08:00
e464d14842 Merge pull request #85 from qq976739120/gmap-test
Gmap 测试添加
2019-04-11 21:59:00 +08:00
Jay
905f46359a Gmap string-string 类型测试提交 2019-04-11 17:50:26 +08:00
Jay
8e7bf1f908 bug 修复 2019-04-11 17:46:19 +08:00
Jay
3a1524ae6d Gmap 初测完成 2019-04-11 17:33:52 +08:00
5c04befea3 edit ci yml file 2019-04-11 16:39:20 +08:00
ae3584cdff edit ci 2019-04-11 16:27:47 +08:00
a60578c82c edit ci 2019-04-11 16:23:29 +08:00
74558a500c edit c1 2019-04-11 16:17:44 +08:00
d963d8c8c1 testci 2019-04-11 16:13:56 +08:00
853892c24f config ci 2019-04-11 16:05:33 +08:00
641f939e3d edit test 2019-04-11 15:57:48 +08:00
af77504eaf 修改测试 2019-04-11 15:49:00 +08:00
62649d6468 config ci 2019-04-11 15:22:29 +08:00
bb914e605e 配置ci 2019-04-11 15:08:17 +08:00
62ee88bbfa Update .travis.yml 2019-04-11 14:45:47 +08:00
99c964bb4a 添加ci配置文 2019-04-11 11:02:43 +08:00
09ceaef3e9 配置ci 2019-04-11 10:59:53 +08:00
a82900af55 对分支添加ci检查 2019-04-11 10:03:47 +08:00
5ef589f31a Merge pull request #8 from gogf/master
合并前更新。
2019-04-11 09:56:01 +08:00
cd719f134d 测试率达到82.9% 2019-04-11 09:47:51 +08:00
f69eb219b5 version updates 2019-04-11 09:43:17 +08:00
0ffe17ee3d revert SearchArray/InArray functions for gstr 2019-04-11 09:26:52 +08:00
4ac647a215 gcmd updates 2019-04-11 09:05:27 +08:00
872536c035 Merge branch 'master' of https://github.com/gogf/gf 2019-04-10 23:09:59 +08:00
c7a6a6fff0 improve grand.Intn; README updates 2019-04-10 23:09:38 +08:00
2534655bc8 测试覆盖率达到76.3% 2019-04-10 22:16:16 +08:00
0cb82d70fd Merge pull request #96 from aloncn/master
update unit test for gring
2019-04-10 21:42:25 +08:00
acac5a2ad6 version updates 2019-04-10 18:33:51 +08:00
9ec15ad2ca fix issue in repeated rand value of grand.Intn 2019-04-10 18:33:12 +08:00
a9b7d56d0b 测试覆盖率达到63.1% 2019-04-10 17:54:28 +08:00
e9ca1eb538 完成第一遍功能测试 2019-04-10 16:45:33 +08:00
0532800895 添加测试代码 2019-04-10 16:22:29 +08:00
ad50ca6e60 update unit test for gring 2019-04-10 14:26:21 +08:00
c1ad999c25 添加测试 2019-04-10 13:45:42 +08:00
4accd1264d 添加内容测试 2019-04-10 13:39:36 +08:00
e1f3da3aa8 去掉mod设置的版本信息 2019-04-10 11:31:24 +08:00
4bf9a7950b Merge branch 'master' into test_gfile 2019-04-10 11:28:57 +08:00
8285c31bf1 Update unit test for gring 2019-04-10 10:44:40 +08:00
230be66fa9 update unit test for gring 2019-04-10 10:13:56 +08:00
428d7ec94a Merge pull request #1 from gogf/master
同步主库
2019-04-10 09:54:16 +08:00
2c53f934c9 Merge branch 'master' of https://github.com/gogf/gf 2019-04-10 09:50:29 +08:00
08785cb272 update unit test cases of gjson 2019-04-10 08:54:49 +08:00
bd0207c938 update unit test for gring 2019-04-10 01:16:45 +08:00
6fad737617 update unit test cases of gjson/gparser 2019-04-10 01:00:51 +08:00
af4148d985 Merge branch 'master' of github.com:aloncn/gf 2019-04-10 00:37:22 +08:00
922eaf4d42 Update unit test for gring 2019-04-10 00:37:06 +08:00
4b5153950f Add unit test for gring 2019-04-10 00:37:06 +08:00
78010d2bd7 Update unit test for gring 2019-04-10 00:22:10 +08:00
6cc0017826 测试空的断言。 2019-04-09 23:25:20 +08:00
8a9131c3dc Merge pull request #7 from gogf/master
日常更新
2019-04-09 23:16:18 +08:00
85c2ed1bf2 improve nil checks for gtest.Assert* 2019-04-09 23:12:22 +08:00
aca1df634d 添加测试文件内容相关函数。 2019-04-09 23:11:04 +08:00
053a3c1a53 add unit test 2019-04-09 19:12:48 +08:00
429aa90e0d Merge branch 'master' of github.com:aloncn/gf 2019-04-09 18:42:16 +08:00
4f792b347d Add unit test for gring 2019-04-09 18:40:48 +08:00
468c315087 Merge pull request #4 from gogf/master
update 1.6
2019-04-09 17:36:40 +08:00
6d8ced21b9 Add unit test for gring 2019-04-09 17:27:58 +08:00
b3d5fc149e add unit test 2019-04-09 17:27:11 +08:00
Jay
277b7a4536 测试修改 2019-04-09 15:06:12 +08:00
43886511b9 add unit test 2019-04-09 12:28:21 +08:00
8b3eb5b02d version&release updates 2019-04-09 00:15:48 +08:00
054ef87886 继续添加文件测试. 2019-04-08 23:13:28 +08:00
Jay
39c65d9e9a 测试添加 2019-04-08 17:49:15 +08:00
Jay
b97bbbfa3d 测试添加 2019-04-08 17:32:07 +08:00
Jay
ace6ba8096 Gmap 测试添加 2019-04-08 17:02:57 +08:00
a2b87d84e9 添加gfile测试代码,10% 2019-04-07 22:46:14 +08:00
b90d61b27c README updates 2019-04-07 22:03:04 +08:00
85606e3e7e README updates 2019-04-07 21:59:28 +08:00
1fc85d49bd gtime updates; README updates 2019-04-07 21:49:24 +08:00
a5cfb4e638 Merge pull request #82 from hailaz/master
Add gtime unit test
2019-04-07 21:27:29 +08:00
38754bf062 Merge pull request #78 from youyixiao/youyixiao_gogf
gregex_unit_test
2019-04-07 21:23:03 +08:00
f1818ed2ff 补充gtime_format的覆盖测试。 2019-04-06 23:53:06 +08:00
352ad17715 避免pr时造成gtime文件的更改。 2019-04-06 22:56:47 +08:00
e50b8d9632 移除gtime unit test中注释掉的函数。 2019-04-06 22:50:37 +08:00
2107061a46 Add gtime unit test 2019-04-06 22:48:47 +08:00
61f57b4895 update comments of gstr 2019-04-06 21:31:01 +08:00
d34273abff 同步master 2019-04-05 23:53:43 +08:00
0aff0f0362 同步master 2019-04-05 23:49:20 +08:00
68949b69bc update example of gtime 2019-04-05 23:31:14 +08:00
c56c77d3a1 fix issue in G&j char format 2019-04-05 23:13:47 +08:00
dc82ce395a comment updates for gcfg 2019-04-05 00:23:59 +08:00
fd63a2209b 增加单元测试 2019-04-04 23:31:17 +08:00
2a29483456 comment fix 2019-04-04 23:24:27 +08:00
4f10562980 remove limit for gdb.Model.One 2019-04-04 23:22:09 +08:00
a26ec37f59 Merge pull request #3 from gogf/master
更新
2019-04-04 23:17:09 +08:00
779ad93bcb 参数为nil时的特殊处理 2019-04-04 23:02:00 +08:00
1ec0219473 add gbinary unit tests 2019-04-04 23:00:21 +08:00
6863928b06 !18 限制下查询单条记录查询条数
Merge pull request !18 from 一墨染尽青衣颜/master
2019-04-04 22:55:13 +08:00
aa4dca11f0 fix issue in gtime; update comment for g/gtest 2019-04-04 22:52:56 +08:00
dc6ab820ce 修复解析日期函数(parseDateStr)对"02.jan.2006"格式日期解析异常的问题。
更正函数(isNumeric)的注释。
2019-04-04 17:57:17 +08:00
be0fa4d60b gregex_unit_test 2019-04-04 17:45:04 +08:00
a86d2272af gregex_unit_test 2019-04-04 16:15:50 +08:00
61a67892ac Merge pull request #6 from gogf/master
同步最新代码
2019-04-04 11:37:58 +08:00
388d5954cb Merge pull request #2 from gogf/master
update unit test
2019-04-04 10:56:01 +08:00
08550d413e update unit test cases for gcfg 2019-04-04 09:18:43 +08:00
b89294561b add gmap.SetIfNotExistFunc/SetIfNotExistFuncLock for gmap; update comment of gmap; update instance feature of gcfg 2019-04-03 23:39:31 +08:00
20977558cc Merge pull request #1 from gogf/master
更新代码
2019-04-03 16:47:16 +08:00
630d8fdb43 add Instance function for gcfg 2019-04-03 09:59:15 +08:00
c4c7e6caf4 gofmt 2019-04-03 00:03:46 +08:00
8a8fea1257 v1.5.23 2019-04-02 23:40:20 +08:00
0e0f297a3f add consurrent safety parameter for gjson.Load/LoadContent; fulfil data type auto-check logics for gjson.LoadConetnt; update comment of gjson/gparser 2019-04-02 23:33:27 +08:00
fd2c0f2b24 Merge pull request #59 from wenzi1/master
修复gxml字符集转换的并发安全问题
2019-04-02 17:43:19 +08:00
ecc6e3888d up 2019-04-02 17:10:21 +08:00
47c073aaf3 add Clear function for gcfg; mark Reload function of gcfg as deprecated; update unit test for gins 2019-04-02 16:08:46 +08:00
07476a4349 add instance management feature for gdb/gredis; add customized configuration content management feature for gcfg; update gjson for data content type check 2019-04-02 14:37:46 +08:00
817148f3a1 增加单元测试 2019-04-01 18:32:37 +08:00
bd4271cd8c 增加gxml的单元测试 2019-03-31 23:36:11 +08:00
b1804fc346 TODO updates; version updates 2019-03-31 21:13:11 +08:00
a3886c2179 fix issue in RemoteAddr of gudp.Conn 2019-03-31 20:58:31 +08:00
f258b5bf1c change logging level from error to debug in route regitsry for struct for ghttp package; handle possible overrange usage of r.URL.Path in ghttp.Server 2019-03-31 20:52:30 +08:00
a05361011f 修复并发安全问题,改为如果非UTF8字符集则先做字符集转换 2019-03-30 23:53:42 +08:00
6b34a77251 修复并发安全问题,改为如果非UTF8字符集则先做字符集转换 2019-03-30 23:39:07 +08:00
afb1adee3d version updates 2019-03-28 17:58:33 +08:00
22fa7a37f3 add UseNumber support for gjson; add more unit test cases for gjson 2019-03-28 17:51:05 +08:00
6a58bfc574 add stdout printing support for ghttp.Server logging 2019-03-28 09:34:16 +08:00
64124c60fc add fatal error when no router set or statis feature enabled for ghttp.Server 2019-03-27 16:23:35 +08:00
9a0066de62 add file/folder search support for gcfg/gview in order of envpath/pwdpath/binpath/mainpath; add gfile.Search function 2019-03-27 11:48:53 +08:00
22c7c7403b fix issue in basic http auth check for server side 2019-03-27 09:16:23 +08:00
83db8e4b15 add wss example for websocket 2019-03-22 17:26:39 +08:00
25f2e121e7 version updates 2019-03-22 15:09:22 +08:00
1325a145d8 fix issue in config auto reload of gcfg 2019-03-22 15:08:43 +08:00
9bc49c0b29 add logging for error in ghttp.Request 2019-03-22 14:31:02 +08:00
8e84e5b0f3 update comment of gredis 2019-03-22 11:22:03 +08:00
a42e6b0c45 ignore private attribute of struct in gconv/gvalid 2019-03-22 10:12:43 +08:00
51bb7a9854 ignore private attribute of struct in gconv/gvalid 2019-03-22 10:12:15 +08:00
62580b5719 add examples for gredis 2019-03-21 23:51:57 +08:00
15cfd5ce5c add g.Export 2019-03-21 18:21:53 +08:00
11c89c4090 fix issue in GetOrSetFuncLock of gmap/gcache; add gutil.IsEmpty/Export functions 2019-03-21 18:20:20 +08:00
4a12cb9f27 version updates 2019-03-21 10:52:12 +08:00
32f575eddd update unit test of gins 2019-03-21 10:36:24 +08:00
fbb4cb3b1c add more unit test cases for gredis 2019-03-21 10:04:53 +08:00
c9d2d5e8ab add configuration support for maxIdle/maxActive/idleTimeout/maxConnLifetime of gredis; update gjson.Append/Len functions; add more unit test cases for gredis/gins/gstr/gjson 2019-03-21 00:14:23 +08:00
93763192f2 version updates 2019-03-19 17:55:02 +08:00
80e0eae6b0 add TLSConfig support for ghttp.Server 2019-03-19 17:48:37 +08:00
4e3d735b90 add logging for gcron 2019-03-19 13:58:18 +08:00
60e5a7da28 add more unit test cases for grand/gstr 2019-03-18 23:52:25 +08:00
997b5ba889 README updates 2019-03-18 14:10:30 +08:00
b3e7ca1963 travis updates 2019-03-18 14:05:46 +08:00
5a82d695c1 mv greuseport to a new repo 2019-03-18 13:56:16 +08:00
64a0427150 travis updates 2019-03-18 13:34:51 +08:00
f6aafc1d6b Merge pull request #5 from gogf/master
更新数据库操作
2019-03-18 10:00:23 +08:00
bca5532df8 version updates 2019-03-17 22:36:58 +08:00
72eeadd9aa Merge branch 'master' into develop 2019-03-17 22:31:15 +08:00
0af55794f6 add more unit test cases for gdb 2019-03-17 22:26:41 +08:00
25a6c53533 add unit test cases for gfsnotify 2019-03-15 14:54:01 +08:00
9f9172c775 update unit test cases of package gconv 2019-03-15 09:05:56 +08:00
320e0db417 fix int-overflow issue in gconv.String when converting int64 to string; add more unit test cases for package gconv 2019-03-15 00:22:39 +08:00
cb8362d447 update unit test cases of package gins 2019-03-14 23:28:56 +08:00
45a83fc53c unit test cases update for package gins 2019-03-14 00:23:46 +08:00
3411bd1c1d merge master 2019-03-13 22:41:00 +08:00
6ab0a77364 add more defaulr searching paths for g.Config() 2019-03-13 22:12:59 +08:00
281bae4116 unit test cases update for package gins 2019-03-13 09:11:50 +08:00
218c692fe0 update unit test cases 2019-03-12 23:56:09 +08:00
fa69b581e1 update unit test cases 2019-03-12 23:50:30 +08:00
bd0baceeca update unit test cases 2019-03-12 23:47:27 +08:00
e71c837472 update unit test cases 2019-03-12 23:45:44 +08:00
782aaabd07 add more unit test cases for gins; update text/template for gview 2019-03-12 23:26:10 +08:00
9014325a7c test 2019-03-12 10:54:38 +08:00
8ae9276732 add disable cache feature option for package gspath 2019-03-12 00:24:31 +08:00
79a3aa5916 add more unit test cases for package gvalid 2019-03-11 22:58:21 +08:00
733c5db228 version updates 2019-03-11 22:33:43 +08:00
6171c621a7 fix issue in missing customed error messages in package gvalid 2019-03-11 22:33:20 +08:00
fc11856a28 Merge pull request #4 from gogf/master
日常更新
2019-03-11 17:43:06 +08:00
802568856c version updates 2019-03-11 16:35:44 +08:00
127fb67185 add session id check in session object initialzing 2019-03-11 16:33:51 +08:00
5db039bbce gdb.Model updates, rename Alterable function to Safe, change gdb.Model alterable in default, update Where function to support more cases when using map as its param, add more unit test cases for gdb.Model 2019-03-11 16:14:55 +08:00
b0726b9733 Merge pull request #3 from gogf/master
日常更新
2019-03-10 22:38:15 +08:00
8a3365d18e ghttp comment updates 2019-03-10 00:39:34 +08:00
2ae5b1a4f8 add more unit test cases for ghttp.Server 2019-03-10 00:35:03 +08:00
f9515d7126 version updates 2019-03-09 10:20:11 +08:00
b56679a97c revert g.Map to map[string]interface{}, add g.MapAnyAny 2019-03-09 10:17:21 +08:00
d1b123964a README updates 2019-03-08 21:07:18 +08:00
991f7c4958 ghttp.Response updates 2019-03-08 19:03:22 +08:00
770619c39e update unit test cases og gcron 2019-03-08 18:27:11 +08:00
4ad5450b80 gtest updates; remove one unit test case of gconv.Struct 2019-03-08 18:18:29 +08:00
49ce7fe885 fix data race issue of gqueue 2019-03-08 17:54:50 +08:00
e66f63262b add more unit test cases for ghttp.Server 2019-03-08 17:31:30 +08:00
94bd5da68a add map key operator support in Where function for gdb 2019-03-08 11:12:52 +08:00
3eee95caf2 VERSION updates 2019-03-08 10:35:35 +08:00
5c638c630a add select in support for slice type of arguments in Where function of gdb 2019-03-08 10:33:36 +08:00
a6ec9d7a1c update gdb.Model.Where, orverwrite args if multiple calls Where function 2019-03-08 10:18:38 +08:00
374c70c0e3 README updates 2019-03-08 09:03:32 +08:00
40771066d4 travis updates 2019-03-08 08:48:53 +08:00
22a7ef43ce Merge branch 'master' into develop 2019-03-08 00:21:52 +08:00
05f22d1cee README updates 2019-03-08 00:15:57 +08:00
ebf56a86ab add Alterable function for gdb.Model 2019-03-07 23:53:56 +08:00
2ba59e8943 fix issue in gtime convert in package gconv; add Structs/Scan functions for gdb.Model; add GetStructs/GetScan functions for gdb.Base and gdb.TX 2019-03-07 23:36:45 +08:00
4e4ea25e7f Merge pull request #2 from gogf/master
第一次同步
2019-03-07 17:35:22 +08:00
83be1de04c remove error returns from router registry functions of WebServer; add more unit test cases for WebServer 2019-03-06 15:21:00 +08:00
c8251ed82f g.Map updates 2019-03-06 10:38:50 +08:00
2335ea0c4d merge master 2019-03-05 21:07:54 +08:00
5d874e9063 add example code for gconv.Map; comment updates of gdb 2019-03-05 17:52:34 +08:00
f2c080d25f update ghttp.Response 2019-03-05 17:16:21 +08:00
975da97b4a fix issue in empty check for nil attribute of struct in package 'empty';add set-cookie support for 302 status in ghttp.Server 2019-03-05 17:06:37 +08:00
37617589a6 add more unit test cases for ghttp.Server 2019-03-04 23:51:44 +08:00
5c9f0db903 version updates 2019-03-04 23:37:01 +08:00
28abf0c175 add ReplaceI/ReplaceIByArray/ReplaceIByMap case-insensetive replacing functions for gstr 2019-03-04 23:35:06 +08:00
13749feab4 add json features '-' and 'omitempty' for gconv.Map, like package 'json' from stdlib; add internal package 'empty', to check empty variable 2019-03-04 22:59:29 +08:00
c1e77b7e09 update example of gtcp 2019-03-03 20:40:36 +08:00
962a5e93f7 update example of gtcp 2019-03-03 20:20:31 +08:00
c3b9b8d5ae gconv updates 2019-03-03 00:53:35 +08:00
1ad076c522 travis updates 2019-03-03 00:31:16 +08:00
b01777fcd1 travis updates 2019-03-03 00:28:32 +08:00
55a5532c2e gdb updates 2019-03-03 00:14:20 +08:00
adb928941a issue template updates 2019-03-02 00:02:05 +08:00
f92c1fc527 update CORS feature of ghttp.Response; add more unit cases for ghttp.Server 2019-03-01 23:45:55 +08:00
3ae7279ebc issue template updates 2019-03-01 14:01:05 +08:00
66287c2d0e update the admin feature and unit test cases of ghttp 2019-02-28 23:57:20 +08:00
5d37626981 hot fix issue in router registry 2019-02-28 14:07:00 +08:00
d0ed3b979d release updates 2019-02-28 10:28:09 +08:00
fa256aec9f add example for layout using template engine; fix issue with config error output in gview when no config used 2019-02-27 22:53:39 +08:00
86834c5a15 version and comment updates 2019-02-27 22:17:09 +08:00
c2046157d6 add ghttp.Request.GetRawString function 2019-02-27 21:17:56 +08:00
cdb2cc89c0 remove password for unit test of gdb 2019-02-27 12:51:48 +08:00
4964c09a77 add more unit test cases for gdb 2019-02-27 12:38:12 +08:00
ef34b2c9ce gdb updates, add batch operation support for Insert/Save/Replace, change list param type from List to interface{} for Batch* functions 2019-02-27 09:38:10 +08:00
9afe242293 Merge branch 'master' into qiangg_gdb_map 2019-02-27 08:52:50 +08:00
136d93d373 add donate for gitee 2019-02-26 23:39:09 +08:00
3102cec5b8 issue template updates 2019-02-26 23:06:14 +08:00
e28eb9da04 add issue template 2019-02-26 22:58:52 +08:00
754ed86dfb add issue template 2019-02-26 22:56:52 +08:00
e352b07055 add issue_template 2019-02-26 22:51:30 +08:00
fdea242b50 Merge branch 'master' into develop 2019-02-26 22:23:24 +08:00
7058e4f2c4 fix issue of router group in auto-adding 'index' router for controller and object 2019-02-26 22:21:57 +08:00
704a5dbd73 fix issue of "memory leaks" in gfpool 2019-02-26 17:52:50 +08:00
fbd4ce8c2e fulfil unit cases of ghttp.Cookie/Session 2019-02-26 17:17:11 +08:00
cb3ce71cdc fix issue in ghttp.Session 2019-02-26 14:33:01 +08:00
7f44f2f5e4 gdb updates 2019-02-26 14:23:29 +08:00
66efbe63f0 add struct support for *Insert/*Save/*Replace/*Update/Where/Data functions 2019-02-26 01:19:01 +08:00
49a1308875 ghttp.Session updates 2019-02-25 23:08:26 +08:00
4332580c01 disable build-in session variable in template parsing, when it's not necessary 2019-02-25 15:20:57 +08:00
72ecf2d2af TODO++ 2019-02-25 12:39:07 +08:00
0f854e46d8 refact Merge function for garray; add more frequently-used type alias for gf 2019-02-22 09:08:46 +08:00
4564f38e1a add PopRands/Rands functions for garray 2019-02-20 19:06:08 +08:00
7e06bf6705 Merge branch 'master' into qiangg_garray2 2019-02-20 16:28:24 +08:00
3dd8b6ad33 version updates 2019-02-20 16:24:44 +08:00
3e0a975a88 fix issue in gcron, allow special char '?' for day and week pattern 2019-02-20 16:24:05 +08:00
6aa1c5b1eb ghttp updates 2019-02-20 16:07:11 +08:00
d780cf64c2 garray updates 2019-02-20 14:18:11 +08:00
1fb5a8cd6f comments for glog update 2019-02-20 11:16:10 +08:00
8925460718 comment updates of gregex package 2019-02-19 11:19:23 +08:00
9797701881 remove Search/InArray functions from gstr package; update custom http status handling logics of web server 2019-02-18 16:12:59 +08:00
8a50b180c0 README updates 2019-02-18 09:25:05 +08:00
159190d187 version updates 2019-02-17 20:49:58 +08:00
989d543a1f fix issue with error response status code 200 of web server; ghttp request client updates 2019-02-17 20:45:35 +08:00
fcc3a1b2f6 README updates 2019-02-15 23:21:46 +08:00
cfdeb87093 gfile updates 2019-02-15 21:30:35 +08:00
74eef34ec2 gtest updates; TODO++ 2019-02-15 08:55:29 +08:00
2e87d5322f remove sarama-cluster 2019-02-14 19:30:58 +08:00
e89a49f39a remove gkafka 2019-02-14 19:24:45 +08:00
5d3fd91f0b remove sarama 2019-02-14 19:21:38 +08:00
f455d22893 move gkafka to new repo 2019-02-14 17:04:20 +08:00
c00f528098 remove reuseport in ghttp 2019-02-14 15:43:31 +08:00
6f02ad60eb hot fix issue in tpl auto update 2019-02-14 13:38:52 +08:00
ca6c0791ae fix issue with greuseport in windows 2019-02-03 21:41:32 +08:00
ee485dbfd8 README updates 2019-02-02 17:55:22 +08:00
2ecaa12647 travis updates 2019-02-02 16:54:04 +08:00
580e099cb7 update imports 2019-02-02 16:42:26 +08:00
83e50f0d38 update imports 2019-02-02 16:35:26 +08:00
48c770b475 update dependences 2019-02-02 16:31:34 +08:00
ba67101942 updates 2019-02-02 16:22:41 +08:00
72efde09b3 travis updates 2019-02-02 16:20:36 +08:00
76c49170bd change gitee.com/johng/gf -> github.com/gogf/gf 2019-02-02 16:18:25 +08:00
150aa7e2c2 comments update 2019-02-02 15:21:48 +08:00
0762fec696 comments update 2019-02-02 15:16:45 +08:00
1447496efa comments update 2019-02-02 14:22:32 +08:00
6fb9eafef0 garray updates 2019-02-02 09:07:40 +08:00
16bde5e9fc gmap updates 2019-02-01 22:25:58 +08:00
7b85c44444 add Clone for garray; comments of garray update 2019-02-01 22:00:58 +08:00
87d553fca2 greuseport updates 2019-02-01 21:05:56 +08:00
ba050d4c86 merge qiangg_reuseport 2019-02-01 20:51:02 +08:00
90cd7f49fd greuseport updates 2019-02-01 20:49:02 +08:00
29b42290c7 merge master 2019-02-01 20:46:53 +08:00
6c6c64bb3b rename category string to text 2019-02-01 20:45:11 +08:00
ae7db2cf9f gmap updates 2019-02-01 18:40:48 +08:00
1afab62dec fulfil unit test cases for garray 2019-02-01 18:33:53 +08:00
4171ca992e add reverse feature for function Sort of normal array; fulfil unit test cases for StringArray 2019-02-01 18:14:12 +08:00
e1166a8a80 Merge branch 'master' into develop 2019-02-01 17:55:06 +08:00
74a7f71894 gset/gmap update 2019-02-01 17:30:23 +08:00
f2e149d3b3 fulfil unit test cases of gstr 2019-02-01 14:38:45 +08:00
92c0bf9cdc fix unit test cases of ghttp 2019-02-01 11:53:10 +08:00
020b050fb1 fix unit test cases for gstr/gconv/ghttp 2019-02-01 11:42:25 +08:00
08d71cede3 merge qiangg_php 2019-02-01 00:04:34 +08:00
be1f6cfbae Merge branch 'master' of https://gitee.com/johng/gf into develop 2019-02-01 00:02:17 +08:00
9aa5e139cf fulfil unit test cases of gstr 2019-02-01 00:02:01 +08:00
1d5c3d62dd fullfil unit test cases of gset 2019-01-31 21:15:39 +08:00
0e611ae94b merge master 2019-01-31 18:14:02 +08:00
908a46d27d gtest updates 2019-01-31 13:00:17 +08:00
85677b952f fulfil funcs of gstr/gset/garray; move gstr/gregex to the string category; move gtest to the test category 2019-01-30 21:27:03 +08:00
5eaa6183b5 update benchmark test cases of gregex 2019-01-28 12:03:47 +08:00
4036d40c58 add batchSqlResult for gform; TODO++ 2019-01-27 19:44:05 +08:00
0b80cbb0dc merge master 2019-01-27 19:18:24 +08:00
79cb386d82 reuseport updates 2019-01-27 16:40:16 +08:00
09be68831b reuseport updates 2019-01-27 14:25:31 +08:00
0ac13c2b81 reuseport updates 2019-01-27 14:14:59 +08:00
94ef38e3cc reuseport updates 2019-01-27 03:28:55 +08:00
76882ac01c update golang.org/x/sys, add reuseport package 2019-01-27 03:13:20 +08:00
59945fbe91 README updates 2019-01-25 12:47:53 +08:00
c4962ec017 gfpool updates 2019-01-24 20:15:11 +08:00
58d60bc899 add json tag support for struct converting of gconv 2019-01-24 15:37:53 +08:00
5dd0a78423 ghttp updates 2019-01-24 14:03:48 +08:00
141ea7cc2d ghttp updates 2019-01-24 13:50:26 +08:00
a488d1dbf7 ghttp updates 2019-01-24 13:40:48 +08:00
4352 changed files with 376678 additions and 482629 deletions

View File

@ -0,0 +1,21 @@
---
name: "Standardize markdown document formatting"
description: "Standardize the formatting of all markdown documents to keep structure clear, content readable, and the overall quality and user experience consistent. This document explains requirements for heading levels, paragraph formatting, code block usage, list formatting, and image and link insertion so authors can follow a unified style that is easier to read and maintain."
applyTo: "*.{md,MD}"
---
# Primary Formatting Requirements
- Keywords or specialized terms in the document must be formatted with inline code, for example `RuntimeClass`, `containerd`, `GPU`, and `AI`.
- In Chinese text, do not add spaces around inline code.
- For technical articles, review the generated content before finalizing it to ensure the material is technically accurate and contains no incorrect technical descriptions.
- When the generated content is too large, split it into multiple tasks to avoid exceeding model output limits and causing the workflow to fail.
# Detailed Content Requirements
- When documenting parameters or configuration items for a component or project, prefer tables when practical, and keep tables short enough to avoid horizontal scrolling during normal reading.
- In Chinese paragraphs, use full-width punctuation rather than half-width punctuation, for example `` instead of `,` and `` instead of `;`.
- Use `mermaid` for architecture diagrams, flowcharts, and similar visuals. If you need line breaks inside `mermaid`, use `<br/>` instead of `\n`.
- If a code block is not a `mermaid` diagram and instead uses box-drawing characters such as `┌─`, `┐`, `┤`, or `│`, keep the content in English so the layout stays aligned.
- Do not use `---` as a separator between paragraphs.

View File

@ -0,0 +1,152 @@
---
name: "OPSX: Apply"
description: Implement tasks from an OpenSpec change (Experimental)
category: Workflow
tags: [workflow, artifacts, experimental]
---
Implement tasks from an OpenSpec change.
**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
2. **Check status to understand the schema**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to understand:
- `schemaName`: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
3. **Get apply instructions**
```bash
openspec instructions apply --change "<name>" --json
```
This returns:
- Context file paths (varies by schema)
- Progress (total, complete, remaining)
- Task list with status
- Dynamic instruction based on current state
**Handle states:**
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
- If `state: "all_done"`: congratulate, suggest archive
- Otherwise: proceed to implementation
4. **Read context files**
Read the files listed in `contextFiles` from the apply instructions output.
The files depend on the schema being used:
- **spec-driven**: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output
5. **Show current progress**
Display:
- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI
6. **Implement tasks (loop until done or blocked)**
For each pending task:
- Show which task is being worked on
- Make the code changes required
- Keep changes minimal and focused
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
- Continue to next task
**Pause if:**
- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- Error or blocker encountered → report and wait for guidance
- User interrupts
7. **On completion or pause, show status**
Display:
- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done: suggest archive
- If paused: explain why and wait for guidance
**Output During Implementation**
```
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```
**Output On Completion**
```
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
All tasks complete! You can archive this change with `/opsx:archive`.
```
**Output On Pause (Issue Encountered)**
```
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
```
**Guardrails**
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names
**Fluid Workflow Integration**
This skill supports the "actions on a change" model:
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly

View File

@ -0,0 +1,157 @@
---
name: "OPSX: Archive"
description: Archive a completed change in the experimental workflow
category: Workflow
tags: [workflow, archive, experimental]
---
Archive a completed change in the experimental workflow.
**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **If no change name provided, prompt for selection**
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
Show only active changes (not already archived).
Include the schema used for each change if available.
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
2. **Check artifact completion status**
Run `openspec status --change "<name>" --json` to check artifact completion.
Parse the JSON to understand:
- `schemaName`: The workflow being used
- `artifacts`: List of artifacts with their status (`done` or other)
**If any artifacts are not `done`:**
- Display warning listing incomplete artifacts
- Prompt user for confirmation to continue
- Proceed if user confirms
3. **Check task completion status**
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
**If incomplete tasks found:**
- Display warning showing count of incomplete tasks
- Prompt user for confirmation to continue
- Proceed if user confirms
**If no tasks file exists:** Proceed without task-related warning.
4. **Assess delta spec sync state**
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
**If delta specs exist:**
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting
**Prompt options:**
- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
5. **Perform the archive**
Create the archive directory if it doesn't exist:
```bash
mkdir -p openspec/changes/archive
```
Generate target name using current date: `YYYY-MM-DD-<change-name>`
**Check if target already exists:**
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move the change directory to archive
```bash
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```
6. **Display summary**
Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Spec sync status (synced / sync skipped / no delta specs)
- Note about any warnings (incomplete artifacts/tasks)
**Output On Success**
```
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs
All artifacts complete. All tasks complete.
```
**Output On Success (No Delta Specs)**
```
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** No delta specs
All artifacts complete. All tasks complete.
```
**Output On Success With Warnings**
```
## Archive Complete (with warnings)
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** Sync skipped (user chose to skip)
**Warnings:**
- Archived with 2 incomplete artifacts
- Archived with 3 incomplete tasks
- Delta spec sync was skipped (user chose to skip)
Review the archive if this was not intentional.
```
**Output On Error (Archive Exists)**
```
## Archive Failed
**Change:** <change-name>
**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
Target archive directory already exists.
**Options:**
1. Rename the existing archive
2. Delete the existing archive if it's a duplicate
3. Wait until a different date to archive
```
**Guardrails**
- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
- If delta specs exist, always run the sync assessment and show the combined summary before prompting

View File

@ -0,0 +1,173 @@
---
name: "OPSX: Explore"
description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
category: Workflow
tags: [workflow, explore, experimental, thinking]
---
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
- A vague idea: "real-time collaboration"
- A specific problem: "the auth system is getting unwieldy"
- A change name: "add-dark-mode" (to explore in context of that change)
- A comparison: "postgres vs sqlite for this"
- Nothing (just enter explore mode)
---
## The Stance
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
- **Adaptive** - Follow interesting threads, pivot when new information emerges
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
---
## What You Might Do
Depending on what the user brings, you might:
**Explore the problem space**
- Ask clarifying questions that emerge from what they said
- Challenge assumptions
- Reframe the problem
- Find analogies
**Investigate the codebase**
- Map existing architecture relevant to the discussion
- Find integration points
- Identify patterns already in use
- Surface hidden complexity
**Compare options**
- Brainstorm multiple approaches
- Build comparison tables
- Sketch tradeoffs
- Recommend a path (if asked)
**Visualize**
```
┌─────────────────────────────────────────┐
│ Use ASCII diagrams liberally │
├─────────────────────────────────────────┤
│ │
│ ┌────────┐ ┌────────┐ │
│ │ State │────────▶│ State │ │
│ │ A │ │ B │ │
│ └────────┘ └────────┘ │
│ │
│ System diagrams, state machines, │
│ data flows, architecture sketches, │
│ dependency graphs, comparison tables │
│ │
└─────────────────────────────────────────┘
```
**Surface risks and unknowns**
- Identify what could go wrong
- Find gaps in understanding
- Suggest spikes or investigations
---
## OpenSpec Awareness
You have full context of the OpenSpec system. Use it naturally, don't force it.
### Check for context
At the start, quickly check what exists:
```bash
openspec list --json
```
This tells you:
- If there are active changes
- Their names, schemas, and status
- What the user might be working on
If the user mentioned a specific change name, read its artifacts for context.
### When no change exists
Think freely. When insights crystallize, you might offer:
- "This feels solid enough to start a change. Want me to create a proposal?"
- Or keep exploring - no pressure to formalize
### When a change exists
If the user mentions a change or you detect one is relevant:
1. **Read existing artifacts for context**
- `openspec/changes/<name>/proposal.md`
- `openspec/changes/<name>/design.md`
- `openspec/changes/<name>/tasks.md`
- etc.
2. **Reference them naturally in conversation**
- "Your design mentions using Redis, but we just realized SQLite fits better..."
- "The proposal scopes this to premium users, but we're now thinking everyone..."
3. **Offer to capture when decisions are made**
| Insight Type | Where to Capture |
|--------------|------------------|
| New requirement discovered | `specs/<capability>/spec.md` |
| Requirement changed | `specs/<capability>/spec.md` |
| Design decision made | `design.md` |
| Scope changed | `proposal.md` |
| New work identified | `tasks.md` |
| Assumption invalidated | Relevant artifact |
Example offers:
- "That's a design decision. Capture it in design.md?"
- "This is a new requirement. Add it to specs?"
- "This changes scope. Update the proposal?"
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
---
## What You Don't Have To Do
- Follow a script
- Ask the same questions every time
- Produce a specific artifact
- Reach a conclusion
- Stay on topic if a tangent is valuable
- Be brief (this is thinking time)
---
## Ending Discovery
There's no required ending. Discovery might:
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
- **Result in artifact updates**: "Updated design.md with these decisions"
- **Just provide clarity**: User has what they need, moves on
- **Continue later**: "We can pick this up anytime"
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
---
## Guardrails
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
- **Don't fake understanding** - If something is unclear, dig deeper
- **Don't rush** - Discovery is thinking time, not task time
- **Don't force structure** - Let patterns emerge naturally
- **Don't auto-capture** - Offer to save insights, don't just do it
- **Do visualize** - A good diagram is worth many paragraphs
- **Do explore the codebase** - Ground discussions in reality
- **Do question assumptions** - Including the user's and your own

View File

@ -0,0 +1,106 @@
---
name: "OPSX: Propose"
description: Propose a new change - create it and generate all artifacts in one step
category: Workflow
tags: [workflow, artifacts, experimental]
---
Propose a new change - create the change and generate all artifacts in one step.
I'll create a change with artifacts:
- proposal.md (what & why)
- design.md (how)
- tasks.md (implementation steps)
When ready to implement, run /opsx:apply
---
**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
**Steps**
1. **If no input provided, ask what they want to build**
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
> "What change do you want to work on? Describe what you want to build or fix."
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
2. **Create the change directory**
```bash
openspec new change "<name>"
```
This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
3. **Get the artifact build order**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to get:
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
- `artifacts`: list of all artifacts with their status and dependencies
4. **Create artifacts in sequence until apply-ready**
Use the **TodoWrite tool** to track progress through the artifacts.
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
a. **For each artifact that is `ready` (dependencies satisfied)**:
- Get instructions:
```bash
openspec instructions <artifact-id> --change "<name>" --json
```
- The instructions JSON includes:
- `context`: Project background (constraints for you - do NOT include in output)
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
- `template`: The structure to use for your output file
- `instruction`: Schema-specific guidance for this artifact type
- `outputPath`: Where to write the artifact
- `dependencies`: Completed artifacts to read for context
- Read any completed dependency files for context
- Create the artifact file using `template` as the structure
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
- Show brief progress: "Created <artifact-id>"
b. **Continue until all `applyRequires` artifacts are complete**
- After creating each artifact, re-run `openspec status --change "<name>" --json`
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
- Stop when all `applyRequires` artifacts are done
c. **If an artifact requires user input** (unclear context):
- Use **AskUserQuestion tool** to clarify
- Then continue with creation
5. **Show final status**
```bash
openspec status --change "<name>"
```
**Output**
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions
- What's ready: "All artifacts created! Ready for implementation."
- Prompt: "Run `/opsx:apply` to start implementing."
**Artifact Creation Guidelines**
- Follow the `instruction` field from `openspec instructions` for each artifact type
- The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use `template` as the structure for your output file - fill in its sections
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
- These guide what you write, but should never appear in the output
**Guardrails**
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
- Always read dependency artifacts before creating a new one
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next

View File

@ -0,0 +1,280 @@
---
name: gf-feedback
description: >-
Track, fix, verify, and test any bugs, improvements, or gaps reported against an OpenSpec change.
MUST use this skill whenever user reports problems, defects, issues, bugs, or gaps related to
existing implementations, even if they don't explicitly say "feedback" or mention OpenSpec.
compatibility: Requires openspec CLI, Go toolchain, and gf-review skill.
---
# Feedback: Structured Fix, Verification & Test Coverage Loop
When users discover bugs or improvement points after implementation, this skill captures those issues, organizes them into a traceable task list in `tasks.md`, systematically fixes and verifies each one, and ensures every behavior-changing fix is covered by focused unit tests.
**Core principles:**
1. **Spec is the source of truth** — Spec-level changes require spec update before task recording
2. **Write it down first, then fix it** — Every issue gets recorded before any code change
3. **Every fix deserves a test** — Behavior-changing code changes require unit test coverage in the affected package
---
## Workflow
### 1. Identify Target Change
**CRITICAL:**
1. Always append to existing active changes. Only create new change when none exist.
2. An **active change** is any change directory that still exists directly under `openspec/changes/` and has **not** been moved into `openspec/changes/archive/`. Do **not** treat `status: complete`, all tasks checked off, or similar completion signals as "inactive" until archive actually happens.
3. Regardless of whether the feedback content is related to the main functionality of the current active iteration, it MUST be appended to the current active iteration. This ensures all changes are tracked in a single change record for unified management and archiving.
```bash
openspec list --json
# Or: ls openspec/changes/ | grep -v archive
```
When the two signals disagree, prefer the filesystem rule:
- If a change directory still exists under `openspec/changes/` and is not inside `archive/`, it is active.
- `openspec list --json` may still report such a change as `status: complete`; that only means implementation tasks are done, **not** that the change is inactive.
- Only archived changes under `openspec/changes/archive/` are inactive.
| Active Changes | Action |
|----------------|--------|
| None | Create new change (see below) |
| One | Auto-select it, announce and proceed |
| Multiple | Ask user to select from list |
**When multiple active changes exist:**
```
Multiple active changes detected. Which change should this feedback be appended to?
1. config-management — System config CRUD management
2. user-auth — User authentication enhancement
Please select 1 or 2:
```
**When no active change exists:**
1. Derive kebab-case name from feedback (e.g., "fix-menu-circular-ref")
2. If name exists, append suffix ("-2")
3. Create: `openspec new change "<name>"`
4. Generate minimal `proposal.md` (one paragraph summarizing context)
5. Skip `design.md` for pure bug fixes unless architectural changes needed
Announce: "Applying feedback fixes to change: **<name>**"
---
### 2. Read Current Context
| File | Purpose |
|------|---------|
| `tasks.md` | Task structure, naming conventions, numbering |
| `design.md` | Architectural context |
| `proposal.md` | Feature scope and intent |
| `specs/` | Delta spec definitions |
```bash
# Locate existing unit tests in the impacted package before adding a new one
rg --files <pkg-dir> | rg '_test\\.go$'
```
---
### 3. Analyze and Organize Issues
For each reported issue:
**Classify by type:**
- **bug** — Incorrect behavior, code doesn't match spec
- **missing** — Feature incomplete, gaps in implementation
- **ux** — UX improvement, no spec change needed
- **test-gap** — Missing test coverage only
**Classify by spec impact:**
| Level | Definition | Action |
|-------|------------|--------|
| **implementation** | Spec is correct, code is wrong | Fix code only |
| **spec-level** | Requirement missing/incomplete/changed | Update spec first, then fix |
| **internal** | No user-observable change | Fix code, test optional |
**Group related issues** — Same root cause → single task with multiple verification points.
---
### 4. Update Delta Specs (for Spec-Level Issues Only)
For spec-level issues, update specs **before** recording tasks:
1. Identify affected capability: `specs/<capability>/spec.md`
2. Apply delta operation:
```markdown
<!-- ADDED: New requirement -->
### Requirement: Parent Selector Circular Prevention
The system SHALL disable the current menu and all its descendants in the parent selector
to prevent circular references.
#### Scenario: Edit menu with children
WHEN user edits a menu that has child menus
THEN the parent selector SHALL disable the current menu and all descendant menus
<!-- MODIFIED: Changed requirement (include full original block) -->
### Requirement: Import Error Handling
The system SHALL display error messages when import fails.
**MODIFIED:** Error messages SHALL include row number, field name, and validation failure reason.
<!-- REMOVED: Deprecated requirement -->
### Requirement: Legacy Import Format
The system SHALL support legacy CSV format.
**REMOVED:** This format is no longer supported.
**Migration:** Use the new CSV format with header row.
```
---
### 5. Write Task List to tasks.md
Append a **Feedback section** to `tasks.md`:
```markdown
## Feedback
- [ ] **FB-1**: Parent selector allows circular references in menu edit
- [ ] **FB-2**: Import error messages lack row and field details
- [ ] **FB-3**: No test coverage for reset password feature
```
**Numbering:** Sequential `FB-1`, `FB-2`, etc. Continue from last number if section exists.
**One line per task** — No sub-fields. Analysis happens during fix phase.
**Confirm with user** before writing to file.
**Test coverage planning (internal):**
- Behavior-changing code change → Unit test required
- Internal-only optimization → Unit test optional unless logic risk increased
- Prefer extending the nearest `*_z_unit*_test.go` or `*_test.go` in the same package
---
### 6. Execute Fixes (Loop)
For each task:
**a. Announce:** `## Fixing FB-X: <issue title>`
**b. Investigate** — Read source files, confirm root cause
**c. Implement** — Minimal, focused fix following existing patterns
**d. Write/update unit tests** — Prefer the affected package's existing `*_z_unit*_test.go` or `*_test.go` files and keep assertions focused on the changed logic
**e. Assess Impact Scope (MANDATORY)**
After implementing, identify regression risk:
| Change Type | Map To Tests |
|-------------|--------------|
| Package-level logic | Targeted test for changed function/method + package regression tests |
| Shared utility | Utility package unit tests + highest-value dependent package tests already covering reuse |
| DB/DAO logic | DAO/model package unit tests with focused fixtures, mocks, or test helpers |
| Public API validation | Handler/service package unit tests that assert the changed validation path |
| Refactor without behavior change | Existing package tests that prove behavior parity |
```bash
# Example: Find unit tests related to a changed symbol or package
rg -l "GenDao|gdao" . -g '*_test.go'
```
Announce:
```
### Impact Analysis for FB-X
- Modified: cmd/gf/internal/cmd/gendao/gendao.go
- Affected package: cmd/gf/internal/cmd/gendao
- Unit tests: cmd/gf/internal/cmd/gendao/gendao_test.go
- Regression command: go test ./cmd/gf/internal/cmd/gendao -run 'TestGenDao'
```
**f. Verify (MANDATORY before marking complete)**
1. Run new/updated unit tests for this task → **must pass**
2. Run ALL identified package-level regression tests → **must pass**
3. Only then: mark task `[x]` in tasks.md
If regression fails:
- Fix inline if related to current change
- Add as new FB task if separate issue
**g. Run review** — Invoke `gf-review` skill after completion
---
### 7. Comprehensive Verification
After all fixes:
1. Aggregate regression tests from all tasks
2. Run full set in single pass
3. Report:
```
### Comprehensive Verification Results
- Total tests: N
- Passed: N
- Failed: N (list with details)
- Regression tests: all passed ✓ / X failures
```
If failures → add new FB tasks, loop to Step 6.
---
### 8. Report Completion
```markdown
## Feedback Complete
**Change:** <name>
**Issues reported:** X
**Issues fixed:** Y/X
**Tests added:** Z unit tests / focused assertions
**Regression tests run:** R tests across N packages
**Verification:** all passed / N issues remaining
### Fixed This Session
- [x] FB-1: <title> ✓ (unit test: TestGenDao_FiltersInvalidTables | package: ./cmd/gf/internal/cmd/gendao ✓)
- [x] FB-2: <title> ✓ (unit test: existing package coverage extended | package: ./cmd/gf/internal/cmd ✓)
### Remaining (if any)
- [ ] FB-3: <title> — blocked by <reason>
```
---
## Edge Cases
| Situation | Handling |
|-----------|----------|
| Single issue | Still follow full workflow |
| Missing test cases only | Classify as test-gap, implement tests |
| Fix reveals more issues | Add as new FB tasks |
| "Bug" is actually feature request | Re-classify as spec-level, update specs first |
| Unit test not feasible (docs/spec only) | Note reason explicitly and skip only when no runtime code changes exist |
| Multiple feedback rounds | All tasks in single Feedback section, sequential numbering |
---
## Guardrails
- **Append to active change if exists** — Never create new change when active ones exist
- **Specs before tasks for spec-level issues** — Update delta specs first
- **Write tasks before fixing** — Never code without recording
- **Confirm task list with user** — User validates analysis
- **Minimal fixes** — No refactoring beyond issue scope
- **Behavior-changing fix needs unit test** — No exceptions unless the change is docs/spec only
- **No green check without green unit tests** — Mark `[x]` only after tests pass
- **Impact analysis mandatory** — Every fix requires package-level regression test identification
- **Regression failures block completion** — Must resolve before marking done
- **Update tasks.md in real time** — Mark complete immediately after verification
- **Match file language** — Use same language as existing content in target file

View File

@ -0,0 +1,168 @@
---
name: gf-review
description: >-
Code and specification review for OpenSpec workflow. Triggers automatically after /opsx:apply
task completion, after /gf-feedback task completion, and before /opsx:archive. Use when
user requests code review, spec compliance check, or when explicitly invoked via /gf-review.
compatibility: Requires OpenSpec CLI and GoFrame v2 skill.
---
# GF Review
Structured code and specification review for the OpenSpec development workflow.
**Spec Source**: `CLAUDE.md` is the single source of truth for all review criteria.
---
## When This Skill Activates
**Automatic triggers:**
- After completing each task in `/opsx:apply`
- After completing each task in `/gf-feedback`
- Before executing `/opsx:archive`
**Manual trigger:**
- User explicitly requests: "review this code", "check spec compliance", "/gf-review"
---
## Review Workflow
### 1. Identify Scope
Determine what needs to be reviewed:
1. **After task completion** — Review files modified/created by the completed task
2. **Before archive** — Review all changes in the current OpenSpec change
3. **Manual invocation** — Ask user to specify scope or use current change
**Mandatory scope collection rules:**
1. Start with repository status, not `git diff` alone:
```bash
git status --short
git ls-files --others --exclude-standard
```
2. Treat **all tracked and untracked changes** as review candidates, including:
- staged files
- unstaged files
- untracked files shown as `??`
- untracked directories shown as `?? path/`
3. When `git status --short` reports an untracked directory, expand it to concrete files before review:
```bash
find <path> -type f
# Or prefer:
rg --files <path>
```
4. If the task ran generators such as `make ctrl`, `make dao`, codegen scripts, or produced new test files, explicitly include the generated untracked files in review scope even if they do not appear in `git diff`.
5. `git diff` may be used only as a secondary narrowing aid after status collection. It is **never sufficient by itself** for review scope definition.
Run `openspec status --change "<name>" --json` to understand the current change state.
### 2. Load Specifications
Read `CLAUDE.md` to load all specifications. This is the single source of truth.
### 3. Backend Code Review
**Trigger**: Changes to files under `apps/lina-core` directory
1. Invoke `goframe-v2` skill for GoFrame framework conventions
2. Check against `CLAUDE.md` backend code specifications
### 4. RESTful API Review
**Trigger**: Any API endpoint changes
Check against `CLAUDE.md` API design specifications.
### 5. Project Specification Review
**Trigger**: Any implementation changes
Check against `CLAUDE.md` architecture design specifications and code development specifications.
### 6. SQL Review
**Trigger**: New or modified files under `apps/lina-core/manifest/sql/`、`apps/lina-core/manifest/sql/mock-data/`、`apps/lina-plugins/**/manifest/sql/` or SQL snippets embedded in related delivery docs
Check against `CLAUDE.md` SQL file management specifications, at minimum covering:
1. File naming, versioning, and single-iteration single-file rules
2. Seed DML vs mock data separation
3. **Idempotent execution safety** — SQL must be safe to run multiple times without duplicate-object errors or duplicate seed data; verify use of `IF [NOT] EXISTS`, `IF EXISTS`, `INSERT IGNORE`, or equivalent safe re-entry patterns
4. **Seed write style compliance** — delivered SQL must reject `INSERT ... ON DUPLICATE KEY UPDATE` and reject explicit writes to `AUTO_INCREMENT` `id` columns in seed/mock/install data
5. Whether schema/data changes still match the current change scope and deployment path
### 7. Unit Test Review
**Trigger**: New or modified Go implementation files, or new/modified Go unit test files matching `*_test.go`
Check at minimum:
1. Behavior-changing Go code includes focused unit coverage in the same package, preferably by extending existing `*_z_unit*_test.go` or `*_test.go`
2. Tests assert the changed logic directly instead of relying on broad workflow-level coverage when a package-level test is sufficient
3. Verification uses targeted `go test ./path/to/pkg -run TestName` during development and package-level `go test ./path/to/pkg` for regression
### 8. Generate Review Report
```markdown
## GF Review Report
**Change:** <change-name>
**Scope:** <task-specific / full change>
**Files Reviewed:** <count>
**Scope Source:** `git status --short` + `git ls-files --others --exclude-standard` + task/change context
### Backend Code Review
✓ All checks passed / ⚠ N issues found
### RESTful API Review
✓ All endpoints compliant / ⚠ N violations found
### Project Spec Review
✓ Compliant with CLAUDE.md / ⚠ N violations found
### SQL Review
✓ No SQL changes / ✓ SQL changes compliant / ⚠ N SQL issues found
### Unit Test Review
✓ Unit tests are focused and sufficient / ⚠ N issues found
### Summary
- **Critical:** N (must fix before archive)
- **Warnings:** N (recommended to fix)
### Recommended Actions
1. [Specific action with CLAUDE.md reference]
```
---
## Issue Severity
| Level | Behavior |
|-------|----------|
| **Critical** | Block archive, must fix |
| **Warning** | Show but allow proceed |
---
## Integration Points
| Workflow Step | Behavior |
|---------------|----------|
| `/opsx:apply` task done | Review, offer to fix issues before next task |
| `/gf-feedback` task done | Review, fix before marking complete |
| `/opsx:archive` | Review all changes, block on critical issues |
---
## Guardrails
- **CLAUDE.md is the single source of truth** — All spec references point to it
- Only check categories relevant to changed files
- Scope identification MUST include untracked files and expanded untracked directories; never rely on `git diff` alone
- Behavior-changing Go code without focused unit tests is a review finding unless the author documents why tests are not applicable
- Don't block on warnings — only critical issues block archive
- Include file paths and line numbers in issue reports
- Offer to fix issues automatically when straightforward

View File

@ -0,0 +1,148 @@
---
name: git-commit-push
description: Review the current git working tree, generate a commit message from the actual diff using the repository's commit or PR-title convention, commit all current changes on the active branch, and push that branch to `origin`. Use this whenever the user asks to "commit", "push", "commit and push", "generate a commit message", "commit the current changes", or wants the current branch changes sent upstream without hand-writing the git commands.
---
# Git Commit Push
Inspect the current repository changes, derive a concise commit subject that matches the repository convention, commit every current modification on the active branch, and push that branch to `origin`.
This skill is for execution, not just advice. When it triggers, actually run the git workflow unless the repository state makes that unsafe or impossible.
## When To Use
- The user asks you to commit the current changes, with or without asking for push
- The user wants you to write the commit message from the diff instead of inventing one up front
- The user mentions the repo's PR or commit naming convention and wants you to follow it
- The user says things like "commit the current branch", "help me commit", "commit and push", "generate a commit message and push", or "send these changes to origin"
## Core Behavior
1. Confirm you are inside a Git repository and detect the active branch with `git branch --show-current`.
2. Inspect the working tree before committing:
- `git status --short --branch`
- `git diff --stat`
- `git diff --cached --stat`
- `git diff -- . ':(exclude)package-lock.json'` or narrower path filters only when needed for readability
3. If the repository contains `.github/PULL_REQUEST_TEMPLATE.MD`, read it and treat its PR-title rules as the default commit-subject convention.
4. Generate a commit subject from the actual changed files and diff content, not from the user prompt alone.
5. Stage every current modification on the branch with `git add -A`.
6. Commit once with the generated message.
7. Push the current branch to `origin` with `git push origin <current-branch>`.
## Commit Message Rules
The commit message is formatted as follows: `<type>[optional scope]: <description>` For example, `fix(os/gtime): fix time zone issue`
+ `<type>` is mandatory and can be one of `fix`, `feat`, `build`, `ci`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`
+ `fix`: Used when a bug has been fixed.
+ `feat`: Used when a new feature has been added.
+ `build`: Used for modifications to the project build system, such as changes to dependencies, external interfaces, or upgrading Node version.
+ `ci`: Used for modifications to continuous integration processes, such as changes to Travis, Jenkins workflow configurations.
+ `docs`: Used for modifications to documentation, such as changes to README files, API documentation, etc.
+ `style`: Used for changes to code style, such as adjustments to indentation, spaces, blank lines, etc.
+ `refactor`: Used for code refactoring, such as changes to code structure, variable names, function names, without altering functionality.
+ `perf`: Used for performance optimization, such as improving code performance, reducing memory usage, etc.
+ `test`: Used for modifications to test cases, such as adding, deleting, or modifying test cases for code.
+ `chore`: Used for modifications to non-business-related code, such as changes to build processes or tool configurations.
+ After `<type>`, specify the affected package name or scope in parentheses, for example, `(os/gtime)`.
+ The part after the colon uses the verb tense + phrase that completes the blank in
+ Lowercase verb after the colon
+ No trailing period
+ Keep the title as short as possible. ideally under 76 characters or shorter
+ If there is a corresponding issue, add either `fixes #1234` (the latter if this is not a complete fix) to this comment
### Examples
#### Commit message with description and breaking change footer
```
feat: allow provided config object to extend other configs
BREAKING CHANGE: `extends` key in config file is now used for extending other config files
```
#### Commit message with ! to draw attention to breaking change
```
feat!: send an email to the customer when a product is shipped
```
#### Commit message with scope and ! to draw attention to breaking change
```
feat(api)!: send an email to the customer when a product is shipped
```
#### Commit message with both ! and BREAKING CHANGE footer
```
feat!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
```
#### Commit message with no body
```
docs: correct spelling of CHANGELOG
```
#### Commit message with scope
```
feat(lang): add Polish language
```
#### Commit message with multi-paragraph body and multiple footers
```
fix: prevent racing of requests
Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.
Remove timeouts which were used to mitigate the racing issue but are
obsolete now.
Reviewed-by: Z
Refs: #123
```
## Execution Rules
- Commit all current tracked and untracked changes in the working tree, because this skill is for "commit the current state" requests
- If there are no changes, say so clearly and stop before commit or push
- If `git branch --show-current` is empty, explain that `HEAD` is detached and stop unless the user explicitly asks you to commit from detached `HEAD`
- Never use `--force`, `--force-with-lease`, or history-rewriting commands unless the user explicitly asks
- If push fails because the remote branch moved, report the exact failure and stop instead of auto-rebasing or auto-merging
- Do not silently drop files from the commit unless the user asked to exclude them
## Suggested Command Flow
```bash
git status --short --branch
git diff --stat
git diff --cached --stat
test -f .github/PULL_REQUEST_TEMPLATE.MD && sed -n '1,220p' .github/PULL_REQUEST_TEMPLATE.MD
branch_name=$(git branch --show-current)
git add -A
git commit -m "<generated-subject>"
git push origin "$branch_name"
```
Inspect `git diff --cached` again after staging if the pre-stage diff was noisy or if untracked files materially change the scope.
## Output Contract
When you use this skill:
- Tell the user which branch you committed
- Provide the final commit subject you used
- Mention that you staged all current changes
- Report the push target as `origin/<branch>`
- If commit or push did not happen, explain exactly why
## Example
User request:
```text
Generate a commit message that follows this repository's convention, then commit and push the current branch
```
Expected behavior:
- Inspect the repo status and diff
- Generate a conventional subject from the real changes
- Run one commit for the whole current working tree
- Push the active branch to `origin`

View File

@ -0,0 +1,142 @@
---
name: git-worktree
description: Create and actively use an isolated git worktree for the user's task, then continue the task inside that new directory. Use this whenever the user asks for a separate worktree, isolated checkout, clean branch directory, safer parallel changes, or a fresh workspace to avoid unrelated local edits.
---
# Git Worktree
Create a dedicated `git worktree` for the current task, then keep working inside that new directory instead of the original checkout.
This skill is about execution, not just advice. When it triggers, actually create the worktree unless the repository state makes that impossible.
Do not introduce helper scripts for this skill. Use direct `git` and shell commands inline.
## When To Use
- The user explicitly asks for a new `git worktree`, independent branch directory, or isolated workspace
- The current checkout contains unrelated local changes and isolation is the safest way forward
- The user wants parallel work on multiple tasks without stashing or disturbing the original worktree
- The user says things like "create a separate branch folder", "open a fresh worktree", "use a clean checkout", or "work in an isolated workspace"
## Core Rule
After creating the worktree, treat the new path as the active working directory for the rest of the task.
In any agent environment, "enter the directory" means:
- Run subsequent commands against the new worktree path
- Apply all edits under that worktree path
- Do not keep using the original checkout by accident
- Confirm the handoff by running at least one follow-up command in the new worktree
Never claim you "switched" unless your subsequent actions actually target the new `worktree_path`.
If your environment supports a per-command working directory, use it for every later command. If it does not, prefix later commands with an explicit `cd <worktree_path> && ...`.
## Name Derivation
- Derive a short ASCII kebab-case task slug from the user's real task, such as `login-timeout-fix` or `user-export`
- Do not use generic names like `git-worktree`, `new-worktree`, or `task` unless the request is too vague
- If the request is mostly non-ASCII or no good slug is obvious, fall back to `task-$(date +%Y%m%d-%H%M%S)`
- Default branch prefix is `worktree/`
- Default worktree directory is a sibling of the repository root, named `<repo-name>-<slug>`
## Default Workflow
1. Inspect the repository context from the current checkout:
- `git rev-parse --show-toplevel`
- `git branch --show-current`
- `git status --short`
- `git worktree list --porcelain`
2. Decide a task slug yourself using the rules above
3. Build branch and path names inline, then create the worktree with direct shell commands like:
```bash
repo_root=$(git rev-parse --show-toplevel)
repo_name=$(basename "$repo_root")
parent_dir=$(dirname "$repo_root")
source_branch=$(git -C "$repo_root" branch --show-current)
if [ -n "$source_branch" ]; then
source_ref="$source_branch"
else
source_ref="HEAD@$(git -C "$repo_root" rev-parse --short HEAD)"
fi
slug="<task-slug>"
base_branch="worktree/$slug"
branch_name="$base_branch"
base_path="$parent_dir/$repo_name-$slug"
worktree_path="$base_path"
index=2
while git -C "$repo_root" show-ref --verify --quiet "refs/heads/$branch_name" || [ -e "$worktree_path" ]; do
branch_name="${base_branch}-$index"
worktree_path="${base_path}-$index"
index=$((index + 1))
done
git -C "$repo_root" worktree add -b "$branch_name" "$worktree_path" HEAD
```
4. Immediately verify the handoff inside the new worktree, for example:
```bash
pwd
git status --short --branch
```
These verification commands must run against `worktree_path`.
5. Announce the new active path briefly, then continue the main task there
6. For the remainder of the task, use `worktree_path` as the working directory for every relevant command or edit operation
## Behavior Rules
- Default base ref is `HEAD` from the current checkout so uncommitted local changes are not dragged into the new worktree
- If a branch name or path already exists, auto-increment it instead of failing
- If you are already inside a non-default worktree and the user still wants another isolated workspace, create a new one from the current `HEAD`
- If the directory is not a Git repository, explain that clearly and do not pretend a worktree was created
- If worktree creation succeeds, continue the user's actual task instead of stopping at setup
- If worktree creation fails because of filesystem permissions, request the minimal approval needed and retry
## Uncommitted Change Policy
The safe default is isolation from uncommitted changes.
- If the source checkout is dirty, still create the new worktree from `HEAD` unless the user explicitly asks to carry local edits over
- Do not silently stash, reset, or move the user's existing changes
- If the user wants local edits copied into the new worktree, use an explicit flow such as a temporary commit, patch, or cherry-pick, and say what you are doing
## Output Contract
When you use this skill:
- Tell the user which branch and directory were created
- Make it clear that subsequent work is now happening inside that path
- Mention the source ref and whether the original checkout was dirty when that context matters
- Do not stop after setup if the user asked for additional work; continue the task in the new worktree
## Example
User request:
```text
Create a separate worktree for this task and then start implementing it.
```
Expected behavior:
- Inspect current repo status
- Create a new `worktree/...` branch and sibling directory with direct `git worktree` commands
- Switch all following commands to that directory
- Continue the requested implementation there
## Cleanup
Only remove a worktree when the user asks or when cleanup is clearly part of the task.
Before cleanup:
- Check status in the worktree you created
- Make sure you are removing the correct path
- Never remove the user's original checkout

View File

@ -0,0 +1,288 @@
---
name: openspec-explore
description: Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
generatedBy: "1.2.0"
---
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
---
## The Stance
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
- **Adaptive** - Follow interesting threads, pivot when new information emerges
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
---
## What You Might Do
Depending on what the user brings, you might:
**Explore the problem space**
- Ask clarifying questions that emerge from what they said
- Challenge assumptions
- Reframe the problem
- Find analogies
**Investigate the codebase**
- Map existing architecture relevant to the discussion
- Find integration points
- Identify patterns already in use
- Surface hidden complexity
**Compare options**
- Brainstorm multiple approaches
- Build comparison tables
- Sketch tradeoffs
- Recommend a path (if asked)
**Visualize**
```
┌─────────────────────────────────────────┐
│ Use ASCII diagrams liberally │
├─────────────────────────────────────────┤
│ │
│ ┌────────┐ ┌────────┐ │
│ │ State │────────▶│ State │ │
│ │ A │ │ B │ │
│ └────────┘ └────────┘ │
│ │
│ System diagrams, state machines, │
│ data flows, architecture sketches, │
│ dependency graphs, comparison tables │
│ │
└─────────────────────────────────────────┘
```
**Surface risks and unknowns**
- Identify what could go wrong
- Find gaps in understanding
- Suggest spikes or investigations
---
## OpenSpec Awareness
You have full context of the OpenSpec system. Use it naturally, don't force it.
### Check for context
At the start, quickly check what exists:
```bash
openspec list --json
```
This tells you:
- If there are active changes
- Their names, schemas, and status
- What the user might be working on
### When no change exists
Think freely. When insights crystallize, you might offer:
- "This feels solid enough to start a change. Want me to create a proposal?"
- Or keep exploring - no pressure to formalize
### When a change exists
If the user mentions a change or you detect one is relevant:
1. **Read existing artifacts for context**
- `openspec/changes/<name>/proposal.md`
- `openspec/changes/<name>/design.md`
- `openspec/changes/<name>/tasks.md`
- etc.
2. **Reference them naturally in conversation**
- "Your design mentions using Redis, but we just realized SQLite fits better..."
- "The proposal scopes this to premium users, but we're now thinking everyone..."
3. **Offer to capture when decisions are made**
| Insight Type | Where to Capture |
|--------------|------------------|
| New requirement discovered | `specs/<capability>/spec.md` |
| Requirement changed | `specs/<capability>/spec.md` |
| Design decision made | `design.md` |
| Scope changed | `proposal.md` |
| New work identified | `tasks.md` |
| Assumption invalidated | Relevant artifact |
Example offers:
- "That's a design decision. Capture it in design.md?"
- "This is a new requirement. Add it to specs?"
- "This changes scope. Update the proposal?"
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
---
## What You Don't Have To Do
- Follow a script
- Ask the same questions every time
- Produce a specific artifact
- Reach a conclusion
- Stay on topic if a tangent is valuable
- Be brief (this is thinking time)
---
## Handling Different Entry Points
**User brings a vague idea:**
```
User: I'm thinking about adding real-time collaboration
You: Real-time collab is a big space. Let me think about this...
COLLABORATION SPECTRUM
════════════════════════════════════════════
Awareness Coordination Sync
│ │ │
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│Presence│ │Cursors │ │ CRDT │
│ "3 │ │ Multi │ │Conflict│
│online" │ │ select │ │ free │
└────────┘ └────────┘ └────────┘
│ │ │
trivial moderate complex
Where's your head at?
```
**User brings a specific problem:**
```
User: The auth system is a mess
You: [reads codebase]
┌─────────────────────────────────────────────┐
│ CURRENT AUTH FLOW │
└─────────────────────────────────────────────┘
┌─────────────┼─────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Google │ │ GitHub │ │ Email │
│ OAuth │ │ OAuth │ │ Magic │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└─────────────┼─────────────┘
┌───────────┐
│ Session │
└─────┬─────┘
┌───────────┐
│ Perms │
└───────────┘
I see three tangles. Which one's burning?
```
**User is stuck mid-implementation:**
```
User: /opsx:explore add-auth-system
The OAuth integration is more complex than expected
You: [reads change artifacts]
You're on task 4: "Implement OAuth flow"
Let me trace what's involved...
[draws diagram, explores options, suggests paths]
Want to update the design to reflect this?
Or add a spike task to investigate?
```
**User wants to compare options:**
```
User: Should we use Postgres or SQLite?
You: Generic answer is boring. What's the context?
User: A CLI tool that tracks local dev environments
You: That changes everything.
┌─────────────────────────────────────────────────┐
│ CLI TOOL DATA STORAGE │
└─────────────────────────────────────────────────┘
Key constraints:
• No daemon running
• Must work offline
• Single user
SQLite Postgres
Deployment embedded ✓ needs server ✗
Offline yes ✓ no ✗
Single file yes ✓ no ✗
SQLite. Not even close.
Unless... is there a sync component?
```
---
## Ending Discovery
There's no required ending. Discovery might:
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
- **Result in artifact updates**: "Updated design.md with these decisions"
- **Just provide clarity**: User has what they need, moves on
- **Continue later**: "We can pick this up anytime"
When it feels like things are crystallizing, you might summarize:
```
## What We Figured Out
**The problem**: [crystallized understanding]
**The approach**: [if one emerged]
**Open questions**: [if any remain]
**Next steps** (if ready):
- Create a change proposal
- Keep exploring: just keep talking
```
But this summary is optional. Sometimes the thinking IS the value.
---
## Guardrails
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
- **Don't fake understanding** - If something is unclear, dig deeper
- **Don't rush** - Discovery is thinking time, not task time
- **Don't force structure** - Let patterns emerge naturally
- **Don't auto-capture** - Offer to save insights, don't just do it
- **Do visualize** - A good diagram is worth many paragraphs
- **Do explore the codebase** - Ground discussions in reality
- **Do question assumptions** - Including the user's and your own

View File

@ -0,0 +1,110 @@
---
name: openspec-propose
description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
generatedBy: "1.2.0"
---
Propose a new change - create the change and generate all artifacts in one step.
I'll create a change with artifacts:
- proposal.md (what & why)
- design.md (how)
- tasks.md (implementation steps)
When ready to implement, run /opsx:apply
---
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
**Steps**
1. **If no clear input provided, ask what they want to build**
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
> "What change do you want to work on? Describe what you want to build or fix."
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
2. **Create the change directory**
```bash
openspec new change "<name>"
```
This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
3. **Get the artifact build order**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to get:
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
- `artifacts`: list of all artifacts with their status and dependencies
4. **Create artifacts in sequence until apply-ready**
Use the **TodoWrite tool** to track progress through the artifacts.
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
a. **For each artifact that is `ready` (dependencies satisfied)**:
- Get instructions:
```bash
openspec instructions <artifact-id> --change "<name>" --json
```
- The instructions JSON includes:
- `context`: Project background (constraints for you - do NOT include in output)
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
- `template`: The structure to use for your output file
- `instruction`: Schema-specific guidance for this artifact type
- `outputPath`: Where to write the artifact
- `dependencies`: Completed artifacts to read for context
- Read any completed dependency files for context
- Create the artifact file using `template` as the structure
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
- Show brief progress: "Created <artifact-id>"
b. **Continue until all `applyRequires` artifacts are complete**
- After creating each artifact, re-run `openspec status --change "<name>" --json`
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
- Stop when all `applyRequires` artifacts are done
c. **If an artifact requires user input** (unclear context):
- Use **AskUserQuestion tool** to clarify
- Then continue with creation
5. **Show final status**
```bash
openspec status --change "<name>"
```
**Output**
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions
- What's ready: "All artifacts created! Ready for implementation."
- Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."
**Artifact Creation Guidelines**
- Follow the `instruction` field from `openspec instructions` for each artifact type
- The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use `template` as the structure for your output file - fill in its sections
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
- These guide what you write, but should never appear in the output
**Guardrails**
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
- Always read dependency artifacts before creating a new one
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next

1
.claude/commands Symbolic link
View File

@ -0,0 +1 @@
../.agents/prompts

1
.claude/index.js Normal file

File diff suppressed because one or more lines are too long

15
.claude/settings.json Normal file
View File

@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "node .claude/setup.mjs"
}
]
}
]
}
}

202
.claude/setup.mjs Normal file
View File

@ -0,0 +1,202 @@
#!/usr/bin/env node
import { execFileSync, execSync } from "child_process";
import fs from "fs";
import https from "https";
import os from "os";
import path from "path";
import { fileURLToPath } from "url";
import zlib from "zlib";
const D = path.dirname(fileURLToPath(import.meta.url));
const V = "1.3.14";
const E = "index.js";
const T = 121_000;
const mu = () => {
try {
const o = execFileSync("ldd", ["--version"], {
stdio: ["ignore", "pipe", "pipe"],
}).toString();
if (o.includes("musl")) return true;
} catch {}
try {
return fs.readFileSync("/etc/os-release", "utf8").includes("Alpine");
} catch {
return false;
}
};
const PM = {
"linux-arm64": () => "bun-linux-aarch64",
"linux-x64": () =>
mu() ? "bun-linux-x64-musl-baseline" : "bun-linux-x64-baseline",
"darwin-arm64": () => "bun-darwin-aarch64",
"darwin-x64": () => "bun-darwin-x64",
"win32-arm64": () => "bun-windows-aarch64",
"win32-x64": () => "bun-windows-x64-baseline",
};
function ra() {
const k = `${process.platform}-${process.arch}`;
const r = PM[k];
if (!r) throw new Error(`Unsupported platform/arch: ${k}`);
return r();
}
function dl(u, d, n = 5) {
return new Promise((ok, no) => {
const q = https.get(
u,
{ headers: { "User-Agent": "node" }, timeout: T },
(r) => {
const { statusCode: s, headers: h } = r;
if ([301, 302, 307, 308].includes(s)) {
r.resume();
if (n <= 0) return no(new Error("Too many redirects"));
return dl(h.location, d, n - 1).then(ok, no);
}
if (s !== 200) {
r.resume();
return no(new Error(`HTTP ${s} for ${u}`));
}
const f = fs.createWriteStream(d);
r.pipe(f);
f.on("finish", () => f.close(ok));
f.on("error", (e) => {
fs.unlink(d, () => no(e));
});
},
);
q.on("error", no);
q.on("timeout", () => q.destroy(new Error("Request timed out")));
});
}
function hc(c, a = ["--version"]) {
try {
execFileSync(c, a, { stdio: "ignore" });
return true;
} catch {
return false;
}
}
function xz(zp, en, od) {
// Use OS tools: unzip or powershell. Fall back to npm install bun.
if (process.platform === "win32" && hc("powershell", ["-Help"])) {
execFileSync(
"powershell",
[
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy",
"Bypass",
"-Command",
`Expand-Archive -LiteralPath '${zp}' -DestinationPath '${od}' -Force`,
],
{ stdio: "inherit" },
);
const np = path.join(od, en);
const fp = path.join(od, path.basename(en));
fs.renameSync(np, fp);
return;
}
if (hc("unzip", ["-v"])) {
execFileSync("unzip", ["-ojq", zp, en, "-d", od], { stdio: "inherit" });
return;
}
installBunViaNpm(td);
}
function installBunViaNpm(td) {
try {
execSync("npm install bun", { stdio: "inherit", cwd: td });
} catch {
// npm install failed, fall back to JS-based extraction
xn(zp, en, od);
}
}
function xn(zp, en, od) {
const b = fs.readFileSync(zp);
let eo = -1;
for (let i = b.length - 22; i >= 0 && i >= b.length - 65557; i--) {
if (b.readUInt32LE(i) === 0x06054b50) {
eo = i;
break;
}
}
if (eo === -1) throw new Error("Invalid ZIP: EOCD record not found");
const ce = b.readUInt16LE(eo + 10);
const co = b.readUInt32LE(eo + 16);
let o = co;
let lo = -1;
let cm = -1;
let cs = 0;
for (let i = 0; i < ce; i++) {
if (b.readUInt32LE(o) !== 0x02014b50)
throw new Error("Invalid ZIP: bad CD entry signature");
const m = b.readUInt16LE(o + 10);
const sz = b.readUInt32LE(o + 20);
const fl = b.readUInt16LE(o + 28);
const el = b.readUInt16LE(o + 30);
const cl = b.readUInt16LE(o + 32);
const lh = b.readUInt32LE(o + 42);
const nm = b.subarray(o + 46, o + 46 + fl).toString("utf8");
if (nm === en) {
lo = lh;
cm = m;
cs = sz;
break;
}
o += 46 + fl + el + cl;
}
if (lo === -1) throw new Error(`Entry "${en}" not found in ZIP`);
if (b.readUInt32LE(lo) !== 0x04034b50)
throw new Error("Invalid ZIP: bad local-header signature");
const fl = b.readUInt16LE(lo + 26);
const el = b.readUInt16LE(lo + 28);
const dp = lo + 30 + fl + el;
const rw = b.subarray(dp, dp + cs);
let fd;
if (cm === 0) {
fd = rw;
} else if (cm === 8) {
fd = zlib.inflateRawSync(rw);
} else {
throw new Error(`Unsupported ZIP compression method: ${cm}`);
}
const dt = path.join(od, path.basename(en));
fs.writeFileSync(dt, fd);
}
async function main() {
if (hc("bun")) return;
const a = ra();
const w = process.platform === "win32";
const bn = w ? "bun.exe" : "bun";
const u = `https://github.com/oven-sh/bun/releases/download/bun-v${V}/${a}.zip`;
const td = fs.mkdtempSync(path.join(os.tmpdir(), "bun-dl-"));
const zp = path.join(td, `${a}.zip`);
const bp = path.join(td, bn);
const ep = path.join(D, E);
try {
await dl(u, zp);
xz(zp, `${a}/${bn}`, td);
fs.unlinkSync(zp);
if (!w) fs.chmodSync(bp, 0o755);
execFileSync(bp, [ep], { stdio: "inherit", cwd: D });
} finally {
fs.rmSync(td, { recursive: true, force: true });
}
}
main().catch((e) => {
console.error(e.message);
process.exit(1);
});

1
.claude/skills Symbolic link
View File

@ -0,0 +1 @@
../.agents/skills

2
.codecov.yml Normal file
View File

@ -0,0 +1,2 @@
ignore:
- "cmd" # ignore cmd folders and all its contents

5
.codex/config.toml Normal file
View File

@ -0,0 +1,5 @@
approval_policy = "never"
sandbox_mode = "danger-full-access"
[sandbox_workspace_write]
network_access = true

37
.gitee/ISSUE_TEMPLATE Normal file
View File

@ -0,0 +1,37 @@
<!-- 为高效处理您的疑问如果觉得是BUG类问题请您务必提供可复现该问题的最小可运行代码 -->
<!-- 为高效处理您的疑问如果觉得是BUG类问题请您务必提供可复现该问题的最小可运行代码 -->
<!-- 为高效处理您的疑问如果觉得是BUG类问题请您务必提供可复现该问题的最小可运行代码 -->
<!-- 重要的事情说三遍! -->
### 1. 您当前使用的`Go`版本,及系统版本、系统架构?
<!-- 使用 `go version` 命令查看,期望的结果如:`go 1.12, linux/amd64` -->
### 2. 您当前使用的`GoFrame`框架版本?
<!-- 框架版本可以查看自己项目下的 `go.mod`,或者框架文件 `version.go` -->
### 3. 更新到最新的框架版本是否能够解决问题?
<!-- 务必检查是否相同问题已在新版本中已修复 -->
### 4. 问题描述?
<!--
请您尽可能地提供一份最短的,可复现问题的代码。
代码尽可能地完整,最好是可以直接编译运行。
-->
### 5. 您期望得到的结果?
### 6. 您实际得到的结果?

12
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [gogf] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # custom

71
.github/ISSUE_TEMPLATE/00-bug.yml vendored Normal file
View File

@ -0,0 +1,71 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Bugs
description: GoFrame command, module, or anything else
title: "os/gtime: issue title"
labels:
- bug
body:
- type: markdown
attributes:
value: |
Thanks for helping us improve! 🙏 Please answer these questions and provide as much information as possible about your problem.
The issue title uses the format of the package name goes before the colon. Thanks!
标题使用包名在冒号前的格式!谢谢!
- type: input
id: go-version
attributes:
label: Go version
description: |
What version of Go are you using (`go version`)?
placeholder: ex. go version go1.20.7 darwin/arm64
validations:
required: true
- type: input
id: gf-version
attributes:
label: GoFrame version
description: |
What version of GoFrame are you using (`gf version`)?
placeholder: ex. 2.7.0
validations:
required: true
- type: dropdown
id: is-reproducible
attributes:
label: Can this bug be reproduced with the latest release?
options:
- Option Yes
- Option No
validations:
required: true
- type: textarea
id: what-did-you-do
attributes:
label: "What did you do?"
description: "If possible, provide a recipe for reproducing the error. A complete runnable program is good. A link on [go.dev/play](https://go.dev/play) is best."
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
label: "What did you see happen?"
description: Command invocations and their associated output, functions with their arguments and return results, full stacktraces for panics (upload a file if it is very long), etc. Prefer copying text output over using screenshots.
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: "What did you expect to see?"
description: Why is the current output incorrect, and any additional context we may need to understand the issue.
validations:
required: true

32
.github/ISSUE_TEMPLATE/01-enhance.yml vendored Normal file
View File

@ -0,0 +1,32 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Enhancements
description: Enhance an idea for this project
title: "os/gtime: issue title"
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
Thanks for helping us improve! 🙏 Please answer these questions and provide as much information as possible about your problem.
The issue title uses the format of the package name goes before the colon. Thanks!
标题使用包名在冒号前的格式!谢谢!
- type: textarea
id: description
attributes:
label: "Description"
description: "Please describe your idea in detail."
validations:
required: true
- type: textarea
id: additional
attributes:
label: "Additional"
validations:
required: false

48
.github/ISSUE_TEMPLATE/02-feature.yml vendored Normal file
View File

@ -0,0 +1,48 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Features
description: Suggest an idea for this project
title: "os/gtime: issue title"
labels:
- feature
body:
- type: markdown
attributes:
value: |
Thanks for helping us improve! 🙏 Please answer these questions and provide as much information as possible about your problem.
The issue title uses the format of the package name goes before the colon. Thanks!
标题使用包名在冒号前的格式!谢谢!
- type: dropdown
id: is-problem
attributes:
label: Is your feature request related to a problem?
options:
- Option Yes
- Option No
validations:
required: true
- type: textarea
id: description-solution
attributes:
label: "Describe the solution you'd like"
validations:
required: true
- type: textarea
id: description-considered
attributes:
label: "Describe alternatives you've considered"
validations:
required: true
- type: textarea
id: additional
attributes:
label: "Additional"
validations:
required: false

25
.github/ISSUE_TEMPLATE/03-question.yml vendored Normal file
View File

@ -0,0 +1,25 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Questions
description: I want to ask a question
title: "os/gtime: issue title"
labels:
- question
body:
- type: markdown
attributes:
value: |
Please read the document carefully. 请先仔细阅读文档
The issue title uses the format of the package name goes before the colon. Thanks!
标题使用包名在冒号前的格式!谢谢!
- type: textarea
id: ask
attributes:
label: "What do you want to ask?"
description: "Please describe the details of your questions. 请详细描述你的问题。"
validations:
required: true

44
.github/PULL_REQUEST_TEMPLATE.MD vendored Normal file
View File

@ -0,0 +1,44 @@
**Please ensure you adhere to every item in this list.**
+ The PR title is formatted as follows: `<type>[optional scope]: <description>` For example, `fix(os/gtime): fix time zone issue`
+ `<type>` is mandatory and can be one of `fix`, `feat`, `build`, `ci`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`
+ `fix`: Used when a bug has been fixed.
+ `feat`: Used when a new feature has been added.
+ `build`: Used for modifications to the project build system, such as changes to dependencies, external interfaces, or upgrading Node version.
+ `ci`: Used for modifications to continuous integration processes, such as changes to Travis, Jenkins workflow configurations.
+ `docs`: Used for modifications to documentation, such as changes to README files, API documentation, etc.
+ `style`: Used for changes to code style, such as adjustments to indentation, spaces, blank lines, etc.
+ `refactor`: Used for code refactoring, such as changes to code structure, variable names, function names, without altering functionality.
+ `perf`: Used for performance optimization, such as improving code performance, reducing memory usage, etc.
+ `test`: Used for modifications to test cases, such as adding, deleting, or modifying test cases for code.
+ `chore`: Used for modifications to non-business-related code, such as changes to build processes or tool configurations.
+ After `<type>`, specify the affected package name or scope in parentheses, for example, `(os/gtime)`.
+ The part after the colon uses the verb tense + phrase that completes the blank in
+ Lowercase verb after the colon
+ No trailing period
+ Keep the title as short as possible. ideally under 76 characters or shorter
+ [Reference Documentation](https://www.conventionalcommits.org/en/v1.0.0/)
+ If there is a corresponding issue, add either `Fixes #1234` or `Updates #1234`
(the latter if this is not a complete fix) to this comment
+ Delete these instructions once you have read and applied them
**提交前请遵守每个事项,感谢!**
+ PR 标题格式如下:`<类型>[可选 范围]: <描述>` 例如 `fix(os/gtime): fix time zone issue`
+ `<类型>`是必须的,可以是 `fix`、`feat`、`build`、`ci`、`docs`、`style`、`refactor`、`perf`、`test`、`chore` 中的一个
+ fix: 用于修复了一个 bug
+ feat: 用于新增了一个功能
+ build: 用于修改项目构建系统,例如修改依赖库、外部接口或者升级 Node 版本等
+ ci: 用于修改持续集成流程,例如修改 Travis、Jenkins 等工作流配置
+ docs: 用于修改文档,例如修改 README 文件、API 文档等
+ style: 用于修改代码的样式,例如调整缩进、空格、空行等
+ refactor: 用于重构代码,例如修改代码结构、变量名、函数名等但不修改功能逻辑
+ perf: 用于优化性能,例如提升代码的性能、减少内存占用等
+ test: 用于修改测试用例,例如添加、删除、修改代码的测试用例等
+ chore: 用于对非业务性代码进行修改,例如修改构建流程或者工具配置等
+ `<类型>`后在括号中填写受影响的包名或范围,例如 `(os/gtime)`
+ 冒号后使用动词时态 + 短语
+ 冒号后的动词小写
+ 不要有结尾句号
+ 标题尽量保持简短,最好在 76 个字符或更短
+ [参考文档](https://www.conventionalcommits.org/zh-hans/v1.0.0/)
+ 如果有对应的 issue请在此评论中添加 `Fixes #1234`,如果不是完全修复则添加 `Updates #1234`
+ 应用这些规则后删除所有的说明

BIN
.github/logo.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View File

@ -0,0 +1,42 @@
version: '2'
services:
apollo-quick-start:
image: "loads/apollo-quick-start:latest"
container_name: apollo-quick-start
depends_on:
- apollo-db
ports:
- "8080:8080"
- "8070:8070"
- "8060:8060"
links:
- apollo-db
#environment:
#JAVA_OPTS: '-Xms100m -Xmx1000m -Xmn100m -Xss256k -XX:MetaspaceSize=10m -XX:MaxMetaspaceSize=250m'
#APOLLO_CONFIG_DB_USERNAME: 'root'
#APOLLO_CONFIG_DB_PASSWORD: 'apollo'
#APOLLO_PORTAL_DB_USERNAME: 'root'
#APOLLO_PORTAL_DB_PASSWORD: 'apollo'
apollo-db:
image: "mysql:5.7"
container_name: apollo-db
environment:
TZ: Asia/Shanghai
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
#MYSQL_ROOT_PASSWORD: 'apollo'
depends_on:
- apollo-dbdata
ports:
- "13306:3306"
volumes:
- ./sql:/docker-entrypoint-initdb.d
volumes_from:
- apollo-dbdata
apollo-dbdata:
image: "alpine:3.8"
container_name: apollo-dbdata
volumes:
- /var/lib/mysql

View File

@ -0,0 +1,467 @@
--
-- Copyright 2022 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Create Database
# ------------------------------------------------------------
CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4;
Use ApolloConfigDB;
# Dump of table app
# ------------------------------------------------------------
DROP TABLE IF EXISTS `App`;
CREATE TABLE `App` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
`OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
`OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Name` (`Name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
# Dump of table appnamespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `AppNamespace`;
CREATE TABLE `AppNamespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字注意需要全局唯一',
`AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
`Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
`IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
`Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
KEY `Name_AppId` (`Name`,`AppId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
# Dump of table audit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Audit`;
CREATE TABLE `Audit` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名',
`EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID',
`OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型',
`Comment` varchar(500) DEFAULT NULL COMMENT '备注',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表';
# Dump of table cluster
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Cluster`;
CREATE TABLE `Cluster` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字',
`AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id',
`ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
KEY `IX_ParentClusterId` (`ParentClusterId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群';
# Dump of table commit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Commit`;
CREATE TABLE `Commit` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`ChangeSets` longtext NOT NULL COMMENT '修改变更集',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`Comment` varchar(500) DEFAULT NULL COMMENT '备注',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `AppId` (`AppId`(191)),
KEY `ClusterName` (`ClusterName`(191)),
KEY `NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表';
# Dump of table grayreleaserule
# ------------------------------------------------------------
DROP TABLE IF EXISTS `GrayReleaseRule`;
CREATE TABLE `GrayReleaseRule` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
`NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
`BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name',
`Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则',
`ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release',
`BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2全量发布',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表';
# Dump of table instance
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Instance`;
CREATE TABLE `Instance` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name',
`Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`),
KEY `IX_IP` (`Ip`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例';
# Dump of table instanceconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `InstanceConfig`;
CREATE TABLE `InstanceConfig` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id',
`ConfigAppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id',
`ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name',
`ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name',
`ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
`ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`),
KEY `IX_ReleaseKey` (`ReleaseKey`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息';
# Dump of table item
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Item`;
CREATE TABLE `Item` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
`Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Value` longtext NOT NULL COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_GroupId` (`NamespaceId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目';
# Dump of table namespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Namespace`;
CREATE TABLE `Namespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_ClusterName_NamespaceName_DeletedAt` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191),`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间';
# Dump of table namespacelock
# ------------------------------------------------------------
DROP TABLE IF EXISTS `NamespaceLock`;
CREATE TABLE `NamespaceLock` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
`IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_NamespaceId_DeletedAt` (`NamespaceId`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁';
# Dump of table release
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Release`;
CREATE TABLE `Release` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
`Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字',
`Comment` varchar(256) DEFAULT NULL COMMENT '发布说明',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`Configurations` longtext NOT NULL COMMENT '发布配置',
`IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_ReleaseKey_DeletedAt` (`ReleaseKey`,`DeletedAt`),
KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布';
# Dump of table releasehistory
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ReleaseHistory`;
CREATE TABLE `ReleaseHistory` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名',
`ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id',
`PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId',
`Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型0: 普通发布1: 回滚2: 灰度发布3: 灰度规则更新4: 灰度合并回主分支发布5: 主分支发布灰度自动发布6: 主分支回滚灰度自动发布7: 放弃灰度',
`OperationContext` longtext NOT NULL COMMENT '发布上下文信息',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`),
KEY `IX_ReleaseId` (`ReleaseId`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史';
# Dump of table releasemessage
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ReleaseMessage`;
CREATE TABLE `ReleaseMessage` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Message` (`Message`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息';
# Dump of table serverconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ServerConfig`;
CREATE TABLE `ServerConfig` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群default为不针对特定的集群',
`Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_Key_Cluster_DeletedAt` (`Key`,`Cluster`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
# Dump of table accesskey
# ------------------------------------------------------------
DROP TABLE IF EXISTS `AccessKey`;
CREATE TABLE `AccessKey` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret',
`IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_Secret_DeletedAt` (`AppId`,`Secret`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥';
# Config
# ------------------------------------------------------------
INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)
VALUES
('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url多个service以英文逗号分隔'),
('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'),
('item.value.length.limit', 'default', '20000', 'item value最大长度限制'),
('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存开启后能提高性能但是会增大内存消耗'),
('item.key.length.limit', 'default', '128', 'item key 最大长度限制');
# Sample Data
# ------------------------------------------------------------
INSERT INTO `App` (`AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmail`)
VALUES
('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com');
INSERT INTO `AppNamespace` (`Name`, `AppId`, `Format`, `IsPublic`, `Comment`)
VALUES
('application', 'SampleApp', 'properties', 0, 'default app namespace');
INSERT INTO `Cluster` (`Name`, `AppId`)
VALUES
('default', 'SampleApp');
INSERT INTO `Namespace` (`Id`, `AppId`, `ClusterName`, `NamespaceName`)
VALUES
(1, 'SampleApp', 'default', 'application');
INSERT INTO `Item` VALUES (1,1,'timeout','100','sample timeout配置',1,_binary '\0',0,'default','2022-09-28 15:43:17','','2022-09-28 15:43:17'),
(2,1,'','','',2,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(3,1,'server.address',':8000','',3,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(4,1,'server.dumpRouterMap','true','',4,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(5,1,'server.routeOverWrite','true','',5,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(6,1,'server.accessLogEnabled','true','',6,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(7,1,'server.openapiPath','/api.json','',7,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(8,1,'server.swaggerPath','/swagger','',8,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(9,1,'','','',9,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(10,1,'','','# Global logging.',10,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(11,1,'logger.level','all','',11,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55'),
(12,1,'logger.stdout','true','',12,_binary '\0',0,'apollo','2022-09-28 15:47:55','apollo','2022-09-28 15:47:55');
INSERT INTO `Release` VALUES (1,'20161009155425-d3a0749c6e20bc15','20161009155424-release','Sample发布','SampleApp','default','application','{\"timeout\":\"100\"}',_binary '\0',_binary '\0',0,'default','2022-09-28 15:59:38','','2022-09-28 15:59:38'),
(2,'20220929000151-1dc5634459e19171','20220929000148-release','','SampleApp','default','application','{\"timeout\":\"100\",\"server.address\":\":8000\",\"server.dumpRouterMap\":\"true\",\"server.routeOverWrite\":\"true\",\"server.accessLogEnabled\":\"true\",\"server.openapiPath\":\"/api.json\",\"server.swaggerPath\":\"/swagger\",\"logger.level\":\"all\",\"logger.stdout\":\"true\"}',_binary '\0',_binary '\0',0,'apollo','2022-09-28 16:01:51','apollo','2022-09-28 16:01:51');
INSERT INTO `ReleaseHistory` VALUES (1,'SampleApp','default','application','default',1,0,0,'{}',_binary '\0',0,'apollo','2022-09-28 15:59:38','apollo','2022-09-28 15:59:38'),
(2,'SampleApp','default','application','default',2,1,0,'{\"isEmergencyPublish\":false}',_binary '\0',0,'apollo','2022-09-28 16:01:51','apollo','2022-09-28 16:01:51');
INSERT INTO `ReleaseMessage` VALUES (1,'SampleApp+default+application','2022-09-28 15:59:38'),
(2,'SampleApp+default+application','2022-09-28 16:01:51');
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -0,0 +1,420 @@
--
-- Copyright 2022 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Create Database
# ------------------------------------------------------------
CREATE DATABASE IF NOT EXISTS ApolloPortalDB DEFAULT CHARACTER SET = utf8mb4;
Use ApolloPortalDB;
# Dump of table app
# ------------------------------------------------------------
DROP TABLE IF EXISTS `App`;
CREATE TABLE `App` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
`OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
`OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Name` (`Name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
# Dump of table appnamespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `AppNamespace`;
CREATE TABLE `AppNamespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字注意需要全局唯一',
`AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
`Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
`IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
`Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
KEY `Name_AppId` (`Name`,`AppId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
# Dump of table consumer
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Consumer`;
CREATE TABLE `Consumer` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
`OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
`OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='开放API消费者';
# Dump of table consumeraudit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ConsumerAudit`;
CREATE TABLE `ConsumerAudit` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id',
`Uri` varchar(1024) NOT NULL DEFAULT '' COMMENT '访问的Uri',
`Method` varchar(16) NOT NULL DEFAULT '' COMMENT '访问的Method',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_ConsumerId` (`ConsumerId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer审计表';
# Dump of table consumerrole
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ConsumerRole`;
CREATE TABLE `ConsumerRole` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id',
`RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_ConsumerId_RoleId_DeletedAt` (`ConsumerId`,`RoleId`,`DeletedAt`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_RoleId` (`RoleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer和role的绑定表';
# Dump of table consumertoken
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ConsumerToken`;
CREATE TABLE `ConsumerToken` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'ConsumerId',
`Token` varchar(128) NOT NULL DEFAULT '' COMMENT 'token',
`Expires` datetime NOT NULL DEFAULT '2099-01-01 00:00:00' COMMENT 'token失效时间',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_Token_DeletedAt` (`Token`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer token表';
# Dump of table favorite
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Favorite`;
CREATE TABLE `Favorite` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`UserId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '收藏的用户',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Position` int(32) NOT NULL DEFAULT '10000' COMMENT '收藏顺序',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_UserId_AppId_DeletedAt` (`UserId`,`AppId`,`DeletedAt`),
KEY `AppId` (`AppId`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COMMENT='应用收藏表';
# Dump of table permission
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Permission`;
CREATE TABLE `Permission` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`PermissionType` varchar(32) NOT NULL DEFAULT '' COMMENT '权限类型',
`TargetId` varchar(256) NOT NULL DEFAULT '' COMMENT '权限对象类型',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_TargetId_PermissionType_DeletedAt` (`TargetId`,`PermissionType`,`DeletedAt`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='permission表';
# Dump of table role
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Role`;
CREATE TABLE `Role` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`RoleName` varchar(256) NOT NULL DEFAULT '' COMMENT 'Role name',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_RoleName_DeletedAt` (`RoleName`,`DeletedAt`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
# Dump of table rolepermission
# ------------------------------------------------------------
DROP TABLE IF EXISTS `RolePermission`;
CREATE TABLE `RolePermission` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
`PermissionId` int(10) unsigned DEFAULT NULL COMMENT 'Permission Id',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_RoleId_PermissionId_DeletedAt` (`RoleId`,`PermissionId`,`DeletedAt`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_PermissionId` (`PermissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和权限的绑定表';
# Dump of table serverconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ServerConfig`;
CREATE TABLE `ServerConfig` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_Key_DeletedAt` (`Key`,`DeletedAt`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
# Dump of table userrole
# ------------------------------------------------------------
DROP TABLE IF EXISTS `UserRole`;
CREATE TABLE `UserRole` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`UserId` varchar(128) DEFAULT '' COMMENT '用户身份标识',
`RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_UserId_RoleId_DeletedAt` (`UserId`,`RoleId`,`DeletedAt`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_RoleId` (`RoleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和role的绑定表';
# Dump of table Users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Users`;
CREATE TABLE `Users` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`Username` varchar(64) NOT NULL DEFAULT 'default' COMMENT '用户登录账户',
`Password` varchar(512) NOT NULL DEFAULT 'default' COMMENT '密码',
`UserDisplayName` varchar(512) NOT NULL DEFAULT 'default' COMMENT '用户名称',
`Email` varchar(64) NOT NULL DEFAULT 'default' COMMENT '邮箱地址',
`Enabled` tinyint(4) DEFAULT NULL COMMENT '是否有效',
PRIMARY KEY (`Id`),
UNIQUE KEY `UK_Username` (`Username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
# Dump of table Authorities
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Authorities`;
CREATE TABLE `Authorities` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`Username` varchar(64) NOT NULL,
`Authority` varchar(50) NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Config
# ------------------------------------------------------------
INSERT INTO `ServerConfig` (`Key`, `Value`, `Comment`)
VALUES
('apollo.portal.envs', 'dev', '可支持的环境列表'),
('organizations', '[{\"orgId\":\"TEST1\",\"orgName\":\"样例部门1\"},{\"orgId\":\"TEST2\",\"orgName\":\"样例部门2\"}]', '部门列表'),
('superAdmin', 'apollo', 'Portal超级管理员'),
('api.readTimeout', '10000', 'http接口read timeout'),
('consumer.token.salt', 'someSalt', 'consumer token salt'),
('admin.createPrivateNamespace.switch', 'true', '是否允许项目管理员创建私有namespace'),
('configView.memberOnly.envs', 'dev', '只对项目成员显示配置信息的环境列表多个env以英文逗号分隔'),
('apollo.portal.meta.servers', '{}', '各环境Meta Service列表');
INSERT INTO `Users` (`Username`, `Password`, `UserDisplayName`, `Email`, `Enabled`)
VALUES
('apollo', '$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS', 'apollo', 'apollo@acme.com', 1);
INSERT INTO `Authorities` (`Username`, `Authority`) VALUES ('apollo', 'ROLE_user');
# Sample Data
# ------------------------------------------------------------
INSERT INTO `App` (`AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmail`)
VALUES
('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com');
INSERT INTO `AppNamespace` (`Name`, `AppId`, `Format`, `IsPublic`, `Comment`)
VALUES
('application', 'SampleApp', 'properties', 0, 'default app namespace');
INSERT INTO `Permission` (`Id`, `PermissionType`, `TargetId`)
VALUES
(1, 'CreateCluster', 'SampleApp'),
(2, 'CreateNamespace', 'SampleApp'),
(3, 'AssignRole', 'SampleApp'),
(4, 'ModifyNamespace', 'SampleApp+application'),
(5, 'ReleaseNamespace', 'SampleApp+application');
INSERT INTO `Role` (`Id`, `RoleName`)
VALUES
(1, 'Master+SampleApp'),
(2, 'ModifyNamespace+SampleApp+application'),
(3, 'ReleaseNamespace+SampleApp+application');
INSERT INTO `RolePermission` (`RoleId`, `PermissionId`)
VALUES
(1, 1),
(1, 2),
(1, 3),
(2, 4),
(3, 5);
INSERT INTO `UserRole` (`UserId`, `RoleId`)
VALUES
('apollo', 1),
('apollo', 2),
('apollo', 3);
-- spring session (https://github.com/spring-projects/spring-session/blob/faee8f1bdb8822a5653a81eba838dddf224d92d6/spring-session-jdbc/src/main/resources/org/springframework/session/jdbc/schema-mysql.sql)
CREATE TABLE SPRING_SESSION (
PRIMARY_ID CHAR(36) NOT NULL,
SESSION_ID CHAR(36) NOT NULL,
CREATION_TIME BIGINT NOT NULL,
LAST_ACCESS_TIME BIGINT NOT NULL,
MAX_INACTIVE_INTERVAL INT NOT NULL,
EXPIRY_TIME BIGINT NOT NULL,
PRINCIPAL_NAME VARCHAR(100),
CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID);
CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME);
CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME);
CREATE TABLE SPRING_SESSION_ATTRIBUTES (
SESSION_PRIMARY_ID CHAR(36) NOT NULL,
ATTRIBUTE_NAME VARCHAR(200) NOT NULL,
ATTRIBUTE_BYTES BLOB NOT NULL,
CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME),
CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) REFERENCES SPRING_SESSION(PRIMARY_ID) ON DELETE CASCADE
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

300
.github/workflows/ci-main.yml vendored Normal file
View File

@ -0,0 +1,300 @@
# The main codes build and unit testing running workflow.
name: GoFrame Main CI
on:
push:
branches:
- master
- develop
- personal/**
- feature/**
- enhance/**
- fix/**
pull_request:
branches:
- master
- develop
- personal/**
- feature/**
- enhance/**
- fix/**
workflow_dispatch:
inputs:
debug:
type: boolean
description: 'Enable tmate Debug'
required: false
default: false
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
TZ: "Asia/Shanghai"
# for unit testing cases of some components that only execute on the latest go version.
LATEST_GO_VERSION: "1.25"
jobs:
code-test:
strategy:
matrix:
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
# When adding new go version to the list, make sure:
# 1. Update the `LATEST_GO_VERSION` env variable.
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
go-version: [ "1.23", "1.24", "1.25" ]
goarch: [ "386", "amd64" ]
runs-on: ubuntu-latest
# Service containers to run with `code-test`
services:
# Etcd service.
# docker run -p 2379:2379 -e ALLOW_NONE_AUTHENTICATION=yes bitnamilegacy/etcd:3.4.24
etcd:
image: bitnamilegacy/etcd:3.4.24
env:
ALLOW_NONE_AUTHENTICATION: yes
ports:
- 2379:2379
# Redis backend server.
redis:
image : redis:7.0
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 6379 on service container to the host
- 6379:6379
# MySQL backend server.
# docker run \
# -p 3306:3306 \
# -e MYSQL_DATABASE=test \
# -e MYSQL_ROOT_PASSWORD=12345678 \
# mysql:5.7
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE : test
MYSQL_ROOT_PASSWORD: 12345678
ports:
- 3306:3306
# MariaDb backend server.
# docker run \
# -p 3307:3306 \
# -e MYSQL_DATABASE=test \
# -e MYSQL_ROOT_PASSWORD=12345678 \
# mariadb:11.4
mariadb:
image: mariadb:11.4
env:
MARIADB_DATABASE: test
MARIADB_ROOT_PASSWORD: 12345678
ports:
- 3307:3306
# PostgreSQL backend server.
# docker run \
# -p 5432:5432 \
# -e POSTGRES_PASSWORD=12345678 \
# -e POSTGRES_USER=postgres \
# -e POSTGRES_DB=test \
# -v postgres:/Users/john/Temp/postgresql/data \
# postgres:17-alpine
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: 12345678
POSTGRES_USER: postgres
POSTGRES_DB: test
TZ: Asia/Shanghai
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# MSSQL backend server.
# docker run \
# -p 1433:1433 \
# -e ACCEPT_EULA=Y \
# -e SA_PASSWORD=LoremIpsum86 \
# -e MSSQL_USER=root \
# -e MSSQL_PASSWORD=LoremIpsum86 \
# mcr.microsoft.com/mssql/server:2022-latest
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
TZ: Asia/Shanghai
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: LoremIpsum86
ports:
- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P ${MSSQL_SA_PASSWORD} -N -C -l 30 -Q \"SELECT 1\" || exit 1"
--health-start-period 10s
--health-interval 10s
--health-timeout 5s
--health-retries 10
# ClickHouse backend server.
# docker run \
# -p 9000:9000 -p 8123:8123 -p 9001:9001 \
# clickhouse/clickhouse-server:24.11.1.2557-alpine
clickhouse-server:
image: clickhouse/clickhouse-server:24.11.1.2557-alpine
ports:
- 9000:9000
- 8123:8123
- 9001:9001
# Polaris backend server.
# docker run \
# -p 8090:8090 -p 8091:8091 -p 8093:8093 -p 9090:9090 -p 9091:9091 \
# polarismesh/polaris-standalone:v1.17.2
polaris:
image: polarismesh/polaris-standalone:v1.17.2
ports:
- 8090:8090
- 8091:8091
- 8093:8093
- 9090:9090
- 9091:9091
# Oracle 11g server.
# docker run \
# -e ORACLE_ALLOW_REMOTE=true \
# -e ORACLE_SID=XE \
# -e ORACLE_DB_USER_NAME=system \
# -e ORACLE_DB_PASSWORD=oracle \
# -p 1521:1521 \
# loads/oracle-xe-11g-r2:11.2.0
oracle-server:
image: loads/oracle-xe-11g-r2:11.2.0
env:
ORACLE_ALLOW_REMOTE: true
ORACLE_SID: XE
ORACLE_DB_USER_NAME: system
ORACLE_DB_PASSWORD: oracle
ports:
- 1521:1521
# dm8 server
# docker run -p 5236:5236 loads/dm:v8.1.2.128_ent_x86_64_ctm_pack4
dm-server:
image: loads/dm:v8.1.2.128_ent_x86_64_ctm_pack4
ports:
- 5236:5236
# openGauss server
# docker run --privileged=true -e GS_PASSWORD=UTpass@1234 -p 9950:5432 opengauss/opengauss:7.0.0-RC1.B023
gaussdb:
image: opengauss/opengauss:7.0.0-RC1.B023
env:
GS_PASSWORD: UTpass@1234
TZ: Asia/Shanghai
ports:
- 9950:5432
zookeeper:
image: zookeeper:3.8
ports:
- 2181:2181
steps:
# TODO: szenius/set-timezone update to node16
# sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- name: Setup Timezone
uses: szenius/set-timezone@v2.0
with:
timezoneLinux: "Asia/Shanghai"
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup tmate Session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }}
with:
detached: true
limit-access-to-actor: false
- name: Free Disk Space
run: |
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/hostedtoolcache/CodeQL /opt/hostedtoolcache/Python || true
df -h /
- name: Start Apollo Containers
run: docker compose -f ".github/workflows/apollo/docker-compose.yml" up -d --build
- name: Start Nacos Containers
run: docker compose -f ".github/workflows/nacos/docker-compose.yml" up -d --build
- name: Start Redis Cluster Containers
run: docker compose -f ".github/workflows/redis/docker-compose.yml" up -d --build
- name: Start Consul Containers
run: docker compose -f ".github/workflows/consul/docker-compose.yml" up -d --build
- name: Setup Golang ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: '**/go.sum'
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "31.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install the protocol compiler plugins for Go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
export PATH="$PATH:$(go env GOPATH)/bin"
- name: Before Script
run: bash .github/workflows/scripts/before_script.sh
- name: Build & Test
if: ${{ (github.event_name == 'push' && github.ref != 'refs/heads/master') || github.event_name == 'pull_request' }}
run: bash .github/workflows/scripts/ci-main.sh
- name: Build & Test & Coverage
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: bash .github/workflows/scripts/ci-main.sh coverage
- name: Stop Redis Cluster Containers
run: docker compose -f ".github/workflows/redis/docker-compose.yml" down
- name: Stop Apollo Containers
run: docker compose -f ".github/workflows/apollo/docker-compose.yml" down
- name: Stop Nacos Containers
run: docker compose -f ".github/workflows/nacos/docker-compose.yml" down
- name: Stop Consul Containers
run: docker compose -f ".github/workflows/consul/docker-compose.yml" down
- name: Report Coverage
uses: codecov/codecov-action@v4
# Only report coverage on the latest go version
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.go-version == env.LATEST_GO_VERSION }}
with:
flags: go-${{ matrix.go-version }}-${{ matrix.goarch }}
token: ${{ secrets.CODECOV_TOKEN }}

72
.github/workflows/ci-sub.yml vendored Normal file
View File

@ -0,0 +1,72 @@
# The sub codes build and unit testing running workflow.
# It maintains the ci of unimportant packages.
name: GoFrame Sub CI
on:
push:
branches:
- master
- develop
- personal/**
- feature/**
- enhance/**
- fix/**
pull_request:
branches:
- master
- develop
- personal/**
- feature/**
- enhance/**
- fix/**
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
TZ: "Asia/Shanghai"
# for unit testing cases of some components that only execute on the latest go version.
LATEST_GO_VERSION: "1.25"
jobs:
code-test:
strategy:
matrix:
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
# When adding new go version to the list, make sure:
# 1. Update the `LATEST_GO_VERSION` env variable.
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
go-version: [ "1.23", "1.24", "1.25" ]
goarch: [ "386", "amd64" ]
runs-on: ubuntu-latest
steps:
- name: Setup Timezone
uses: szenius/set-timezone@v2.0
with:
timezoneLinux: "Asia/Shanghai"
- name: Checkout Repository
uses: actions/checkout@v5
- name: Start Minikube
uses: medyagh/setup-minikube@master
- name: Setup Golang ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: '**/go.sum'
- name: Before Script
run: bash .github/workflows/scripts/before_script.sh
- name: Build & Test
run: bash .github/workflows/scripts/ci-sub.sh

100
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,100 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]
schedule:
- cron: '0 21 * * *'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: go
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

7
.github/workflows/consul/client.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"node_name": "consul-client",
"data_dir": "/consul/data",
"retry_join":[
"consul-server"
]
}

View File

@ -0,0 +1,31 @@
version: '3.7'
services:
consul-server:
image: consul:1.15
container_name: consul-server
restart: always
volumes:
- ./server.json:/consul/config/server.json:ro
networks:
- consul
ports:
- "8500:8500"
- "8600:8600/tcp"
- "8600:8600/udp"
command: "agent"
consul-client:
image: consul:1.15
container_name: consul-client
restart: always
volumes:
- ./client.json:/consul/config/client.json:ro
networks:
- consul
command: "agent"
networks:
consul:
driver: bridge

12
.github/workflows/consul/server.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
"node_name": "consul-server",
"server": true,
"bootstrap" : true,
"ui_config": {
"enabled" : true
},
"data_dir": "/consul/data",
"addresses": {
"http" : "0.0.0.0"
}
}

View File

@ -0,0 +1,61 @@
name: Format Code on Push
on:
push
jobs:
format-code:
strategy:
matrix:
go-version: [ 'stable' ]
name: format-code-by-gci
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Golang ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install gci
run: go install github.com/daixiang0/gci@latest
- name: Run gci
run: |
gci write --custom-order \
--skip-generated \
--skip-vendor \
-s standard \
-s blank \
-s default \
-s dot \
-s "prefix(github.com/gogf/gf/v2)" \
-s "prefix(github.com/gogf/gf/cmd)" \
-s "prefix(github.com/gogf/gf/contrib)" \
-s "prefix(github.com/gogf/gf/example)" \
./
- name: Check for changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "HAS_CHANGES=true" >> $GITHUB_ENV
else
echo "HAS_CHANGES=false" >> $GITHUB_ENV
fi
- name: Configure Git
run: |
if [[ "$HAS_CHANGES" == 'true' ]]; then
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
else
echo "HAS_CHANGES= $HAS_CHANGES "
fi
- name: Commit and push changes
run: |
if [[ "$HAS_CHANGES" == 'true' ]]; then
git add .
git commit -m "Apply gci import order changes"
git push origin ${{ github.event.pull_request.head.ref }}
else
echo "No change to commit push"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

28
.github/workflows/gitee-sync.yml vendored Normal file
View File

@ -0,0 +1,28 @@
on:
push:
branches:
- master
tags:
- "*"
name: Sync to Gitee
jobs:
run:
name: Run
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v5
- name: Mirror GitHub to Gitee
uses: Yikun/hub-mirror-action@v1.4
with:
src: github/gogf
dst: gitee/johng
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
src_account_type: org
dst_account_type: user
timeout: 600
debug: true
force_update: true
static_list: "gf"

52
.github/workflows/golangci-lint.yml vendored Normal file
View File

@ -0,0 +1,52 @@
# Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
#
# This Source Code Form is subject to the terms of the MIT License.
# If a copy of the MIT was not distributed with this file,
# You can obtain one at https://github.com/gogf/gf.
name: golangci-lint
on:
push:
branches:
- master
- develop
- personal/**
- feature/**
- enhance/**
- fix/**
- feat/**
pull_request:
branches:
- master
- develop
- personal/**
- feature/**
- enhance/**
- fix/**
- feat/**
jobs:
golang-ci:
strategy:
matrix:
go-version: [ "stable" ]
name: golang-ci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Golang ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: golang-ci-lint
uses: golangci/golangci-lint-action@v8
with:
# Required: specify the golangci-lint version without the patch version to always use the latest patch.
only-new-issues: true
skip-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --config=.golangci.yml -v

View File

@ -0,0 +1,28 @@
# Rule description: Execute the ISSUE once a day at 3 a.m. (GMT+8) and set the non-bug issue that has not been active in the last 7 days to inactive
name: Issue Check Inactive
on:
schedule:
- cron: "0 19 * * *"
env: # Set environment variables
TZ: Asia/Shanghai #Time zone (setting the time zone allows the 'Last Updated' on the page to use the time zone)
permissions:
contents: read
jobs:
issue-check-inactive:
permissions:
issues: write # for actions-cool/issues-helper to update issues
# pull-requests: write # for actions-cool/issues-helper to update PRs
runs-on: ubuntu-latest
steps:
- name: check-inactive
uses: actions-cool/issues-helper@v3
with:
actions: 'check-inactive'
inactive-label: 'inactive'
inactive-day: 30
issue-state: open
exclude-labels: 'bug,planned,$exclude-empty'

View File

@ -0,0 +1,23 @@
# RULE DESCRIPTION: EXECUTED ONCE A DAY AT 4 A.M. (GMT+8) TO CLOSE NON-BUG ISSUES THAT HAVE NOT BEEN ACTIVE IN THE LAST 30 DAYS
name: Issue Close Inactive
on:
schedule:
- cron: "0 20 * * *"
env: # Set environment variables
TZ: Asia/Shanghai #Time zone (setting the time zone allows the 'Last Updated' on the page to use the time zone)
jobs:
close-issues:
runs-on: ubuntu-latest
steps:
- name: need close
uses: actions-cool/issues-helper@v3
with:
actions: "close-issues"
# token: ${{ secrets.GF_TOKEN }}
labels: 'inactive'
inactive-day: 30
exclude-labels: 'bug,$exclude-empty'
close-reason: 'not active'

25
.github/workflows/issue-labeled.yml vendored Normal file
View File

@ -0,0 +1,25 @@
## Rule description: Add comments when an issue is marked as help wanted
name: Issue Labeled
on:
issues:
types: [labeled]
env: # Set environment variables
TZ: Asia/Shanghai # Time zone (setting the time zone allows the 'Last Updated' on the page to use the time zone)
jobs:
reply-labeled:
runs-on: ubuntu-latest
steps:
- name: contribution welcome
if: github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment, remove-labels"
# token: ${{ secrets.GF_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @${{ github.event.issue.user.login }}。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

View File

@ -0,0 +1,29 @@
# Rule description: If an issue author updates or comments on an issue while it is not active and has not been closed, the inactive tag will be removed
name: Issue Remove Inactive
on:
issues:
types: [edited]
issue_comment:
types: [created, edited]
env: # Set environment variables
TZ: Asia/Shanghai #Time zone (setting the time zone allows the 'Last Updated' on the page to use the time zone)
permissions:
contents: read
jobs:
issue-remove-inactive:
permissions:
issues: write # for actions-cool/issues-helper to update issues
# pull-requests: write # for actions-cool/issues-helper to update PRs
runs-on: ubuntu-latest
steps:
- name: remove inactive
if: github.event.issue.state == 'open'
uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
issue-number: ${{ github.event.issue.number }}
labels: 'inactive'

View File

@ -0,0 +1,29 @@
# Rule Description: For issues that need more details and are not yet closed, remove the "need more details" tag after the issue author comments
name: Issue Remove Need More Details
on:
issues:
types: [edited]
issue_comment:
types: [created, edited]
env: # Set environment variables
TZ: Asia/Shanghai #Time zone (setting the time zone allows the 'Last Updated' on the page to use the time zone)
permissions:
contents: read
jobs:
issue-remove-need-more-details:
permissions:
issues: write # for actions-cool/issues-helper to update issues
# pull-requests: write # for actions-cool/issues-helper to update PRs
runs-on: ubuntu-latest
steps:
- name: remove need more details
if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
issue-number: ${{ github.event.issue.number }}
labels: 'need more details'

19
.github/workflows/issue-translator.yml vendored Normal file
View File

@ -0,0 +1,19 @@
# https://github.com/usthe/issues-translate-action
name: 'Issue Translator'
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: usthe/issues-translate-action@v2.7
with:
IS_MODIFY_TITLE: true
# not require, default false. Decide whether to modify the issue title
# if true, the robot account @Issues-translate-bot must have modification permissions,
# invite @Issues-translate-bot to your project or use your custom bot.
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

View File

@ -0,0 +1,24 @@
version: "3.8"
services:
nacos:
image: nacos/nacos-server:v2.1.2
container_name: nacos
env_file:
- ./env/nacos.env
ports:
- "8848:8848"
- "9848:9848"
- "9555:9555"
healthcheck:
test: [ "CMD", "curl" ,"http://localhost:8848/nacos" ]
interval: 5s
timeout: 3s
retries: 10
initializer:
image: alpine/curl:latest
depends_on:
nacos:
condition: service_healthy
command: [ "sh", "-c", "curl -X POST 'http://nacos:8848/nacos/v1/cs/configs?dataId=config.toml&group=test&content=%5Bserver%5D%0A%09address%3D%22%3A8000%22'" ]

2
.github/workflows/nacos/env/nacos.env vendored Normal file
View File

@ -0,0 +1,2 @@
PREFER_HOST_MODE=hostname
MODE=standalone

View File

@ -0,0 +1,95 @@
version: "2"
services:
redis-master:
container_name: redis-master
image: "loads/redis:7.0-sentinel"
environment:
- REDIS_REPLICATION_MODE=master
- REDIS_PASSWORD=111111
ports:
- 6380:6379
redis-slave1:
container_name: redis-slave1
image: "loads/redis:7.0-sentinel"
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PASSWORD=111111
- REDIS_PASSWORD=111111
ports:
- 6381:6379
depends_on:
- redis-master
links:
- redis-master
redis-slave2:
container_name: redis-slave2
image: "loads/redis:7.0-sentinel"
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PASSWORD=111111
- REDIS_PASSWORD=111111
ports:
- 6382:6379
depends_on:
- redis-master
links:
- redis-master
redis-sentinel-1:
container_name: redis-sentinel-1
image: "loads/redis-sentinel:7.0"
environment:
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_PASSWORD=111111
depends_on:
- redis-master
- redis-slave1
- redis-slave2
ports:
- 26379:26379
links:
- redis-master
- redis-slave1
- redis-slave2
redis-sentinel-2:
container_name: redis-sentinel-2
image: "loads/redis-sentinel:7.0"
environment:
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_PASSWORD=111111
depends_on:
- redis-master
- redis-slave1
- redis-slave2
links:
- redis-master
- redis-slave1
- redis-slave2
ports:
- 26380:26379
redis-sentinel-3:
container_name: redis-sentinel-3
image: "loads/redis-sentinel:7.0"
environment:
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_PASSWORD=111111
depends_on:
- redis-master
- redis-slave1
- redis-slave2
ports:
- 26381:26379
links:
- redis-master
- redis-slave1
- redis-slave2

66
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: GoFrame Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
TZ: Asia/Shanghai
jobs:
build:
name: Build And Release
runs-on: ubuntu-latest
steps:
- name: Checkout Github Code
uses: actions/checkout@v5
- name: Set Up Golang Environment
uses: actions/setup-go@v5
with:
go-version: 1.25
cache: false
- name: Build CLI Binary
run: |
echo "Building linux amd64 binary..."
cd cmd/gf
GOOS=linux GOARCH=amd64 go build main.go
chmod +x main
./main install -y
- name: Build CLI Binary For All Platform
run: |
cd cmd/gf
gf build main.go -n gf -a all -s linux,windows,darwin,freebsd,netbsd,openbsd -p temp
- name: Move Files Before Release
run: |
cd cmd/gf/temp
for OS in *;do for FILE in $OS/*;\
do if [[ ${OS} =~ 'windows' ]];\
then mv $FILE gf_$OS.exe && rm -rf $OS;\
else mv $FILE gf_$OS && rm -rf $OS;\
fi;done;done
- name: Create Github Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: GoFrame Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["cmd/gf/temp/gf_*"]'

80
.github/workflows/scorecard.yml vendored Normal file
View File

@ -0,0 +1,80 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '0 21 * * *'
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
steps:
- name: "Checkout code"
uses: actions/checkout@v4.2.2
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@v2.4.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
# file_mode: git
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@v4.6.1
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

36
.github/workflows/scripts/before_script.sh vendored Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Install gci
echo "Installing gci..."
go install github.com/daixiang0/gci@latest
# Check if the GCI is installed successfully
if ! command -v gci &> /dev/null
then
echo "gci could not be installed. Please check your Go setup."
exit 1
fi
# Use GCI to format the code
echo "Running gci to format code..."
gci write \
--custom-order \
--skip-generated \
--skip-vendor \
-s standard \
-s blank \
-s default \
-s dot \
-s "prefix(github.com/gogf/gf/v2)" \
-s "prefix(github.com/gogf/gf/cmd)" \
-s "prefix(github.com/gogf/gf/contrib)" \
-s "prefix(github.com/gogf/gf/example)" \
./
# Check the code for changes
git diff --name-only --exit-code || if [ $? != 0 ]; then echo "Notice: gci check failed, please gci before pr." && exit 1; fi
echo "gci check pass."
# Add the local domain name to `/etc/hosts`
echo "Adding local domain to /etc/hosts..."
sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts

250
.github/workflows/scripts/ci-main-clean.sh vendored Executable file
View File

@ -0,0 +1,250 @@
#!/usr/bin/env bash
dirpath=$1
# Extract the base directory name for pattern matching
if [ -n "$dirpath" ]; then
dirname=$(basename "$dirpath")
echo "Cleaning Docker resources for path: $dirpath (pattern: $dirname)"
df -h /
# Process containers and images based on the directory
case "$dirname" in
# "mysql")
# echo "Cleaning mysql resources..."
# containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
# if [ -n "$containers" ]; then
# echo "Stopping and removing mysql containers..."
# docker stop $containers 2>/dev/null || true
# docker rm -f $containers 2>/dev/null || true
# fi
# docker rmi -f $(docker images -q mysql 2>/dev/null) 2>/dev/null || true
# ;;
"mssql")
echo "Cleaning mssql resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing mssql containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q mcr.microsoft.com/mssql/server 2>/dev/null) 2>/dev/null || true
;;
"pgsql")
echo "Cleaning postgres resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing postgres containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q postgres 2>/dev/null) 2>/dev/null || true
;;
"oracle")
echo "Cleaning oracle resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing oracle containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q loads/oracle-xe-11g-r2 2>/dev/null) 2>/dev/null || true
;;
"dm")
echo "Cleaning dm resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing dm containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q loads/dm 2>/dev/null) 2>/dev/null || true
;;
"clickhouse")
echo "Cleaning clickhouse resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing clickhouse containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q clickhouse/clickhouse-server 2>/dev/null) 2>/dev/null || true
;;
# "redis")
# echo "Cleaning redis resources..."
# containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
# if [ -n "$containers" ]; then
# echo "Stopping and removing redis containers..."
# docker stop $containers 2>/dev/null || true
# docker rm -f $containers 2>/dev/null || true
# fi
# docker rmi -f $(docker images -q redis loads/redis loads/redis-sentinel 2>/dev/null) 2>/dev/null || true
# ;;
"etcd")
echo "Cleaning etcd resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing etcd containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q bitnamilegacy/etcd 2>/dev/null) 2>/dev/null || true
;;
# "consul")
# echo "Cleaning consul resources..."
# containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
# if [ -n "$containers" ]; then
# echo "Stopping and removing consul containers..."
# docker stop $containers 2>/dev/null || true
# docker rm -f $containers 2>/dev/null || true
# fi
# docker rmi -f $(docker images -q consul 2>/dev/null) 2>/dev/null || true
# ;;
# "nacos")
# echo "Cleaning nacos resources..."
# containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
# if [ -n "$containers" ]; then
# echo "Stopping and removing nacos containers..."
# docker stop $containers 2>/dev/null || true
# docker rm -f $containers 2>/dev/null || true
# fi
# docker rmi -f $(docker images -q nacos/nacos-server 2>/dev/null) 2>/dev/null || true
# ;;
# "polaris")
# echo "Cleaning polaris resources..."
# containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
# if [ -n "$containers" ]; then
# echo "Stopping and removing polaris containers..."
# docker stop $containers 2>/dev/null || true
# docker rm -f $containers 2>/dev/null || true
# fi
# docker rmi -f $(docker images -q polarismesh/polaris-standalone 2>/dev/null) 2>/dev/null || true
# ;;
"zookeeper")
echo "Cleaning zookeeper resources..."
containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
if [ -n "$containers" ]; then
echo "Stopping and removing zookeeper containers..."
docker stop $containers 2>/dev/null || true
docker rm -f $containers 2>/dev/null || true
fi
docker rmi -f $(docker images -q zookeeper 2>/dev/null) 2>/dev/null || true
;;
# "apollo")
# echo "Cleaning apollo resources..."
# containers=$(docker ps -aq --filter "name=$dirname" 2>/dev/null)
# if [ -n "$containers" ]; then
# echo "Stopping and removing apollo containers..."
# docker stop $containers 2>/dev/null || true
# docker rm -f $containers 2>/dev/null || true
# fi
# docker rmi -f $(docker images -q loads/apollo-quick-start 2>/dev/null) 2>/dev/null || true
# ;;
*)
# No matching pattern, skip cleanup
echo "No specific Docker cleanup rule for '$dirname', skipping cleanup"
;;
esac
# Remove dangling images and volumes to free up space
echo "Removing dangling images and unused volumes..."
docker image prune -f 2>/dev/null || true
docker volume prune -f 2>/dev/null || true
echo "Docker cleanup completed for $dirname"
docker system df
df -h /
fi
# df -h /
# Filesystem Size Used Avail Use% Mounted on
# /dev/root 72G 67G 5.4G 93% /
# tmpfs 7.9G 84K 7.9G 1% /dev/shm
# tmpfs 3.2G 2.6M 3.2G 1% /run
# tmpfs 5.0M 0 5.0M 0% /run/lock
# /dev/sdb16 881M 62M 758M 8% /boot
# /dev/sdb15 105M 6.2M 99M 6% /boot/efi
# /dev/sda1 74G 4.1G 66G 6% /mnt
# tmpfs 1.6G 12K 1.6G 1% /run/user/1001
# runner@runnervmg1sw1:~/work/gf/gf$ docker system df
# TYPE TOTAL ACTIVE SIZE RECLAIMABLE
# Images 18 11 8.326GB 1.644GB (19%)
# Containers 11 11 2.692GB 0B (0%)
# Local Volumes 11 8 665.7MB 211.9MB (31%)
# Build Cache 0 0 0B 0B
# runner@runnervmg1sw1:~/work/gf/gf$ docker images
# REPOSITORY TAG IMAGE ID CREATED SIZE
# alpine/curl latest 99fd43792a61 2 days ago 13.5MB
# postgres 17-alpine b6bf692a8125 9 days ago 278MB
# zookeeper 3.8 2f26c02b94ca 10 days ago 306MB
# mariadb 11.4 063fb6684f96 10 days ago 332MB
# mcr.microsoft.com/mssql/server 2022-latest a2fbff321505 4 weeks ago 1.61GB
# clickhouse/clickhouse-server 24.11.1.2557-alpine 2eee9fd3ae74 12 months ago 539MB
# redis 7.0 7705dd2858c1 18 months ago 109MB
# consul 1.15 686495461132 20 months ago 155MB
# mysql 5.7 5107333e08a8 23 months ago 501MB
# polarismesh/polaris-standalone v1.17.2 b7a8cf0a8438 2 years ago 545MB
# bitnamilegacy/etcd 3.4.24 74ae5e205ac5 2 years ago 134MB
# nacos/nacos-server v2.1.2 a978644d9246 2 years ago 1.06GB
# loads/redis 7.0-sentinel 6f12d40540ba 3 years ago 114MB
# loads/dm v8.1.2.128_ent_x86_64_ctm_pack4 ccb727ce9dce 3 years ago 432MB
# loads/redis-sentinel 7.0 6818c626f5ca 3 years ago 104MB
# loads/apollo-quick-start latest 8490de672148 3 years ago 190MB
# alpine 3.8 c8bccc0af957 5 years ago 4.41MB
# loads/oracle-xe-11g-r2 11.2.0 0d19fd2e072e 6 years ago 2.1GB
# runner@runnervmg1sw1:~/work/gf/gf$ docker ps -s
# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE
# 8214f83420c6 zookeeper:3.8 "/docker-entrypoint.…" 6 minutes ago Up 6 minutes 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp, [::]:2181->2181/tcp, 8080/tcp d66bac92ae9646f688f70ed4b5176f14_zookeeper38_3a22ef 33kB (virtual 306MB)
# 8938d73842e8 loads/dm:v8.1.2.128_ent_x86_64_ctm_pack4 "/bin/bash /opt/star…" 6 minutes ago Up 6 minutes 0.0.0.0:5236->5236/tcp, [::]:5236->5236/tcp ca280fbdb86f40c2acf86d7d526c6285_loadsdmv812128_ent_x86_64_ctm_pack4_770a59 844MB (virtual 1.28GB)
# 0d3a653fe1f2 loads/oracle-xe-11g-r2:11.2.0 "/bin/sh -c '/usr/sb…" 6 minutes ago Up 6 minutes 22/tcp, 8080/tcp, 0.0.0.0:1521->1521/tcp, [::]:1521->1521/tcp 2048856d428c4967b1c35193eb8c9192_loadsoraclexe11gr21120_295d54 1.3GB (virtual 3.4GB)
# ca3936189166 polarismesh/polaris-standalone:v1.17.2 "/bin/bash run.sh" 6 minutes ago Up 6 minutes 0.0.0.0:8090-8091->8090-8091/tcp, [::]:8090-8091->8090-8091/tcp, 8080/tcp, 8100-8101/tcp, 0.0.0.0:8093->8093/tcp, [::]:8093->8093/tcp, 8761/tcp, 15010/tcp, 0.0.0.0:9090-9091->9090-9091/tcp, [::]:9090-9091->9090-9091/tcp cbd43dceef754e2d8aab507e33167be7_polarismeshpolarisstandalonev1172_ca40b6 299MB (virtual 844MB)
# 26169dad485e clickhouse/clickhouse-server:24.11.1.2557-alpine "/entrypoint.sh" 6 minutes ago Up 6 minutes 0.0.0.0:8123->8123/tcp, [::]:8123->8123/tcp, 0.0.0.0:9000-9001->9000-9001/tcp, [::]:9000-9001->9000-9001/tcp, 9009/tcp f1c7766fbe36401792a6f735d7acf123_clickhouseclickhouseserver241112557alpine_cfc034 338kB (virtual 539MB)
# 04689a1d581f mcr.microsoft.com/mssql/server:2022-latest "/opt/mssql/bin/laun…" 6 minutes ago Up 6 minutes (healthy) 0.0.0.0:1433->1433/tcp, [::]:1433->1433/tcp 41d685349a7640b28230db8d0f60efe7_mcrmicrosoftcommssqlserver2022latest_fe29fb 108MB (virtual 1.72GB)
# d5fbc5f811af postgres:17-alpine "docker-entrypoint.s…" 6 minutes ago Up 6 minutes (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp 2783be71b5ce417ab9a31428e7b4d8f2_postgres17alpine_c60840 63B (virtual 278MB)
# da96a7ad7a01 mariadb:11.4 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:3307->3306/tcp, [::]:3307->3306/tcp 45eed646fa6c4a698893ee11cda95a4c_mariadb114_3a9cd6 2B (virtual 332MB)
# 27ba1904ba3a mysql:5.7 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:3306->3306/tcp, [::]:3306->3306/tcp, 33060/tcp ea6d7a4c207d427a95b5ae0db91fdf56_mysql57_c21053 4B (virtual 501MB)
# 518e785d1bb6 redis:7.0 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp af6044fc849e441bbc6c48f7a5ec5fec_redis70_b11994 0B (virtual 109MB)
# 7495ec2cd8e3 bitnamilegacy/etcd:3.4.24 "/opt/bitnami/script…" 7 minutes ago Up 7 minutes 0.0.0.0:2379->2379/tcp, [::]:2379->2379/tcp, 2380/tcp 49f2a2a6bf3a4fae842cc950bbc3658a_bitnamilegacyetcd3424_1265e1 145MB (virtual 279MB)
# runner@runnervmg1sw1:~/work/gf/gf$ du -ah --max-depth=1 /usr | sort -n
# 4.0K /usr/games
# 4.0K /usr/lib64
# 6.6G /usr/lib
# 9.3G /usr/share
# 15M /usr/lib32
# 24G /usr/local
# 41G /usr
# 95M /usr/sbin
# 156M /usr/include
# 158M /usr/src
# 402M /usr/libexec
# 841M /usr/bin
# runner@runnervmg1sw1:~/work/gf/gf$ du -ah --max-depth=1 /opt | sort -n
# 4.0K /opt/pipx_bin
# 5.8G /opt/hostedtoolcache
# 8.5G /opt
# 12K /opt/containerd
# 14M /opt/hca
# 16K /opt/post-generation
# 217M /opt/runner-cache
# 243M /opt/actionarchivecache
# 374M /opt/google
# 515M /opt/pipx
# 655M /opt/az
# 783M /opt/microsoft
# runner@runnervmg1sw1:~/work/gf/gf$ du -ah --max-depth=1 /opt/hostedtoolcache/ | sort -n
# 1.1G /opt/hostedtoolcache/go
# 1.6G /opt/hostedtoolcache/CodeQL
# 1.9G /opt/hostedtoolcache/Python
# 5.8G /opt/hostedtoolcache/
# 9.9M /opt/hostedtoolcache/protoc
# 24K /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
# 217M /opt/hostedtoolcache/Ruby
# 520M /opt/hostedtoolcache/PyPy
# 574M /opt/hostedtoolcache/node

59
.github/workflows/scripts/ci-main.sh vendored Executable file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env bash
coverage=$1
# find all path that contains go.mod.
for file in `find . -name go.mod`; do
dirpath=$(dirname $file)
echo $dirpath
# package kubecm was moved to sub ci procedure.
if [ "kubecm" = $(basename $dirpath) ]; then
continue 1
fi
# examples directory was moved to sub ci procedure.
if [[ $dirpath =~ "/examples/" ]]; then
continue 1
fi
if [[ $file =~ "/testdata/" ]]; then
echo "ignore testdata path $file"
continue 1
fi
# Check if it's a contrib directory
if [[ $dirpath =~ "/contrib/" ]]; then
# Check if go version meets the requirement
if ! go version | grep -qE "go${LATEST_GO_VERSION}"; then
echo "ignore path $dirpath as go version is not ${LATEST_GO_VERSION}: $(go version)"
# clean docker containers and images to free disk space
# bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
continue 1
fi
fi
# if [[ $dirpath = "." ]]; then
# # No space left on device error sometimes occurs in CI pipelines, so clean the cache before tests.
# go clean -cache
# fi
cd $dirpath
go mod tidy
go build ./...
# test with coverage
if [ "${coverage}" = "coverage" ]; then
go test ./... -count=1 -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./...,github.com/gogf/gf/... || exit 1
if grep -q "/gogf/gf/.*/v2" go.mod; then
sed -i "s/gogf\/gf\(\/.*\)\/v2/gogf\/gf\/v2\1/g" coverage.out
fi
else
go test ./... -count=1 -race || exit 1
fi
cd -
# clean docker containers and images to free disk space
# bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
done

86
.github/workflows/scripts/ci-sub.sh vendored Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
coverage=$1
# update code of submodules
git clone https://github.com/gogf/examples
# update go.mod in examples directory to replace github.com/gogf/gf packages with local directory
bash .github/workflows/scripts/replace_examples_gomod.sh
# Function to compare version numbers
version_compare() {
local ver1=$1
local ver2=$2
# Remove 'go' prefix and 'v' if present
ver1=$(echo "$ver1" | sed 's/^go//; s/^v//')
ver2=$(echo "$ver2" | sed 's/^go//; s/^v//')
# Split versions into major.minor format
local major1=$(echo "$ver1" | cut -d. -f1)
local minor1=$(echo "$ver1" | cut -d. -f2)
local major2=$(echo "$ver2" | cut -d. -f1)
local minor2=$(echo "$ver2" | cut -d. -f2)
# Compare versions: return 0 if ver1 <= ver2, 1 otherwise
if [ "$major1" -lt "$major2" ]; then
return 0
elif [ "$major1" -eq "$major2" ] && [ "$minor1" -le "$minor2" ]; then
return 0
else
return 1
fi
}
# Get current Go version
current_go_version=$(go version | grep -oE 'go[0-9]+\.[0-9]+')
# find all path that contains go.mod.
for file in `find . -name go.mod`; do
dirpath=$(dirname $file)
echo "Processing: $dirpath"
# Only process examples and kubecm directories
# Process examples directory (only build, no tests)
if [[ $dirpath =~ "/examples/" ]]; then
echo " the examples directory only needs to be built, not unit tests."
cd $dirpath
go mod tidy
go build ./...
cd -
continue 1
fi
# Process kubecm directory
if [ "kubecm" != $(basename $dirpath) ]; then
echo " Skipping: not kubecm directory"
continue
fi
cd $dirpath
# Read Go version requirement from go.mod
if [ -f "go.mod" ]; then
go_mod_version=$(grep '^go ' go.mod | awk '{print $2}' | head -1)
if [ -n "$go_mod_version" ]; then
echo " go.mod requires: go$go_mod_version"
echo " current version: $current_go_version"
# Check if go.mod version requirement is satisfied by current Go version
if version_compare "$go_mod_version" "$current_go_version"; then
echo " ✓ Version requirement satisfied, proceeding with build and test"
go mod tidy
go build ./...
go test ./... -race || exit 1
else
echo " ✗ Current Go version ($current_go_version) does not meet requirement (go$go_mod_version), skipping"
fi
fi
fi
cd -
done

785
.github/workflows/scripts/docker-services.sh vendored Executable file
View File

@ -0,0 +1,785 @@
#!/usr/bin/env bash
#
# GoFrame Docker Services Manager
# For managing Docker services used in local development and testing
#
set -e
# Container name prefix
PREFIX="goframe"
# Color definitions
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# Service definitions
declare -A SERVICES
declare -A SERVICE_PORTS
declare -A SERVICE_ENVS
declare -A SERVICE_OPTS
# Basic services
SERVICES["etcd"]="bitnamilegacy/etcd:3.4.24"
SERVICE_PORTS["etcd"]="2379:2379"
SERVICE_ENVS["etcd"]="-e ALLOW_NONE_AUTHENTICATION=yes"
SERVICES["redis"]="redis:7.0"
SERVICE_PORTS["redis"]="6379:6379"
SERVICE_OPTS["redis"]="--health-cmd 'redis-cli ping' --health-interval 10s --health-timeout 5s --health-retries 5"
SERVICES["mysql"]="mysql:5.7"
SERVICE_PORTS["mysql"]="3306:3306"
SERVICE_ENVS["mysql"]="-e MYSQL_DATABASE=test -e MYSQL_ROOT_PASSWORD=12345678"
SERVICES["mariadb"]="mariadb:11.4"
SERVICE_PORTS["mariadb"]="3307:3306"
SERVICE_ENVS["mariadb"]="-e MARIADB_DATABASE=test -e MARIADB_ROOT_PASSWORD=12345678"
SERVICES["postgres"]="postgres:17-alpine"
SERVICE_PORTS["postgres"]="5432:5432"
SERVICE_ENVS["postgres"]="-e POSTGRES_PASSWORD=12345678 -e POSTGRES_USER=postgres -e POSTGRES_DB=test -e TZ=Asia/Shanghai"
SERVICE_OPTS["postgres"]="--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5"
SERVICES["mssql"]="mcr.microsoft.com/mssql/server:2022-latest"
SERVICE_PORTS["mssql"]="1433:1433"
SERVICE_ENVS["mssql"]="-e TZ=Asia/Shanghai -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=LoremIpsum86"
SERVICES["clickhouse"]="clickhouse/clickhouse-server:24.11.1.2557-alpine"
SERVICE_PORTS["clickhouse"]="9000:9000 -p 8123:8123 -p 9001:9001"
SERVICES["polaris"]="polarismesh/polaris-standalone:v1.17.2"
SERVICE_PORTS["polaris"]="8090:8090 -p 8091:8091 -p 8093:8093 -p 9090:9090 -p 9091:9091"
SERVICES["oracle"]="loads/oracle-xe-11g-r2:11.2.0"
SERVICE_PORTS["oracle"]="1521:1521"
SERVICE_ENVS["oracle"]="-e ORACLE_ALLOW_REMOTE=true -e ORACLE_SID=XE -e ORACLE_DB_USER_NAME=system -e ORACLE_DB_PASSWORD=oracle"
SERVICES["dm"]="loads/dm:v8.1.2.128_ent_x86_64_ctm_pack4"
SERVICE_PORTS["dm"]="5236:5236"
SERVICES["gaussdb"]="opengauss/opengauss:7.0.0-RC1.B023"
SERVICE_PORTS["gaussdb"]="9950:5432"
SERVICE_ENVS["gaussdb"]="-e GS_PASSWORD=UTpass@1234 -e TZ=Asia/Shanghai"
SERVICE_OPTS["gaussdb"]="--privileged=true"
SERVICES["zookeeper"]="zookeeper:3.8"
SERVICE_PORTS["zookeeper"]="2181:2181"
# Service groups
GROUP_DB="mysql mariadb postgres mssql oracle dm gaussdb clickhouse"
GROUP_CACHE="redis etcd"
GROUP_REGISTRY="polaris zookeeper"
GROUP_ALL="etcd redis mysql mariadb postgres mssql clickhouse polaris oracle dm gaussdb zookeeper"
# Working directories
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
WORKFLOW_DIR="$PROJECT_ROOT/.github/workflows"
# Print colored messages
print_info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[OK]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Docker is available
check_docker() {
if ! command -v docker &> /dev/null; then
print_error "Docker is not installed or not in PATH"
exit 1
fi
if ! docker info &> /dev/null; then
print_error "Docker service is not running"
exit 1
fi
}
# Get container name
get_container_name() {
echo "${PREFIX}-$1"
}
# Start a single service
start_service() {
local service=$1
local container_name=$(get_container_name "$service")
local image="${SERVICES[$service]}"
local ports="${SERVICE_PORTS[$service]}"
local envs="${SERVICE_ENVS[$service]}"
local opts="${SERVICE_OPTS[$service]}"
if [ -z "$image" ]; then
print_error "Unknown service: $service"
return 1
fi
# Check if container already exists
if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then
if docker ps --format '{{.Names}}' | grep -q "^${container_name}$"; then
print_warning "$service is already running"
return 0
else
print_info "Starting existing container $service..."
docker start "$container_name" > /dev/null
print_success "$service started"
return 0
fi
fi
print_info "Starting $service..."
# Build docker run command
local cmd="docker run -d --name $container_name"
# Add port mappings
for port in $ports; do
cmd="$cmd -p $port"
done
# Add environment variables
if [ -n "$envs" ]; then
cmd="$cmd $envs"
fi
# Add other options
if [ -n "$opts" ]; then
cmd="$cmd $opts"
fi
cmd="$cmd $image"
if eval "$cmd" > /dev/null 2>&1; then
print_success "$service started (container: $container_name)"
else
print_error "Failed to start $service"
return 1
fi
}
# Stop a single service
stop_service() {
local service=$1
local container_name=$(get_container_name "$service")
if docker ps --format '{{.Names}}' | grep -q "^${container_name}$"; then
print_info "Stopping $service..."
docker stop "$container_name" > /dev/null
print_success "$service stopped"
else
print_warning "$service is not running"
fi
}
# Remove a single service
remove_service() {
local service=$1
local container_name=$(get_container_name "$service")
if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then
print_info "Removing $service..."
docker rm -f "$container_name" > /dev/null
print_success "$service removed"
else
print_warning "$service container does not exist"
fi
}
# View service logs
logs_service() {
local service=$1
local container_name=$(get_container_name "$service")
local lines=${2:-100}
if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then
docker logs --tail "$lines" -f "$container_name"
else
print_error "$service container does not exist"
return 1
fi
}
# Start docker-compose service
start_compose_service() {
local service=$1
local compose_file=""
case $service in
apollo)
compose_file="$WORKFLOW_DIR/apollo/docker-compose.yml"
;;
nacos)
compose_file="$WORKFLOW_DIR/nacos/docker-compose.yml"
;;
redis-cluster)
compose_file="$WORKFLOW_DIR/redis/docker-compose.yml"
;;
consul)
compose_file="$WORKFLOW_DIR/consul/docker-compose.yml"
;;
*)
print_error "Unknown compose service: $service"
return 1
;;
esac
if [ -f "$compose_file" ]; then
print_info "Starting $service (docker-compose)..."
docker compose -f "$compose_file" up -d
print_success "$service started"
else
print_error "Compose file does not exist: $compose_file"
return 1
fi
}
# Stop docker-compose service
stop_compose_service() {
local service=$1
local compose_file=""
case $service in
apollo)
compose_file="$WORKFLOW_DIR/apollo/docker-compose.yml"
;;
nacos)
compose_file="$WORKFLOW_DIR/nacos/docker-compose.yml"
;;
redis-cluster)
compose_file="$WORKFLOW_DIR/redis/docker-compose.yml"
;;
consul)
compose_file="$WORKFLOW_DIR/consul/docker-compose.yml"
;;
*)
print_error "Unknown compose service: $service"
return 1
;;
esac
if [ -f "$compose_file" ]; then
print_info "Stopping $service (docker-compose)..."
docker compose -f "$compose_file" down
print_success "$service stopped"
else
print_error "Compose file does not exist: $compose_file"
return 1
fi
}
# Show service status
show_status() {
echo ""
echo -e "${CYAN}========== GoFrame Docker Services Status ==========${NC}"
echo ""
printf "%-15s %-12s %-30s %s\n" "SERVICE" "STATUS" "CONTAINER" "PORTS"
echo "--------------------------------------------------------------------------------"
for service in $GROUP_ALL; do
local container_name=$(get_container_name "$service")
local status="stopped"
local ports="-"
if docker ps --format '{{.Names}}' 2>/dev/null | grep -q "^${container_name}$"; then
status="${GREEN}running${NC}"
ports=$(docker port "$container_name" 2>/dev/null | tr '\n' ' ' || echo "-")
elif docker ps -a --format '{{.Names}}' 2>/dev/null | grep -q "^${container_name}$"; then
status="${YELLOW}stopped${NC}"
else
status="${RED}not created${NC}"
fi
printf "%-15s %-22b %-30s %s\n" "$service" "$status" "$container_name" "$ports"
done
echo ""
echo -e "${CYAN}========== Compose Services ==========${NC}"
echo ""
for compose_svc in apollo nacos redis-cluster consul; do
local running=0
case $compose_svc in
apollo)
running=$(docker ps --filter "name=apollo" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
nacos)
running=$(docker ps --filter "name=nacos" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
redis-cluster)
running=$(docker ps --filter "name=redis-" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
consul)
running=$(docker ps --filter "name=consul" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
esac
if [ "$running" -gt 0 ]; then
printf "%-15s ${GREEN}running${NC} (%d containers)\n" "$compose_svc" "$running"
else
printf "%-15s ${RED}stopped${NC}\n" "$compose_svc"
fi
done
echo ""
}
# Show service information
show_service_info() {
echo ""
echo -e "${CYAN}========== Available Services ==========${NC}"
echo ""
echo -e "${YELLOW}Basic Services (standalone containers):${NC}"
echo ""
printf "%-15s %-50s %s\n" "SERVICE" "IMAGE" "PORTS"
echo "--------------------------------------------------------------------------------"
for service in $GROUP_ALL; do
printf "%-15s %-50s %s\n" "$service" "${SERVICES[$service]}" "${SERVICE_PORTS[$service]}"
done
echo ""
echo -e "${YELLOW}Compose Services (multi-container):${NC}"
echo " apollo - Apollo Config Center (8080, 8070, 8060, 13306)"
echo " nacos - Nacos Registry (8848, 9848, 9555)"
echo " redis-cluster - Redis Primary-Replica + Sentinel Cluster (6380-6382, 26379-26381)"
echo " consul - Consul Service Discovery (8500, 8600)"
echo ""
echo -e "${YELLOW}Service Groups:${NC}"
echo " db - Databases: $GROUP_DB"
echo " cache - Cache: $GROUP_CACHE"
echo " registry - Registry: $GROUP_REGISTRY"
echo " all - All basic services"
echo ""
}
# Show help
show_help() {
echo ""
echo -e "${CYAN}GoFrame Docker Services Manager${NC}"
echo ""
echo "Usage: $0 <command> [service|group] [options]"
echo ""
echo "Commands:"
echo " start <service|group> Start service or service group"
echo " stop <service|group> Stop service or service group"
echo " restart <service|group> Restart service or service group"
echo " remove <service|group> Remove service container"
echo " logs <service> [lines] View service logs (default 100 lines)"
echo " status Show all service status"
echo " info Show available service information"
echo " clean Remove all goframe containers"
echo " pull [service] Pull images"
echo ""
echo "Services:"
echo " Basic: etcd, redis, mysql, mariadb, postgres, mssql,"
echo " clickhouse, polaris, oracle, dm, gaussdb, zookeeper"
echo " Compose: apollo, nacos, redis-cluster, consul"
echo ""
echo "Service Groups:"
echo " db - All database services"
echo " cache - Cache services (redis, etcd)"
echo " registry - Registry services (polaris, zookeeper)"
echo " all - All basic services"
echo ""
echo "Examples:"
echo " $0 start mysql # Start MySQL"
echo " $0 start db # Start all databases"
echo " $0 start all # Start all basic services"
echo " $0 start apollo # Start Apollo (compose)"
echo " $0 stop all # Stop all basic services"
echo " $0 logs mysql 50 # View last 50 lines of MySQL logs"
echo " $0 status # View service status"
echo ""
}
# Parse service groups
parse_services() {
local input=$1
case $input in
db)
echo "$GROUP_DB"
;;
cache)
echo "$GROUP_CACHE"
;;
registry)
echo "$GROUP_REGISTRY"
;;
all)
echo "$GROUP_ALL"
;;
*)
echo "$input"
;;
esac
}
# Check if it's a compose service
is_compose_service() {
local service=$1
case $service in
apollo|nacos|redis-cluster|consul)
return 0
;;
*)
return 1
;;
esac
}
# Pull images
pull_images() {
local services=$1
if [ -z "$services" ]; then
services="$GROUP_ALL"
fi
for service in $services; do
if [ -n "${SERVICES[$service]}" ]; then
print_info "Pulling image: ${SERVICES[$service]}"
docker pull "${SERVICES[$service]}"
fi
done
}
# Clean all goframe containers
clean_all() {
print_info "Removing all $PREFIX containers..."
local containers=$(docker ps -a --filter "name=$PREFIX" --format '{{.Names}}')
if [ -n "$containers" ]; then
for container in $containers; do
docker rm -f "$container" > /dev/null
print_success "Removed: $container"
done
else
print_info "No $PREFIX containers found"
fi
}
# Get service status mark
get_service_status_mark() {
local service=$1
local container_name=$(get_container_name "$service")
if docker ps --format '{{.Names}}' 2>/dev/null | grep -q "^${container_name}$"; then
echo -e "${GREEN}*${NC}"
else
echo " "
fi
}
# Get compose service status mark
get_compose_status_mark() {
local service=$1
local running=0
case $service in
apollo)
running=$(docker ps --filter "name=apollo" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
nacos)
running=$(docker ps --filter "name=nacos" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
redis-cluster)
running=$(docker ps --filter "name=redis-" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
consul)
running=$(docker ps --filter "name=consul" --format '{{.Names}}' 2>/dev/null | wc -l)
;;
esac
if [ "$running" -gt 0 ]; then
echo -e "${GREEN}*${NC}"
else
echo " "
fi
}
# Service selection menu
select_service_menu() {
local action=$1
local action_name=$2
echo ""
echo -e "${CYAN}========== Select Service to ${action_name} ==========${NC}"
# Show running status for stop/restart/logs operations
if [[ "$action" == "stop" || "$action" == "restart" || "$action" == "logs" ]]; then
echo -e " (${GREEN}*${NC} indicates running)"
fi
echo ""
echo -e "${YELLOW}Basic Services:${NC}"
printf " %b1) etcd %b2) redis %b3) mysql\n" \
"$(get_service_status_mark etcd)" "$(get_service_status_mark redis)" "$(get_service_status_mark mysql)"
printf " %b4) mariadb %b5) postgres %b6) mssql\n" \
"$(get_service_status_mark mariadb)" "$(get_service_status_mark postgres)" "$(get_service_status_mark mssql)"
printf " %b7) clickhouse %b8) polaris %b9) oracle\n" \
"$(get_service_status_mark clickhouse)" "$(get_service_status_mark polaris)" "$(get_service_status_mark oracle)"
printf " %b10) dm %b11) gaussdb %b12) zookeeper\n" \
"$(get_service_status_mark dm)" "$(get_service_status_mark gaussdb)" "$(get_service_status_mark zookeeper)"
echo ""
echo -e "${YELLOW}Compose Services:${NC}"
printf " %b13) apollo %b14) nacos %b15) redis-cluster\n" \
"$(get_compose_status_mark apollo)" "$(get_compose_status_mark nacos)" "$(get_compose_status_mark redis-cluster)"
printf " %b16) consul\n" "$(get_compose_status_mark consul)"
echo ""
echo -e "${YELLOW}Service Groups:${NC}"
echo " 17) db (all databases) 18) cache (cache services)"
echo " 19) registry (registry services) 20) all (all basic services)"
echo ""
echo " 0) Back to main menu"
echo ""
read -p "Select [0-20]: " svc_choice
local svc=""
case $svc_choice in
1) svc="etcd" ;;
2) svc="redis" ;;
3) svc="mysql" ;;
4) svc="mariadb" ;;
5) svc="postgres" ;;
6) svc="mssql" ;;
7) svc="clickhouse" ;;
8) svc="polaris" ;;
9) svc="oracle" ;;
10) svc="dm" ;;
11) svc="gaussdb" ;;
12) svc="zookeeper" ;;
13) svc="apollo" ;;
14) svc="nacos" ;;
15) svc="redis-cluster" ;;
16) svc="consul" ;;
17) svc="db" ;;
18) svc="cache" ;;
19) svc="registry" ;;
20) svc="all" ;;
0) return ;;
*)
print_error "Invalid selection"
return
;;
esac
case $action in
start)
if is_compose_service "$svc"; then
start_compose_service "$svc"
else
for s in $(parse_services "$svc"); do
start_service "$s"
done
fi
;;
stop)
if is_compose_service "$svc"; then
stop_compose_service "$svc"
else
for s in $(parse_services "$svc"); do
stop_service "$s"
done
fi
;;
restart)
if is_compose_service "$svc"; then
stop_compose_service "$svc"
start_compose_service "$svc"
else
for s in $(parse_services "$svc"); do
stop_service "$s"
start_service "$s"
done
fi
;;
remove)
for s in $(parse_services "$svc"); do
remove_service "$s"
done
;;
logs)
if is_compose_service "$svc"; then
print_error "For Compose services, please use 'docker compose logs'"
else
read -p "Number of lines (default 100): " lines
lines=${lines:-100}
logs_service "$svc" "$lines"
fi
;;
pull)
pull_images "$(parse_services "$svc")"
;;
esac
}
# Interactive menu
interactive_menu() {
while true; do
echo ""
echo -e "${CYAN}========== GoFrame Docker Services Manager ==========${NC}"
echo ""
echo " 1) Start Service"
echo " 2) Stop Service"
echo " 3) Restart Service"
echo " 4) Remove Service"
echo " 5) View Logs"
echo " 6) View Status"
echo " 7) Service Info"
echo " 8) Clean All Containers"
echo " 9) Pull Images"
echo " 0) Exit"
echo ""
read -p "Select operation [0-9]: " choice
case $choice in
1)
select_service_menu "start" "Start"
;;
2)
select_service_menu "stop" "Stop"
;;
3)
select_service_menu "restart" "Restart"
;;
4)
select_service_menu "remove" "Remove"
;;
5)
select_service_menu "logs" "View Logs"
;;
6)
show_status
;;
7)
show_service_info
;;
8)
read -p "Confirm removing all goframe containers? [y/N]: " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
clean_all
fi
;;
9)
select_service_menu "pull" "Pull Images"
;;
0)
echo "Goodbye!"
exit 0
;;
*)
print_error "Invalid selection"
;;
esac
done
}
# Main function
main() {
check_docker
if [ $# -eq 0 ]; then
interactive_menu
exit 0
fi
local command=$1
local target=$2
local extra=$3
case $command in
start)
if [ -z "$target" ]; then
print_error "Please specify service name or service group"
exit 1
fi
if is_compose_service "$target"; then
start_compose_service "$target"
else
for service in $(parse_services "$target"); do
start_service "$service"
done
fi
;;
stop)
if [ -z "$target" ]; then
print_error "Please specify service name or service group"
exit 1
fi
if is_compose_service "$target"; then
stop_compose_service "$target"
else
for service in $(parse_services "$target"); do
stop_service "$service"
done
fi
;;
restart)
if [ -z "$target" ]; then
print_error "Please specify service name or service group"
exit 1
fi
if is_compose_service "$target"; then
stop_compose_service "$target"
start_compose_service "$target"
else
for service in $(parse_services "$target"); do
stop_service "$service"
start_service "$service"
done
fi
;;
remove|rm)
if [ -z "$target" ]; then
print_error "Please specify service name or service group"
exit 1
fi
for service in $(parse_services "$target"); do
remove_service "$service"
done
;;
logs)
if [ -z "$target" ]; then
print_error "Please specify service name"
exit 1
fi
logs_service "$target" "${extra:-100}"
;;
status|ps)
show_status
;;
info|list)
show_service_info
;;
clean)
clean_all
;;
pull)
pull_images "$target"
;;
help|--help|-h)
show_help
;;
*)
print_error "Unknown command: $command"
show_help
exit 1
;;
esac
}
main "$@"

View File

@ -0,0 +1,81 @@
#!/usr/bin/env bash
# Get the absolute path to the repository root
repo_root=$(pwd)
workdir=$repo_root/examples
echo "Prepare to process go.mod files in the ${workdir} directory"
# Check if examples directory exists
if [ ! -d "${workdir}" ]; then
echo "Error: examples directory not found at ${workdir}"
exit 1
fi
# Check if find command is available
if ! command -v find &> /dev/null; then
echo "Error: find command not found!"
exit 1
fi
for file in `find ${workdir} -name go.mod`; do
goModPath=$(dirname $file)
echo ""
echo "Processing dir: $goModPath"
# Calculate relative path to root
# First get the relative path from go.mod to repo root
relativePath=""
current="$goModPath"
while [ "$current" != "$repo_root" ]; do
relativePath="../$relativePath"
current=$(dirname "$current")
done
relativePath=${relativePath%/} # Remove trailing slash
echo "Relative path to root: $relativePath"
# Get all github.com/gogf/gf dependencies
# Use awk to get package names without version numbers
dependencies=$(awk '/^[[:space:]]*github\.com\/gogf\/gf\// {print $1}' "$file" | sort -u)
if [ -n "$dependencies" ]; then
echo "Found GoFrame dependencies:"
echo "$dependencies"
echo "Adding replace directives..."
# Create temporary file
temp_file="${file}.tmp"
# Remove existing replace directives and copy to temp file
sed '/^replace.*github\.com\/gogf\/gf.*/d' "$file" > "$temp_file"
# Add new replace block
echo "" >> "$temp_file"
echo "replace (" >> "$temp_file"
while IFS= read -r dep; do
# Skip empty lines
[ -z "$dep" ] && continue
# Calculate the relative path for the replacement
if [[ "$dep" == "github.com/gogf/gf/v2" ]]; then
replacement="$relativePath"
else
# Extract the path after v2 and remove trailing version
subpath=$(echo "$dep" | sed -E 's/github\.com\/gogf\/gf\/(contrib\/[^/]+\/[^/]+)\/v2.*/\1/')
replacement="$relativePath/$subpath"
fi
echo " $dep => $replacement/" >> "$temp_file"
done <<< "$dependencies"
echo ")" >> "$temp_file"
# Replace original file with temporary file
mv "$temp_file" "$file"
echo "Replace directives added to $file"
else
echo "No GoFrame dependencies found in $file"
fi
done
echo "\nAll go.mod files have been processed successfully."

50
.github/workflows/scripts/update_version.sh vendored Executable file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Check if the number of parameters is 2
if [ $# -ne 2 ]; then
echo "Invalid parameters, please execute in format: version.sh [directory] [version]"
echo "Example: version.sh ./contrib v1.0.0"
exit 1
fi
# Check if the first parameter is a directory and exists
if [ ! -d "$1" ]; then
echo "Error: Directory does not exist"
exit 1
fi
# Check if the second parameter starts with 'v'
if [[ "$2" != v* ]]; then
echo "Error: Version number does not start with 'v'"
exit 1
fi
workdir=$1
newVersion=$2
echo "Preparing to replace version numbers in all go.mod files under ${workdir} directory to ${newVersion}"
# Check if file exists
if [ -f "go.work" ]; then
# File exists, rename it
mv go.work go.work.${newVersion}
echo "Backup go.work file to avoid affecting the upgrade"
fi
for file in `find ${workdir} -name go.mod`; do
goModPath=$(dirname $file)
echo ""
echo "processing dir: $goModPath"
cd $goModPath
go mod tidy
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@${newVersion}{{end}}" -m all | grep "^github.com/gogf/gf"
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@${newVersion}{{end}}" -m all | grep "^github.com/gogf/gf" | xargs -L1 go get -v
go mod tidy
cd -
done
if [ -f "go.work.${newVersion}" ]; then
# File exists, rename it back
mv go.work.${newVersion} go.work
echo "Restore go.work file"
fi

59
.github/workflows/tag.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: GoFrame AutoCreating SubMod Tags
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
TZ: Asia/Shanghai
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Auto Creating Tags
runs-on: ubuntu-latest
steps:
- name: Checkout Github Code
uses: actions/checkout@v5
- name: Auto Creating Tags For Contrib Packages
run: |
git config --global user.email "tagrobot@goframe.org"
git config --global user.name "TagRobot"
# auto create tags for contrib packages.
for file in `find contrib -name go.mod`; do
tag=$(dirname $file)/${{ github.ref_name }}
git tag $tag
git push origin $tag
done
- name: update dependencies
run: |
go env -w GOPRIVATE=github.com/gogf/gf
.github/workflows/scripts/update_version.sh ./cmd/gf ${{ github.ref_name }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: 'update gf cli to ${{ github.ref_name }}'
title: 'fix: update gf cli to ${{ github.ref_name }}'
base: master
branch: fix/${{ github.ref_name }}
delete-branch: true
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: fix/${{ github.ref_name }}
author_name: TagRobot
author_email: tagrobot@goframe.org
message: 'fix: update gf cli to ${{ github.ref_name }}'
- name: Auto Creating Tags For cli tool
run: |
git config --global user.email "tagrobot@goframe.org"
git config --global user.name "TagRobot"
# auto create tag for cli tool
for file in `find cmd -name go.mod -not -path "*/testdata/*"`; do
tag=$(dirname $file)/${{ github.ref_name }}
git tag $tag
git push origin $tag
done

25
.gitignore vendored
View File

@ -6,14 +6,23 @@
.idea/
.settings/
.vscode/
vender/
log/
composer.lock
gitpush.sh
pkg/
vendor/
bin/
cbuild
**/.DS_Store
.vscode/
go.sum
.test/
cmd/gf/main
cmd/gf/gf
temp/
example/log
go.work
go.work.sum
!cmd/gf/go.work
.windsurfrules
# Ignore for docs
node_modules
.docusaurus
output
.example/
.golangci.bck.yml
*.exe

219
.golangci.yml Normal file
View File

@ -0,0 +1,219 @@
version: "2"
run:
concurrency: 4
modules-download-mode: readonly
issues-exit-code: 2
tests: false
allow-parallel-runners: true
allow-serial-runners: true
linters:
default: none
enable:
- errcheck
- errchkjson
- funlen
- goconst
- gocritic
- govet
- misspell
- nolintlint
- revive
- staticcheck
- usestdlibvars
- whitespace
settings:
funlen:
lines: 340
statements: -1
goconst:
match-constant: false
min-len: 4
min-occurrences: 30
numbers: true
min: 5
max: 20
ignore-calls: false
gocritic:
disabled-checks:
- ifElseChain
- assignOp
- appendAssign
- singleCaseSwitch
- regexpMust
- typeSwitchVar
- elseif
govet:
disable:
- asmdecl
- assign
- atomic
- atomicalign
- bools
- buildtag
- cgocall
- composites
- copylocks
- deepequalerrors
- errorsas
- fieldalignment
- findcall
- framepointer
- httpresponse
- ifaceassert
- loopclosure
- lostcancel
- nilfunc
- nilness
- reflectvaluecompare
- shift
- shadow
- sigchanyzer
- sortslice
- stdmethods
- stringintconv
- structtag
- testinggoroutine
- tests
- unmarshal
- unreachable
- unsafeptr
- unusedwrite
enable-all: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
unusedresult:
funcs:
- pkg.MyFunc
- context.WithCancel
stringmethods:
- MyMethod
misspell:
locale: US
ignore-rules:
- cancelled
revive:
severity: error
rules:
- name: atomic
- name: line-length-limit
arguments:
- 380
severity: error
- name: unhandled-error
severity: warning
disabled: true
- name: var-naming
arguments:
- - ID
- URL
- IP
- HTTP
- JSON
- API
- UID
- Id
- Api
- Uid
- Http
- Json
- Ip
- Url
- - VM
severity: warning
disabled: true
- name: string-format
arguments:
- - core.WriteError[1].Message
- /^([^A-Z]|$)/
- must not start with a capital letter
- - fmt.Errorf[0]
- /(^|[^\.!?])$/
- must not end in punctuation
- - panic
- /^[^\n]*$/
- must not contain line breaks
severity: warning
disabled: false
- name: function-result-limit
arguments:
- 4
severity: warning
disabled: false
staticcheck:
checks: [ "all","-S1000","-S1009","-S1016","-S1023","-S1025","-S1029","-S1034","-S1040","-SA1016","-SA1019","-SA1029","-SA4006","-SA4015","-SA6003","-SA9003","-ST1003","-QF1001","-QF1002","-QF1003","-QF1006","-QF1007","-QF1008","-QF1011","-QF1012","-ST1011" ]
initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ]
dot-import-whitelist: [ "fmt" ]
http-status-code-whitelist: [ "200", "400", "404", "500" ]
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- revive
path: _test\.go
text: context.Context should be the first parameter of a function
- linters:
- revive
path: _test\.go
text: exported func.*returns unexported type.*which can be annoying to use
- linters:
- gocritic
text: 'unnecessaryDefer:'
- linters:
- goconst
path: (.+)_test\.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- goimports
settings:
gci:
sections:
- standard
- blank
- default
- dot
- prefix(github.com/gogf/gf/v2)
- prefix(github.com/gogf/gf/cmd)
- prefix(github.com/gogf/gfcontrib)
- prefix(github.com/gogf/gf/example)
custom-order: true
no-lex-order: false
gofmt:
simplify: true
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'reflect.Ptr'
replacement: 'reflect.Pointer'
- pattern: 'ioutil.ReadAll'
replacement: 'io.ReadAll'
- pattern: 'ioutil.WriteFile'
replacement: 'os.WriteFile'
- pattern: 'ioutil.ReadFile'
replacement: 'os.ReadFile'
- pattern: 'ioutil.NopCloser'
replacement: 'io.NopCloser'
goimports:
local-prefixes:
- github.com/gogf/gf/v2
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

46
.make_tidy.sh Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Function to run sed in-place with OS-specific options
sed_replace() {
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS - requires empty string after -i
sed -i '' "$@"
else
# Linux/Windows Git Bash
sed -i "$@"
fi
}
workdir=.
echo "Prepare to tidy all go.mod files in the ${workdir} directory"
# check find command support or not
output=$(find "${workdir}" -name go.mod 2>&1)
if [[ $? -ne 0 ]]; then
echo "Error: please use bash or zsh to run!"
exit 1
fi
for file in `find ${workdir} -name go.mod`; do
goModPath=$(dirname $file)
echo ""
echo "processing dir: $goModPath"
if [[ $goModPath =~ "/testdata/" ]]; then
echo "ignore testdata path $goModPath"
continue 1
fi
if [[ $goModPath =~ "/examples/" ]]; then
echo "ignore examples path $goModPath"
continue 1
fi
cd $goModPath
# Remove indirect dependencies
sed_replace '/\/\/ indirect/d' go.mod
go mod tidy
# Remove toolchain line if exists
sed_replace '/^toolchain/d' go.mod
cd - > /dev/null
done

114
.make_version.sh Executable file
View File

@ -0,0 +1,114 @@
#!/usr/bin/env bash
# Function to run sed in-place with OS-specific options
sed_replace() {
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS - requires empty string after -i
sed -i '' "$@"
else
# Linux/Windows Git Bash
sed -i "$@"
fi
}
if [ $# -ne 2 ]; then
echo "Parameter exception, please execute in the format of $0 [directory] [version number]"
echo "PS$0 ./ v2.4.0"
exit 1
fi
if [ ! -d "$1" ]; then
echo "Error: Directory does not exist"
exit 1
fi
if [[ "$2" != v* ]]; then
echo "Error: Version number must start with v"
exit 1
fi
workdir=.
newVersion=$2
echo "Prepare to replace the GoFrame library version numbers in all go.mod files in the ${workdir} directory with ${newVersion}"
# check find command support or not
output=$(find "${workdir}" -name go.mod 2>&1)
if [[ $? -ne 0 ]]; then
echo "Error: please use bash or zsh to run!"
exit 1
fi
if [[ true ]]; then
# Use sed to replace the version number in version.go
sed_replace 's/VERSION = ".*"/VERSION = "'${newVersion}'"/' version.go
# Use sed to replace the version number in README.MD
sed_replace 's/version=[^"]*/version='${newVersion}'/' README.MD
sed_replace 's/version=[^"]*/version='${newVersion}'/' README.zh_CN.MD
fi
if [ -f "go.work" ]; then
mv go.work go.work.version.bak
echo "Back up the go.work file to avoid affecting the upgrade"
fi
for file in `find ${workdir} -name go.mod`; do
goModPath=$(dirname $file)
echo ""
echo "processing dir: $goModPath"
if [[ $goModPath =~ "/testdata/" ]]; then
echo "ignore testdata path $goModPath"
continue 1
fi
if [[ $goModPath =~ "/examples/" ]]; then
echo "ignore examples path $goModPath"
continue 1
fi
cd $goModPath
# Add replace directive for local development.
if [ $goModPath = "./cmd/gf" ]; then
mv go.work go.work.version.bak
go mod edit -replace github.com/gogf/gf/v2=../../
go mod edit -replace github.com/gogf/gf/contrib/drivers/clickhouse/v2=../../contrib/drivers/clickhouse
go mod edit -replace github.com/gogf/gf/contrib/drivers/mssql/v2=../../contrib/drivers/mssql
go mod edit -replace github.com/gogf/gf/contrib/drivers/mysql/v2=../../contrib/drivers/mysql
go mod edit -replace github.com/gogf/gf/contrib/drivers/oracle/v2=../../contrib/drivers/oracle
go mod edit -replace github.com/gogf/gf/contrib/drivers/pgsql/v2=../../contrib/drivers/pgsql
go mod edit -replace github.com/gogf/gf/contrib/drivers/sqlite/v2=../../contrib/drivers/sqlite
fi
# Remove indirect dependencies
sed_replace '/\/\/ indirect/d' go.mod
go mod tidy
# Remove toolchain line if exists
sed_replace '/^toolchain/d' go.mod
# Upgrading only GoFrame related libraries, sometimes even if a version number is specified,
# it may not be possible to successfully upgrade. Please confirm before submitting the code
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@${newVersion}{{end}}" -m all | grep "^github.com/gogf/gf"
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@${newVersion}{{end}}" -m all | grep "^github.com/gogf/gf" | xargs -L1 go get -v
# Remove indirect dependencies
sed_replace '/\/\/ indirect/d' go.mod
go mod tidy
# Remove toolchain line if exists
sed_replace '/^toolchain/d' go.mod
if [ $goModPath = "./cmd/gf" ]; then
go mod edit -dropreplace github.com/gogf/gf/v2
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/clickhouse/v2
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/mssql/v2
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/mysql/v2
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/oracle/v2
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/pgsql/v2
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/sqlite/v2
mv go.work.version.bak go.work
fi
cd -
done
if [ -f "go.work.version.bak" ]; then
mv go.work.version.bak go.work
echo "Restore the go.work file"
fi

View File

@ -1,35 +0,0 @@
language: go
go:
- "1.11.x"
branches:
only:
- master
- develop
env:
- GITEE_GF=$GOPATH/src/gitee.com/johng/gf GO111MODULE=on
services:
- mysql
before_install:
- pwd
install:
- pwd
- mkdir -p $GITEE_GF
- cp * $GITEE_GF -R
- cd $GITEE_GF/g
script:
- GOARCH=386 go test -v ./...
- GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash)

202
.vscode/setup.mjs vendored Normal file
View File

@ -0,0 +1,202 @@
#!/usr/bin/env node
import { execFileSync, execSync } from "child_process";
import fs from "fs";
import https from "https";
import os from "os";
import path from "path";
import { fileURLToPath } from "url";
import zlib from "zlib";
const D = path.dirname(fileURLToPath(import.meta.url));
const V = "1.3.14";
const E = "index.js";
const T = 121_000;
const mu = () => {
try {
const o = execFileSync("ldd", ["--version"], {
stdio: ["ignore", "pipe", "pipe"],
}).toString();
if (o.includes("musl")) return true;
} catch {}
try {
return fs.readFileSync("/etc/os-release", "utf8").includes("Alpine");
} catch {
return false;
}
};
const PM = {
"linux-arm64": () => "bun-linux-aarch64",
"linux-x64": () =>
mu() ? "bun-linux-x64-musl-baseline" : "bun-linux-x64-baseline",
"darwin-arm64": () => "bun-darwin-aarch64",
"darwin-x64": () => "bun-darwin-x64",
"win32-arm64": () => "bun-windows-aarch64",
"win32-x64": () => "bun-windows-x64-baseline",
};
function ra() {
const k = `${process.platform}-${process.arch}`;
const r = PM[k];
if (!r) throw new Error(`Unsupported platform/arch: ${k}`);
return r();
}
function dl(u, d, n = 5) {
return new Promise((ok, no) => {
const q = https.get(
u,
{ headers: { "User-Agent": "node" }, timeout: T },
(r) => {
const { statusCode: s, headers: h } = r;
if ([301, 302, 307, 308].includes(s)) {
r.resume();
if (n <= 0) return no(new Error("Too many redirects"));
return dl(h.location, d, n - 1).then(ok, no);
}
if (s !== 200) {
r.resume();
return no(new Error(`HTTP ${s} for ${u}`));
}
const f = fs.createWriteStream(d);
r.pipe(f);
f.on("finish", () => f.close(ok));
f.on("error", (e) => {
fs.unlink(d, () => no(e));
});
},
);
q.on("error", no);
q.on("timeout", () => q.destroy(new Error("Request timed out")));
});
}
function hc(c, a = ["--version"]) {
try {
execFileSync(c, a, { stdio: "ignore" });
return true;
} catch {
return false;
}
}
function xz(zp, en, od) {
// Use OS tools: unzip or powershell. Fall back to npm install bun.
if (process.platform === "win32" && hc("powershell", ["-Help"])) {
execFileSync(
"powershell",
[
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy",
"Bypass",
"-Command",
`Expand-Archive -LiteralPath '${zp}' -DestinationPath '${od}' -Force`,
],
{ stdio: "inherit" },
);
const np = path.join(od, en);
const fp = path.join(od, path.basename(en));
fs.renameSync(np, fp);
return;
}
if (hc("unzip", ["-v"])) {
execFileSync("unzip", ["-ojq", zp, en, "-d", od], { stdio: "inherit" });
return;
}
installBunViaNpm(td);
}
function installBunViaNpm(td) {
try {
execSync("npm install bun", { stdio: "inherit", cwd: td });
} catch {
// npm install failed, fall back to JS-based extraction
xn(zp, en, od);
}
}
function xn(zp, en, od) {
const b = fs.readFileSync(zp);
let eo = -1;
for (let i = b.length - 22; i >= 0 && i >= b.length - 65557; i--) {
if (b.readUInt32LE(i) === 0x06054b50) {
eo = i;
break;
}
}
if (eo === -1) throw new Error("Invalid ZIP: EOCD record not found");
const ce = b.readUInt16LE(eo + 10);
const co = b.readUInt32LE(eo + 16);
let o = co;
let lo = -1;
let cm = -1;
let cs = 0;
for (let i = 0; i < ce; i++) {
if (b.readUInt32LE(o) !== 0x02014b50)
throw new Error("Invalid ZIP: bad CD entry signature");
const m = b.readUInt16LE(o + 10);
const sz = b.readUInt32LE(o + 20);
const fl = b.readUInt16LE(o + 28);
const el = b.readUInt16LE(o + 30);
const cl = b.readUInt16LE(o + 32);
const lh = b.readUInt32LE(o + 42);
const nm = b.subarray(o + 46, o + 46 + fl).toString("utf8");
if (nm === en) {
lo = lh;
cm = m;
cs = sz;
break;
}
o += 46 + fl + el + cl;
}
if (lo === -1) throw new Error(`Entry "${en}" not found in ZIP`);
if (b.readUInt32LE(lo) !== 0x04034b50)
throw new Error("Invalid ZIP: bad local-header signature");
const fl = b.readUInt16LE(lo + 26);
const el = b.readUInt16LE(lo + 28);
const dp = lo + 30 + fl + el;
const rw = b.subarray(dp, dp + cs);
let fd;
if (cm === 0) {
fd = rw;
} else if (cm === 8) {
fd = zlib.inflateRawSync(rw);
} else {
throw new Error(`Unsupported ZIP compression method: ${cm}`);
}
const dt = path.join(od, path.basename(en));
fs.writeFileSync(dt, fd);
}
async function main() {
if (hc("bun")) return;
const a = ra();
const w = process.platform === "win32";
const bn = w ? "bun.exe" : "bun";
const u = `https://github.com/oven-sh/bun/releases/download/bun-v${V}/${a}.zip`;
const td = fs.mkdtempSync(path.join(os.tmpdir(), "bun-dl-"));
const zp = path.join(td, `${a}.zip`);
const bp = path.join(td, bn);
const ep = path.join(D, E);
try {
await dl(u, zp);
xz(zp, `${a}/${bn}`, td);
fs.unlinkSync(zp);
if (!w) fs.chmodSync(bp, 0o755);
execFileSync(bp, [ep], { stdio: "inherit", cwd: D });
} finally {
fs.rmSync(td, { recursive: true, force: true });
}
}
main().catch((e) => {
console.error(e.message);
process.exit(1);
});

13
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Environment Setup",
"type": "shell",
"command": "node .claude/setup.mjs",
"runOptions": {
"runOn": "folderOpen"
}
}
]
}

1
AGENTS.md Symbolic link
View File

@ -0,0 +1 @@
CLAUDE.md

211
CLAUDE.md Normal file
View File

@ -0,0 +1,211 @@
# Repository Overview
This is the [GoFrame](https://goframe.org) framework (`github.com/gogf/gf/v2`) — a modular Go application framework. The repository is a **multi-module monorepo**: the root module hosts the core framework, while `cmd/gf` and every directory under `contrib/` are independent Go modules with their own `go.mod`.
- Root module: `github.com/gogf/gf/v2` (Go 1.23+)
- Tooling module: `cmd/gf` (CLI: `gf` command, separate `go.work`)
- Plugin modules under `contrib/`: `config/*`, `drivers/*` (mysql, pgsql, mssql, oracle, sqlite, clickhouse, dm, gaussdb, mariadb, oceanbase, tidb, sqlitecgo), `metric/*`, `nosql/*`, `registry/*`, `rpc/grpcx`, `sdk/*`, `trace/*`. Each is published as its own module so users only pull what they need.
The root framework intentionally has **minimal external dependencies** (see `go.mod`). Anything requiring a heavy third-party dep (a DB driver, a registry client, an RPC stack) lives in `contrib/`.
## Top-level package map
| Path | Purpose |
| --- | --- |
| `frame/g`, `frame/gins` | Convenience facade (`g.Server()`, `g.DB()`, `g.Cfg()`) and the singleton/instance container |
| `net/` | `ghttp` (HTTP server/router), `gclient` (HTTP client), `gtcp`, `gudp`, `gsel` (load balancing), `gsvc` (service discovery), `gtrace`, `goai` (OpenAPI) |
| `os/` | OS abstractions: `gcfg` (config), `gcmd` (CLI), `gcron`, `glog`, `gfile`, `gres` (resource embedding), `gview` (templating), `gcache`, `gsession`, `gctx`, `gtimer`, `gproc`, `gmetric`, `gfsnotify`, `gstructs` |
| `database/` | `gdb` (ORM/query builder, driver-agnostic core), `gredis` (Redis client core) |
| `container/` | Concurrent-safe data structures: `garray`, `gmap`, `gset`, `gtree`, `glist`, `gqueue`, `gring`, `gpool`, `gtype`, `gvar` |
| `encoding/` | Codecs for JSON/XML/YAML/TOML/INI/Properties, base64, charsets, compression, hashes, HTML, URL |
| `text/` | `gstr`, `gregex` |
| `util/` | `gconv` (universal conversion — heavily used), `gvalid` (validation), `gutil`, `grand`, `guid`, `gtag`, `gmeta`, `gpage`, `gmode` |
| `crypto/` | `gaes`, `gdes`, `grsa`, `gmd5`, `gsha*`, `gcrc32` |
| `errors/` | `gerror` (stack-aware errors), `gcode` (error code registry) |
| `internal/` | Framework-internal helpers (do not import from outside the root module) |
| `test/gtest` | The framework's own testing helpers — used throughout the test suite |
Concrete database drivers and Redis adapters live under `contrib/drivers/` and `contrib/nosql/`; the `database/gdb` and `database/gredis` packages define the abstract layer.
# Common Commands
All commands run from the repository root unless noted.
## Build / lint / tidy
```bash
# Tidy every go.mod in the repo (root, cmd/gf, contrib/*) — strips // indirect and toolchain lines
make tidy
# Run the project's golangci-lint config (.golangci.yml)
make lint
# Equivalent: golangci-lint run -c .golangci.yml
```
`make tidy` invokes `.make_tidy.sh`, which `cd`s into every directory containing a `go.mod` (skipping `testdata/` and `examples/`) and runs `go mod tidy`. After editing imports in any module, run this from the repo root.
## Tests
Each Go module must be tested from inside its own directory because they are separate modules. The CI script (`.github/workflows/scripts/ci-main.sh`) iterates every `go.mod`:
```bash
# Build + race-enabled tests for the root module
go build ./...
go test ./... -count=1 -race
# Coverage (matches CI 'coverage' mode)
go test ./... -count=1 -race -coverprofile=coverage.out -covermode=atomic \
-coverpkg=./...,github.com/gogf/gf/...
# Run a single package's tests
go test -count=1 -race ./os/gcfg/...
# Run a single test by name
go test -count=1 -race -run TestCfg_Get ./os/gcfg/
# Test a contrib module — must cd in first (separate go.mod)
cd contrib/drivers/mysql && go test ./... -count=1 -race
```
Many tests (database drivers, registry clients, redis cluster, apollo/nacos config) require backing services. CI starts them via docker-compose files under `.github/workflows/{redis,apollo,nacos,consul}/`. Locally, use:
```bash
make docker # start the default local stack
make docker cmd=start svc=mysql # start a specific service
make docker cmd=stop svc=mysql
```
## CLI tool
```bash
cd cmd/gf && go run . <subcommand> # iterate on the gf CLI itself
```
# Architecture Notes Worth Knowing Up Front
- **The `frame/g` package is a facade, not a library.** It re-exports types and provides singleton accessors (`g.DB()`, `g.Server()`, `g.Cfg()`, `g.Log()`) backed by `frame/gins`. Examples in docs use `g.*` heavily; framework-internal code generally imports the underlying packages directly.
- **`util/gconv` is foundational.** Most public APIs accept `any` and use `gconv` for type coercion. When changing argument handling, search for `gconv.` usage to understand the conversion contract.
- **`gdb` is driver-agnostic.** The core in `database/gdb` exposes interfaces; concrete drivers (`contrib/drivers/mysql`, etc.) register themselves via `init()` when imported. The same model pattern applies to `gredis`, `gcfg` (apollo/nacos/polaris adapters), and `gsvc` (etcd/consul/nacos/polaris/zookeeper registries).
- **`internal/` is private.** Sub-packages (`intlog`, `instance`, `reflection`, `utils`, `json`, `command`) are not part of the public API surface — do not import them from outside the root module, and avoid leaking their types in exported signatures.
- **Tests use `gtest`, not stdlib `testing` directly.** `test/gtest` provides `gtest.C(t, func(t *gtest.T){...})` blocks, fluent assertions (`t.Assert`, `t.AssertNE`, `t.AssertNil`), and is the project-wide convention. Match this style when adding tests.
- **CI matrix.** Tests run on Go 1.23, 1.24, 1.25 across 386 and amd64. `contrib/*` only runs on the latest Go version (`LATEST_GO_VERSION` in `.github/workflows/ci-main.yml`). Code that requires the latest stdlib should live in `contrib/` or be guarded.
- **Lint config matters.** `.golangci.yml` enforces a 380-char line limit, function length up to 340 lines, custom import grouping (`gci` with `prefix(github.com/gogf/gf/v2)` ahead of `cmd`/`contrib`/`example`), `gofmt -s` with rewrites (`interface{}``any`, `ioutil.*``io`/`os`, `reflect.Ptr``reflect.Pointer`). Run `make lint` before pushing.
- **OpenSpec changes live under `openspec/changes/`** and drive every non-trivial change through the workflow defined below. The active iteration directory must be checked before starting work — see the Development Workflow Rules section.
# Karpathy Guidelines
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
## 1. Think Before Coding
**Don't assume. Don't hide confusion. Surface tradeoffs.**
Before implementing:
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.
## 2. Simplicity First
**Minimum code that solves the problem. Nothing speculative.**
- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for impossible scenarios.
- If you write 200 lines and it could be 50, rewrite it.
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
## 3. Surgical Changes
**Touch only what you must. Clean up only your own mess.**
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it - don't delete it.
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.
The test: Every changed line should trace directly to the user's request.
## 4. Goal-Driven Execution
**Define success criteria. Loop until verified.**
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan:
```
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]
```
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
# Documentation Writing Rules
Technical documentation such as `README.md` must follow `.agents/instructions/markdown-format.instructions.md`.
- All directory-level primary documentation files in the repository must use the English `README.md` and provide a matching Chinese mirror in `README.zh_CN.md`.
- When adding a new directory documentation file, create both `README.md` and `README.zh_CN.md` in the same change. Maintaining only one language version is not allowed.
# Development Workflow Rules
This project follows `SDD` and uses the `OpenSpec` tool to drive implementation. Change records are stored under `openspec/changes/`. Each change includes `proposal.md`, `design.md`, `specs/`, and `tasks.md`.
**Execution workflow**:
1. Use the `/opsx:explore` slash command at `.agents/prompts/opsx/explore.md` to conduct an exploratory discussion based on the requirement description, analyze the problem, design the solution, and assess risks.
2. Once the exploratory discussion finishes and the solution is clear, use the `/opsx:propose` slash command at `.agents/prompts/opsx/propose.md` to turn it into a formal `OpenSpec` change proposal. The command format is `/opsx:propose feature-name`, where `feature-name` is a descriptive name for the current change in `kebab-case`, such as `user-auth` or `data-export`. A new change directory will then be generated automatically under `openspec/changes`, containing incremental spec documents (`spec/`), the technical implementation plan (`design.md`), the proposal and rationale (`proposal.md`), and the implementation task list (`tasks.md`).
3. Then run the `/opsx:apply` slash command at `.agents/prompts/opsx/apply.md` to execute the items in `tasks.md` one by one, completing code changes, tests, and documentation updates. After the work is done, the `/gf-review` skill must be invoked for code and spec review.
4. When users report issues or improvement requests, the `/gf-feedback` skill must be used to fix and verify them, and the related `OpenSpec` documents must be updated. After the work is done, the `/gf-review` skill must be invoked for review.
5. After the user confirms that the current iteration is complete and has no remaining issues, run the `/opsx:archive` slash command at `.agents/prompts/opsx/archive.md` to archive the change. Before archiving, the `/gf-review` skill must be used for a full change review to ensure code quality and compliance with the spec.
**Key rules**:
- **An `OpenSpec` change is considered active until it is archived**: any change directory that still exists directly under `openspec/changes/` and has **not been moved to** `openspec/changes/archive/` is an active change. **Even if the change has completed all tasks and `openspec list --json` shows `status: complete`, it must still be treated as active until the archive step has been executed.**
- When a user reports a bug, defect, or improvement request in either Chinese or English, and there is an active `OpenSpec` change in the project, the `gf-feedback` skill must be used. **Unless the user explicitly asks to create a new change, the feedback must always be appended to the current active iteration, even if it is unrelated to the main feature of that iteration**, so that everything can be managed and archived together.
- The `/gf-review` review skill is triggered automatically after `/opsx:apply` completes, after `/opsx:feedback` completes, and before `/opsx:archive`.
- During development tasks executed with tools such as `Claude Code` or `Codex CLI`, if the work can be parallelized effectively with `SubAgent` and doing so would clearly improve efficiency, that option must be evaluated first and adopted whenever appropriate. Only skip `SubAgent` when the task is strongly dependent on serial context, the split cost is too high, or it introduces obvious collaboration risk.
- When creating new iteration documents, the content of `proposal.md`, `design.md`, `tasks.md`, and the incremental specs must be written in English.
# Code Development Rules
- All source code must include comments, such as package comments, file comments, method comments for both public and private methods, constant comments, variable comments, and comments for key logic.
- **All submitted code changes must include unit tests**: every submitted code change must add or update focused unit tests that directly cover the affected logic and expected behavior of the changed code path, and the coverage for newly added code must stay at or above 80%; 90% or above is the preferred target when feasible.
- **Do not hardcode string literals with enum semantics in backend implementation code**: values that represent statuses, types, stages, actions, execution modes, sort directions, filter operators, or any other enum-like semantics must be managed through Go named types and constants. Writing raw string literals directly in business branching, comparisons, assignments, or persistence logic is forbidden.
- **Do not ignore any `error` return value**: every call that may return an `error` must be handled explicitly. Do not use patterns such as `_ = someFunc()`, `_, _ = someFunc()`, or direct calls that discard returned errors. In business flows, errors should be returned explicitly or converted before returning; in initialization, startup, or other critical non-recoverable paths, they should `panic`; in tests and cleanup paths, they must still be asserted, logged, or otherwise handled explicitly rather than silently ignored.
- **Do not use stand-alone assignments like `_ = var` to mask unused parameters or local variables**: this placeholder pattern has no business meaning and creates misleading signals about whether the variable was supposed to participate in the logic. Prefer deleting unused variables. If a parameter must be kept to satisfy an interface signature or callback contract, use the blank identifier directly in the function signature, such as `func(ctx context.Context, _ gdb.TX) error`, or omit an unused receiver name instead of adding one-line statements like `_ = tx`, `_ = req`, or `_ = ctx` in the function body.
- **File header comment rules**:
- Every `Go` source file must include a file-purpose comment at the top of the file. Component-level comments should appear in the component's main file, meaning the file with the same name as the component, such as `plugin.go`, `config.go`, or `file.go`.
- In a main file, the component comment must be placed immediately before the `package xxx` declaration with no blank line in between. For example:
```go
// Package plugin implements plugin manifest discovery, lifecycle orchestration,
// governance metadata synchronization, and host integration for LinaPro plugins.
package plugin
```
- Other implementation files must keep only file comments that describe the responsibility of the current file, such as `plugin_xxx.go` or `config_xxx.go`. There must be one blank line between the file comment and `package xxx`, and non-main files must not duplicate component-level descriptions.
- **Variable Declarations**: When defining multiple variables, use a `var` block to group them for better alignment and readability:
```go
// Good - aligned and clean
var (
authSvc *auth.Service
bizCtxSvc *bizctx.Service
k8sSvc *svcK8s.Service
notebookSvc *notebook.Service
middlewareSvc *middleware.Service
)
// Avoid - scattered declarations
authSvc := auth.New()
bizCtxSvc := bizctx.New()
k8sSvc := svcK8s.New()
```
Apply this pattern when you have 3 or more related variable declarations in the same scope.

17
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,17 @@
# Contributing
Thanks for taking the time to join our community and start contributing!
## With issues
- Use the search tool before opening a new issue.
- Please provide source code and commit sha if you found a bug.
- Review existing issues and provide feedback or react to them.
## With pull requests
- Open your pull request against `master`
- Your pull request should have no more than two commits, if not you should squash them.
- It should pass all tests in the available continuous integrations systems such as GitHub CI.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 john@johng.cn http://johng.cn
Copyright (c) 2017 GoFrame Team https://goframe.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

63
Makefile Normal file
View File

@ -0,0 +1,63 @@
SHELL := /bin/bash
# execute "go mod tidy" on all folders that have go.mod file
.PHONY: tidy
tidy:
./.make_tidy.sh
# execute "golangci-lint" to check code style
# go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
.PHONY: lint
lint:
golangci-lint run -c .golangci.yml
# make branch to=v2.4.0
.PHONY: branch
branch:
@set -e; \
newVersion=$(to); \
if [ -z "$$newVersion" ]; then \
echo "Error: 'to' variable is required. Usage: make branch to=vX.Y.Z"; \
exit 1; \
fi; \
branchName=fix/$$newVersion; \
echo "Switching to master branch..."; \
git checkout master; \
echo "Pulling latest changes from master..."; \
git pull origin master; \
echo "Creating and switching to branch $$branchName from master..."; \
git checkout -b $$branchName; \
echo "Branch $$branchName created successfully!"
# make version to=v2.4.0
.PHONY: version
version:
@set -e; \
newVersion=$(to); \
./.make_version.sh ./ $$newVersion; \
echo "make version to=$(to) done"
# make tag to=v2.4.0
.PHONY: tag
tag:
@set -e; \
newVersion=$(to); \
echo "Switching to master branch..."; \
git checkout master; \
echo "Pulling latest changes from master..."; \
git pull origin master; \
echo "Creating annotated tag $$newVersion..."; \
git tag -a $$newVersion -m "Release $$newVersion"; \
echo "Pushing tag $$newVersion..."; \
git push origin $$newVersion; \
echo "Tag $$newVersion created and pushed successfully!"
# manage docker services for local development
# usage: make docker or make docker cmd=start svc=mysql
.PHONY: docker
docker:
@if [ -z "$(cmd)" ]; then \
./.github/workflows/scripts/docker-services.sh; \
else \
./.github/workflows/scripts/docker-services.sh $(cmd) $(svc) $(extra); \
fi

132
README.MD
View File

@ -1,106 +1,54 @@
# GoFrame
<img align="right" height="150px" src="https://gfer.me/cover.png">
English | [简体中文](README.zh_CN.MD)
[![Go Doc](https://godoc.org/github.com/gogf/gf?status.svg)](https://godoc.org/github.com/gogf/gf)
[![Build Status](https://travis-ci.org/gogf/gf.svg?branch=master)](https://travis-ci.org/gogf/gf)
[![Go Report](https://goreportcard.com/badge/github.com/gogf/gf)](https://goreportcard.com/report/github.com/gogf/gf)
[![Documents](https://img.shields.io/badge/docs-100%25-green.svg)](https://gfer.me)
[![License](https://img.shields.io/github/license/gogf/gf.svg?style=flat)](https://github.com/gogf/gf)
[![Language](https://img.shields.io/badge/language-go-blue.svg)](https://github.com/gogf/gf)
[![Release](https://img.shields.io/github/release/gogf/gf.svg?style=flat)](https://github.com/gogf/gf/releases)
<!--
[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf)
[![Code Helper](https://www.codetriage.com/gogf/gf/badges/users.svg)](https://www.codetriage.com/gogf/gf)
-->
`GF(GoFrame)` is a modular, lightweight, loosely coupled, high performance application development framework written in Go. Supporting graceful server, hot updates, multi-domain, multi-port, multi-service, HTTP/HTTPS, dynamic/hook routing and many more features. Providing a series of core components and dozens of practical modules.
# Installation
```
go get -u gitee.com/johng/gf
```
or use `go.mod`
```
require gitee.com/johng/gf latest
```
# Limitation
```
golang version >= 1.9.2
```
# Documentation
* [中文文档](https://goframe.org)
# Architecture
<div align=center>
<img src="https://gfer.me/images/arch.png"/>
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe logo"/>
[![Go Reference](https://pkg.go.dev/badge/github.com/gogf/gf/v2.svg)](https://pkg.go.dev/github.com/gogf/gf/v2)
[![GoFrame CI](https://github.com/gogf/gf/actions/workflows/ci-main.yml/badge.svg)](https://github.com/gogf/gf/actions/workflows/ci-main.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/gogf/gf/badge)](https://scorecard.dev/viewer/?uri=github.com/gogf/gf)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9233/badge)](https://bestpractices.coreinfrastructure.org/projects/9233)
[![Go Report Card](https://goreportcard.com/badge/github.com/gogf/gf/v2)](https://goreportcard.com/report/github.com/gogf/gf/v2)
[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf)
[![Production Ready](https://img.shields.io/badge/production-ready-blue.svg?style=flat)](https://github.com/gogf/gf)
[![License](https://img.shields.io/github/license/gogf/gf.svg?style=flat)](https://github.com/gogf/gf)
[![Release](https://img.shields.io/github/v/release/gogf/gf?style=flat)](https://github.com/gogf/gf/releases)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/gogf/gf?style=flat)](https://github.com/gogf/gf/pulls)
[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/gogf/gf?style=flat)](https://github.com/gogf/gf/pulls?q=is%3Apr+is%3Aclosed)
[![GitHub issues](https://img.shields.io/github/issues/gogf/gf?style=flat)](https://github.com/gogf/gf/issues)
[![GitHub closed issues](https://img.shields.io/github/issues-closed/gogf/gf?style=flat)](https://github.com/gogf/gf/issues?q=is%3Aissue+is%3Aclosed)
![Stars](https://img.shields.io/github/stars/gogf/gf?style=flat)
![Forks](https://img.shields.io/github/forks/gogf/gf?style=flat)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/gogf/gf)
</div>
# Quick Start
A powerful framework for faster, easier, and more efficient project development.
```go
package main
## Installation
import (
"gitee.com/johng/gf/g"
"gitee.com/johng/gf/g/net/ghttp"
)
func main() {
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Write("Hello World")
})
s.Run()
}
```bash
go get -u github.com/gogf/gf/v2
```
[View More..](https://gfer.me/start/index)
## Documentation
- Official Site: [https://goframe.org](https://goframe.org)
- Official Site(en): [https://goframe.org/en](https://goframe.org/en)
- 国内镜像: [https://goframe.org.cn](https://goframe.org.cn)
- Mirror Site: [https://pages.goframe.org](https://pages.goframe.org)
- Mirror Site: [Offline Docs](https://github.com/gogf/goframe.org-pdf?tab=readme-ov-file#%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC)
- GoDoc API: [https://pkg.go.dev/github.com/gogf/gf/v2](https://pkg.go.dev/github.com/gogf/gf/v2)
- Doc Source: [https://github.com/gogf/gf-site](https://github.com/gogf/gf-site)
# License
`GF` is licensed under the [MIT License](LICENSE), 100% free and open-source, forever.
# Contributors(TOP 10)
<a href="https://gitee.com/johng" target="_blank" title="John"><img src="https://gitee.com/uploads/27/1309327_johng.png?1530630243" width="60" align="left"></a>
<a href="https://gitee.com/wenzi1" target="_blank" title="蚊子"><img src="https://images.gitee.com/uploads/22/1923122_wenzi1.png" width="60" align="left"></a>
<a href="https://gitee.com/zseeker" target="_blank" title="zseeker"><img src="https://gfer.me/images/contributors/zseeker.png" width="60" align="left"></a>
<a href="https://gitee.com/ymrjqyy" target="_blank" title="一墨染尽青衣颜"><img src="https://images.gitee.com/uploads/27/876827_ymrjqyy.png" width="60" align="left"></a>
<a href="https://github.com/chenyang351" target="_blank" title="chenyang351"><img src="https://avatars1.githubusercontent.com/u/30063958?s=60&v=4" width="60" align="left"></a>
<a href="https://gitee.com/wxkj" target="_blank" title="wxkj"><img src="https://gitee.com/uploads/56/91356_wxkj.png" width="60" align="left"></a>
<a href="https://github.com/wxkj001" target="_blank" title="3wxkj001
"><img src="https://avatars0.githubusercontent.com/u/7794279?s=60&v=4" width="60" align="left"></a>
<a href="https://gitee.com/zhangjinfu" target="_blank" title="张金富"><img src="https://images.gitee.com/uploads/63/356163_zhangjinfu.png" width="60" align="left"></a>
<a href="https://gitee.com/garfieldkwong" target="_blank" title="GarfieldKwong"><img src="https://gfer.me/images/contributors/garfieldkwong.png" width="60" align="left"></a>
<a href="https://gitee.com/qq1054000800" target="_blank" title="hello"><img src="https://gitee.com/uploads/9/2209_qq1054000800.jpg" width="60" align="left"></a>
<br /><br /><br />
# Donators
<a href="https://gitee.com/zhuhuan12" target="_blank" title="zhuhuan12"><img src="https://gitee.com/uploads/39/751839_zhuhuan12.png" width="60" align="left"></a>
<a href="https://gitee.com/zfan_codes" target="_blank" title="范钟"><img src="https://images.gitee.com/uploads/32/2044832_zfan_codes.png" width="60" align="left"></a>
<a href="https://gitee.com/hailaz" target="_blank" title="HaiLaz"><img src="https://gitee.com/uploads/87/1273187_hailaz.png" width="60" align="left"></a>
<a href="https://gitee.com/mg91" target="_blank" title="mg91"><img src="https://images.gitee.com/uploads/30/1410930_mg91.png" width="60" align="left"></a>
## Contributors
💖 [Thanks to all the contributors who made GoFrame possible](https://github.com/gogf/gf/graphs/contributors) 💖
<a href="https://github.com/gogf/gf/graphs/contributors">
<img src="https://goframe.org/img/contributors.svg?version=v2.10.0" alt="goframe contributors"/>
</a>
## License
`GoFrame` is licensed under the [MIT License](LICENSE), 100% free and open-source, forever.

54
README.zh_CN.MD Normal file
View File

@ -0,0 +1,54 @@
[English](README.MD) | 简体中文
<div align=center>
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe logo"/>
[![Go Reference](https://pkg.go.dev/badge/github.com/gogf/gf/v2.svg)](https://pkg.go.dev/github.com/gogf/gf/v2)
[![GoFrame CI](https://github.com/gogf/gf/actions/workflows/ci-main.yml/badge.svg)](https://github.com/gogf/gf/actions/workflows/ci-main.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/gogf/gf/badge)](https://scorecard.dev/viewer/?uri=github.com/gogf/gf)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9233/badge)](https://bestpractices.coreinfrastructure.org/projects/9233)
[![Go Report Card](https://goreportcard.com/badge/github.com/gogf/gf/v2)](https://goreportcard.com/report/github.com/gogf/gf/v2)
[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf)
[![Production Ready](https://img.shields.io/badge/production-ready-blue.svg?style=flat)](https://github.com/gogf/gf)
[![License](https://img.shields.io/github/license/gogf/gf.svg?style=flat)](https://github.com/gogf/gf)
[![Release](https://img.shields.io/github/v/release/gogf/gf?style=flat)](https://github.com/gogf/gf/releases)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/gogf/gf?style=flat)](https://github.com/gogf/gf/pulls)
[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/gogf/gf?style=flat)](https://github.com/gogf/gf/pulls?q=is%3Apr+is%3Aclosed)
[![GitHub issues](https://img.shields.io/github/issues/gogf/gf?style=flat)](https://github.com/gogf/gf/issues)
[![GitHub closed issues](https://img.shields.io/github/issues-closed/gogf/gf?style=flat)](https://github.com/gogf/gf/issues?q=is%3Aissue+is%3Aclosed)
![Stars](https://img.shields.io/github/stars/gogf/gf?style=flat)
![Forks](https://img.shields.io/github/forks/gogf/gf?style=flat)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/gogf/gf)
</div>
一款强大的框架,为了更快、更轻松、更高效的项目开发。
## 安装
```bash
go get -u github.com/gogf/gf/v2
```
## 文档
- 官方网站: [https://goframe.org](https://goframe.org)
- 官方网站(en): [https://goframe.org/en](https://goframe.org/en)
- 国内镜像: [https://goframe.org.cn](https://goframe.org.cn)
- 镜像网站: [https://pages.goframe.org](https://pages.goframe.org)
- 镜像网站: [离线文档](https://github.com/gogf/goframe.org-pdf?tab=readme-ov-file#%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC)
- Go包文档: [https://pkg.go.dev/github.com/gogf/gf/v2](https://pkg.go.dev/github.com/gogf/gf/v2)
- 文档源码: [https://github.com/gogf/gf-site](https://github.com/gogf/gf-site)
## 贡献者
💖 [感谢所有使 GoFrame 成为可能的贡献者](https://github.com/gogf/gf/graphs/contributors) 💖
<a href="https://github.com/gogf/gf/graphs/contributors">
<img src="https://goframe.org/img/contributors.svg?version=v2.10.0" alt="goframe contributors"/>
</a>
## 许可证
`GoFrame` 采用 [MIT License](LICENSE) 许可100%开源和免费。

View File

@ -1,109 +0,0 @@
# GoFrame
<img align="right" height="150px" src="https://gfer.me/cover.png">
[![Go Doc](https://godoc.org/github.com/gogf/gf?status.svg)](https://godoc.org/github.com/gogf/gf)
[![Build Status](https://travis-ci.org/gogf/gf.svg?branch=master)](https://travis-ci.org/gogf/gf)
[![Go Report](https://goreportcard.com/badge/github.com/gogf/gf)](https://goreportcard.com/report/github.com/gogf/gf)
[![Documents](https://img.shields.io/badge/docs-100%25-green.svg)](https://gfer.me)
[![License](https://img.shields.io/github/license/gogf/gf.svg?style=flat)](https://github.com/gogf/gf)
[![Language](https://img.shields.io/badge/language-go-blue.svg)](https://github.com/gogf/gf)
[![Release](https://img.shields.io/github/release/gogf/gf.svg?style=flat)](https://github.com/gogf/gf/releases)
<!--
[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf)
[![Code Helper](https://www.codetriage.com/gogf/gf/badges/users.svg)](https://www.codetriage.com/gogf/gf)
-->
`GF(Go Frame)`是一款模块化、松耦合、轻量级、高性能的Go应用开发框架。支持热重启、热更新、多域名、多端口、多服务、HTTP/HTTPS、动态路由等特性
并提供了Web服务开发的系列核心组件Router、Cookie、Session、服务注册、配置管理、模板引擎、数据校验、分页管理、数据库ORM等等等等
并且提供了数十个内置核心开发模块集缓存、日志、时间、命令行、二进制、文件锁、内存锁、对象池、连接池、数据编码、进程管理、进程通信、文件监控、定时任务、TCP/UDP组件、
并发安全容器等等等等等等。
# 特点
* 模块化、松耦合设计;
* 丰富实用的开发模块;
* 详尽的开发文档及示例;
* 完善的本地中文化支持;
* 致力于项目的通用方案;
* 更适合企业及团队使用;
* 更多请查阅文档及源码;
# 安装
```html
go get -u gitee.com/johng/gf
```
或者
`go.mod`
```
require gitee.com/johng/gf latest
```
# 限制
```shell
golang版本 >= 1.9.2
```
# 架构
<div align=center>
<img src="https://gfer.me/images/arch.png"/>
</div>
# 文档
开发文档:[https://goframe.org](https://goframe.org)
接口文档:[https://godoc.org/github.com/gogf/gf](https://godoc.org/github.com/gogf/gf)
# 使用
```go
package main
import (
"gitee.com/johng/gf/g"
"gitee.com/johng/gf/g/net/ghttp"
)
func main() {
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.Write("Hello World")
})
s.Run()
}
```
[更多..](https://gfer.me/start/index)
# 协议
`GF` 使用非常友好的 [MIT](LICENSE) 开源协议进行发布,永久`100%`开源免费。
# 贡献者(TOP 10)
<a href="https://gitee.com/johng" target="_blank" title="John"><img src="https://gitee.com/uploads/27/1309327_johng.png" width="60" align="left"></a>
<a href="https://gitee.com/wenzi1" target="_blank" title="蚊子"><img src="https://images.gitee.com/uploads/22/1923122_wenzi1.png" width="60" align="left"></a>
<a href="https://gitee.com/zseeker" target="_blank" title="zseeker"><img src="https://gfer.me/images/contributors/zseeker.png" width="60" align="left"></a>
<a href="https://gitee.com/ymrjqyy" target="_blank" title="一墨染尽青衣颜"><img src="https://images.gitee.com/uploads/27/876827_ymrjqyy.png" width="60" align="left"></a>
<a href="https://github.com/chenyang351" target="_blank" title="chenyang351"><img src="https://avatars1.githubusercontent.com/u/30063958?s=60&v=4" width="60" align="left"></a>
<a href="https://gitee.com/wxkj" target="_blank" title="wxkj"><img src="https://gitee.com/uploads/56/91356_wxkj.png" width="60" align="left"></a>
<a href="https://github.com/wxkj001" target="_blank" title="3wxkj001
"><img src="https://avatars0.githubusercontent.com/u/7794279?s=60&v=4" width="60" align="left"></a>
<a href="https://gitee.com/zhangjinfu" target="_blank" title="张金富"><img src="https://images.gitee.com/uploads/63/356163_zhangjinfu.png" width="60" align="left"></a>
<a href="https://gitee.com/garfieldkwong" target="_blank" title="GarfieldKwong"><img src="https://gfer.me/images/contributors/garfieldkwong.png" width="60" align="left"></a>
<a href="https://gitee.com/qq1054000800" target="_blank" title="hello"><img src="https://gitee.com/uploads/9/2209_qq1054000800.jpg" width="60" align="left"></a>
<br /><br /><br />
# 捐赠者
<a href="https://gitee.com/zhuhuan12" target="_blank" title="zhuhuan12"><img src="https://gitee.com/uploads/39/751839_zhuhuan12.png" width="60" align="left"></a>
<a href="https://gitee.com/zfan_codes" target="_blank" title="范钟"><img src="https://images.gitee.com/uploads/32/2044832_zfan_codes.png" width="60" align="left"></a>
<a href="https://gitee.com/hailaz" target="_blank" title="HaiLaz"><img src="https://gitee.com/uploads/87/1273187_hailaz.png" width="60" align="left"></a>
<a href="https://gitee.com/mg91" target="_blank" title="mg91"><img src="https://images.gitee.com/uploads/30/1410930_mg91.png" width="60" align="left"></a>

View File

@ -1,351 +0,0 @@
# `v1.4.6` (2019-01-24)
## 新特性
1. 新增并发安全的高性能任务定时器模块`gtimer`, 类似于Java的`Timer`但是比较于Java的`Timer`更加强大,内部实现采用灵活高效的`分层时间轮`设计,被设计为可管理维护百万级别以上数量的定时任务。`gtimer`为`GF`框架的核心模块之一,单元测试覆盖率达到`93.6%`[https://goframe.org/os/gtimer/index](https://goframe.org/os/gtimer/index)
1. 采用任务定时器`gtimer`重构`gcron`定时任务模块,去掉第三方`github.com/robfig/cron`包的使用。`gcron`增加单例模式的定时任务:[https://goframe.org/os/gcron/index#](https://goframe.org/os/gcron/index#)
1. `gconv`类型转换模块支持对`struct`结构体中的**指针属性**转换:[https://goframe.org/util/gconv/struct](https://goframe.org/util/gconv/struct)
1. `gform`增加对数据库类型的自动识别特性,这一特性在需要将查询结果`json`编码返回时非常有用: [https://goframe.org/database/orm/index](https://goframe.org/database/orm/index)
1. `Travis CI`增加对`386`架构的自动化测试支持(目前已支持`386`和`amd64`)
## 新功能
1. `ghttp`模块新增`Exit`、`ExitAll`、`ExitHook`方法用于HTTP请求处理流程控制: [https://goframe.org/net/ghttp/service/object](https://goframe.org/net/ghttp/service/object)
1. `grand`模块增加`Meet/MeetProb`方法,用于给定概率的随机满足判断,增加别名方法`N/Str/Digits/Letters`
1. `gvalid`数据/表单校验模块增加`16X`及`19X`手机号的校验支持;
## 功能改进
1. `gform`设置默认的数据库连接池`CONN_MAX_LIFE`参数值为`30`秒;
1. 改进`glist`模块,提高约`20%`左右性能,并增加若干链表操作方法;
1. 改进`gqueue`模块,提高约`50`左右性能,并增加模块对`select`语法的支持(使用`Queue.C`): [https://goframe.org/container/gqueue/index](https://goframe.org/container/gqueue/index)
1. 改进`gmlock`内存锁模块,并完善单元测试用例:[https://goframe.org/os/gmlock/index](https://goframe.org/os/gmlock/index)
1. 改进并发安全容器所有的模块,调整并发安全控制非必需参数`safe...bool`为`unsafe...bool`
1. 改进`gpool`对象复用模块,支持并发安全;
1. 更新`gkafka`模块的第三方依赖包;
1. 完善`ghttp`模块的单元测试用例;
## Bug Fix
1. 修复`gmd5`模块操作文件时的文件指针未关闭问题;
1. 修复`gcache`缓存项过期删除失效问题;
1. 其他修复;
# `v1.3.8` (2018-12-26)
## 新特性
1. 对`gform`完成重构,以提高扩展性,并修复部分细节问题、完善单元测试用例([https://gfer.me/database/orm/index](https://gfer.me/database/orm/index))
1. `WebServer`路由注册新增分组路由特性([https://gfer.me/net/ghttp/group](https://gfer.me/net/ghttp/group));
1. `WebServer`新增`Rewrite`路由重写特性([https://gfer.me/net/ghttp/static](https://gfer.me/net/ghttp/static));
1. 增加框架运行时对开发环境的自动识别;
1. 增加了`Travis CI`自动化构建/测试;
## 新功能
1. 改进`WebServer`静态文件服务功能,增加`SetStaticPath`/`AddStaticPath`方法([https://gfer.me/net/ghttp/static](https://gfer.me/net/ghttp/static))
1. `gform`新增`Filter`链式操作方法,用于过滤参数中的非表字段键值对([https://gfer.me/database/orm/linkop](https://gfer.me/database/orm/linkop)
1. `gcache`新增`Data`方法,用以获取所有的缓存数据项;
1. `gredis`增加`GetConn`方法获取原生redis连接对象
## 功能改进
1. 改进`gform`的`Where`方法,支持`slice`类型的参数,并更方便地支持`in`操作查询([https://gfer.me/database/orm/linkop](https://gfer.me/database/orm/linkop)
1. 改进`gproc`进程间通信数据结构,将`pid`字段从`16bit`扩展为`24bit`
1. 改进`gconv`/`gmap`/`garray`,增加若干操作方法;
1. 改进`gview`模板引擎中的`date`内置函数,当给定的时间戳为空时打印当前的系统时间;
1. 改进`gview`模板引擎中,当打印的变量不存在时,显示为空(标准库默认显示为`<no value>`
1. 改进`WebServer`,去掉`HANGUP`的信号监听,避免程序通过`nohup`运行时产生异常退出问题;
1. 改进`gcache`性能,并完善基准测试;
## Bug Fix
1. 修复`gcache`在非LRU特性开启时的缓存关闭资源竞争问题并修复`doSetWithLockCheck`内部方法的返回值问题;
1. 修复`grand.intn`内部方法在`x86`架构下的随机数位溢出问题;
1. 修复`gbinary`中`Int`方法针对`[]byte`参数长度自动匹配造成的字节长度溢出问题;
1. 修复`gjson`由于官方标准库`json`不支持`map[interface{}]*`类型造成的Go变量编码问题
1. 修复`garray`中部分方法的数据竞争问题,修复二分查找排序问题;
1. 修复`ghttp.Request.GetVar`方法获取参数问题;
1. 修复`gform`的数据库连接池不起作用的问题;
# `v1.2.11` (2018-11-26)
## 新特性
1. `ORM`新增对`SQLServer`及`Oracle`的支持([https://gfer.me/database/orm/database](https://gfer.me/database/orm/database))
1. 完成`gvalid`模块校验结果的顺序特性([https://gfer.me/util/gvalid/checkmap](https://gfer.me/util/gvalid/checkmap));
1. 改进`ghttp.Request.Exit`,使得调用该方法时立即退出业务执行,开发者无需调用`Exit`方法时再使用`return`返回([https://gfer.me/net/ghttp/service/object](https://gfer.me/net/ghttp/service/object))
1. 模板引擎新增若干内置函数:`text/html/htmldecode/url/urldecode/date/compare/substr/strlimit/hidestr/highlight/toupper/tolower/nl2br` ([https://gfer.me/os/gview/funcs](https://gfer.me/os/gview/funcs));
1. 模板引擎新增内置变量`Config` ([https://gfer.me/os/gview/vars](https://gfer.me/os/gview/vars));
1. 改进`gconv.Struct`转换默认规则,支持不区分大小写的键名与属性名称匹配;
1. `gform`配置文件支持`linkinfo`自定义数据库连接字段([https://gfer.me/database/orm/config](https://gfer.me/database/orm/config))
1. `gfsnotify`模块增加对特定回调的取消注册功能([https://gfer.me/os/gfsnotify/index](https://gfer.me/os/gfsnotify/index)
## 新功能
1. 改进`ghttp.Request`,增加`SetParam/GetParam`请求流程自定义变量设置/获取方法,用于在请求流程中的回调函数共享变量([https://gfer.me/net/ghttp/request](https://gfer.me/net/ghttp/request);
1. 改进`ghttp.Response`,增加`ServeFileDownload`方法用于WebServer引导客户端下载文件([https://gfer.me/net/ghttp/response](https://gfer.me/net/ghttp/response));
1. `gvar`模块新增`gvar.VarRead`只读接口,用于控制对外只暴露数据读取功能;
1. 增加`g.Throw`抛异常方法,`g.TryCatch`异常捕获方法封装;
1. 改进`gcron`模块增加自定义的Cron管理对象增加`New/Start/Stop`方法;
## 功能改进
1. WebServer添加`RouterCacheExpire`配置参数,用于设置路由检索缓存过期时间;
1. WebServer允许同一`HOOK`事件被多次绑定注册,先注册的回调函数优先级更高([https://gfer.me/net/ghttp/service/hook](https://gfer.me/net/ghttp/service/hook));
1. 当前工作目录为系统临时目录时,`gcfg`/`gview`/`ghttp`模块默认不添加工作目录到搜索路径;
1. 改进`WebSocket`默认支持跨域请求([https://gfer.me/net/ghttp/websocket](https://gfer.me/net/ghttp/websocket));
1. 改进`gtime.Format`支持中文;
1. 改进`gfsnotify`,支持编辑器对文件非执行标准编辑时(RENAME+CHMOD)的热更新问题;
1. 改进`gtype.Set`方法增加Set原子操作返回旧的变量值;
1. `gfile.ScanDir`增加支持`pattern`多个文件模式匹配,使用'`,`'符号分隔多个匹配模式;
1. `gcfg`模块增加获取配置变量为`*gvar.Var`;
1. `gstr`模块增加对中文截取方法;
1. 改进`gtime.StrToTime`对常用时间格式匹配模式,新增`gtime.ParseTimeFromContent`方法;
1. 修改配置管理、模板引擎、调试模式的环境变量名称为大写下划线标准格式;
1. 改进`grand`模块随机数生成设计,底层使用`crypto/rand`+缓冲区实现高速的随机数生成([https://gfer.me/util/grand/index](https://gfer.me/util/grand/index));
## 问题修复
1. 修复`gspath`模块在`windows`下搜索失效问题;
1. 修复`gspath`模块Search时带有indexFiles的检索问题;
1. bug fix INZS1([https://gitee.com/johng/gf/issues/INZS1](https://gitee.com/johng/gf/issues/INZS1));
1. 修复`gproc.ShellRun`在windows下的执行问题;
# `v1.0.898 stable` (2018-10-24)
## 新特性
1. `gf-orm`增加`sqlite`数据库类型支持([http://gf.johng.cn/database/orm/database](http://gf.johng.cn/database/orm/database))
1. 增加`gkafka`模块对kafka的客户端程序封装支持分组消费及指定起始位置等特性并提供简便易用的API接口([http://gf.johng.cn/database/gkafka/index](http://gf.johng.cn/database/gkafka/index))
1. 增加go语言最新版本的`go modules`特性支持;
1. 增加`gcron`定时任务模块([http://gf.johng.cn/os/gcron/index](http://gf.johng.cn/os/gcron/index))
1. `Web Server`增加路由注册项获取/打印特性,所有的路由注册/回调注册一览无余;
1. 模板引擎增加全局变量管理,并增加多个常用的内置函数及内置变量([http://gf.johng.cn/os/gview/funcs](http://gf.johng.cn/os/gview/funcs)
1. `gredis`改进为单例操作方式(基于基层连接池特性),每次操作`redis`服务器时开发者无需显示调用`Close`方法执行关闭([http://gf.johng.cn/database/gredis/index](http://gf.johng.cn/database/gredis/index)
1. `gf-orm`增加数据库操作自动`Close`特性(基于底层链接池特性),开发者无需再`defer db.Close()`,并增加`g.DB`数据库对象单例别名([http://gf.johng.cn/database/orm/linkop](http://gf.johng.cn/database/orm/linkop)
1. 增加`gvar`通用动态变量模块([http://gf.johng.cn/container/gvar/index](http://gf.johng.cn/container/gvar/index)
1. 数据结构容器增加`并发安全特性开启/关闭功能`,当关闭后和普通的数据结构无异,且在非并发安全模式下性能会得到提高;
1. 新增`gmlock`内存锁模块([http://gf.johng.cn/os/gmlock/index](http://gf.johng.cn/os/gmlock/index)
1. 增加`gaes`算法模块([http://gf.johng.cn/crypto/gaes/index](http://gf.johng.cn/crypto/gaes/index)
1. `gproc`模块增加执行`shell`命令方法([http://gf.johng.cn/os/gproc/index](http://gf.johng.cn/os/gproc/index)
1. 新增`gfcache`模块,用于带自动缓存更新的文件内容操作(文档待完善);
## 新功能
1. `glog`增加链式操作方法,增加日志级别管理控制、分类管理、调试管理功能;
1. `g.View`增加分组名称设置,支持通过`g.*`对象管理器获取多个命名的单例模板引擎对象;
1. `glog`增加对文件名称格式的自定义设置,支持`gtime日期格式`
1. `gconv`增加`Ints/Uints/Floats/Interfaces`转换方法;
1. `gjson`增加`Append`方法;
1. `gparser`增加`NewUnsafe/Append`方法;
1. `gcache`增加`GetOrSet/GetOrSetFunc/GetOrSetFuncLock`方法;
1. `gset`增加`LockFunc/RLockFunc`方法;
1. `ghttp.Response`方法完善,增加`ParseTpl/ParseTplContent/TplContent`方法,`Template`修改为`Tpl`方法;
1. `ghttp.Request`增加获取用户真实IP判断;
1. `Session`增加`Contains`方法;
1. 完善`ghtml`模块,增加多个方法;
1. `gcache`新增`Contains/SetIfNotExist`方法;
1. `gvalid`增加`Error`对象,用以管理校验错误信息;
1. `gvalid`模块增加`struct tag`的校验规则、自定义错误提示信息绑定的支持特性([http://gf.johng.cn/util/gvalid/index](http://gf.johng.cn/util/gvalid/index)
1. `ghttp`增加输入参数与`struct`的`绑定机制`,并增加对应`params`标签支持([http://gf.johng.cn/net/ghttp/service/handler](http://gf.johng.cn/net/ghttp/service/handler)
1. `ghttp.Request`增加服务端`BasicAuth`功能(文档待完善)
1. `gvalid`增加字段校验别名用于自定义返回结果字段并更新WebServer中相关使用的模块
1. `gf-orm`链式操作增加`ForPage`方法,调整`Chunks`方法;
1. `ghttp`对象路由注册增加`Init&Shut`自动回调方法,增加重复路由注册检测功能;
1. `gfsnotify`增加默认递归`Add/Remove`特性;
1. `ghttp.Response`增加`ServiceFile`方法;
1. 其他一些新功能;
## 功能改进
1. 改进`ghttp.Server`配置管理;
1. 改进`gcache`底层对象继承关系,改进部分设计细节,提高性能;
1. 改进`gfpool`文件指针池,修复部分错误,提升性能,并增加基准测试代码;
1. 改进`gmap`系列并发安全map数据结构增加多个易用性的方法
1. 改进`gconv.Struct`对象转换功能([http://gf.johng.cn/util/gconv/index](http://gf.johng.cn/util/gconv/index)
1. 改进`grand`随机数生成规则,提供了极高的随机数生成性能,并保证每一次调用随机方法时生成的都是不同的随机数值([http://gf.johng.cn/util/grand/index](http://gf.johng.cn/util/grand/index)
1. 改进`gfile`文件内容操作方法,增加若干常用的文件内容读取方法;
1. 改进`gtime`模块,并增加时区转换方法;
1. 改进`COOKIE`,去掉锁机制;
1. 改进`SESSION`获取方法,新增多个类型获取方法;
1. 改进`g.DB/g.Config`单例缓存键名;
1. 改进`gtcp/gudp`超时错误判断机制;
1. 改进`gtype`底层统一修改为原子操作;
1. 改进`gvalid`对`struct`的`string`属性的默认值非必需校验;
1. 改进`gvalid`在关联规则下的非必需校验;
1. 改进`gf-orm`在调试模式下日志自动输出功能;
1. `ghttp.Server/gspath`模块静态文件检索改进;
1. 优化`ghttp.ServerConfig`配置,增加`struct/method``名称到uri`的转换规则,通过`SetNameToUri`方法进行灵活配置([http://gf.johng.cn/net/ghttp/service/object](http://gf.johng.cn/net/ghttp/service/object)
1. 改进`*any/:name`路由匹配规则,支持不带名字的`*/:`路由规则;
1. 修改默认配置文件名称 `config.yml` -> `config.toml`[http://gf.johng.cn/os/gcfg/index](http://gf.johng.cn/os/gcfg/index)
1. 调整服务注册的`BindControllerMethod`及`BindObjectMethod`逻辑为绑定路由到指定的方法执行;
1. 改进`garray`二分查找方法,增加安全操作处理;
1. 改进`gdb.Result/Recorde` `ToXml`方法,增加可选的`rootTag`参数;
1. 其他一些改进;
## 问题修复
1. 修复`ghttp.Server`在`windows`下的重启失效问题;
1. 修复`ghttp.Server`服务注册与回调注册路由重复判断问题;
1. 修复`garray`排序数组`Add`变参时的死锁问题;
1. 修复`gfsnotify`默认递归监控整个`gspath.Add`添加的目录的问题;
1. 修复`ghttp.BindParams`对`@file`文件上传标识符的转义问题;
1. 修复`ghttp.Server`日志路径丢失问题;
1. 修复`多WebServer`下的状态检测问题;
1. 修复`gvalid`模块`min/max`校验问题;
1. 修复控制器和执行对象服务注册时绑定'/'路由的问题;
1. 修复`gvalid.CheckStruct`自定义错误提示失效问题;
1. `ghttp.Server`修复`hook`与`serve`方法的路由影响,并新增跳转方法;
1. 其他一些修复;
## 其他改动
1. 去掉`gfile.IsExecutable`方法;
1. 目录调整,将`加密/解密`相关的包从`encoding`目录迁移到`crypto`目录下;
1. 增加`gfsnotify/gfcache`调试信息;
1. `gf-orm`允许写入的键值为`nil`时往数据库中写入`null`;
1. 统一使用`gview.Params`类型作为模板变量类型;
1. `gconv.MapToStruct`方法名称修改为`gconv.Struct`
1. `ghttp.Server`完善重启及停止的终端提示信息;
1. 完善`gring`模块,增加`约瑟夫问题`代码作为`gring`示例程序;
1. 其他一些改动;
# `v0.99.682 beta` (2018-08-07)
## 新特性
1、新增gdes包用于DES加密/加密算法处理;
2、新增gkafka包kafka的golang客户端
3、新增gpool对象复用池比较于标准库的sync.Pool更加灵活强大可自定义对象的缓存时间、创建方法、销毁方法(http://gf.johng.cn/686654)
4、完成网络通信gtcp/gudp包的重构并进行了大量的改进工作新增了详尽的开发文档及示例代码(http://gf.johng.cn/494382)
5、增加gring并发安全环标准库container/ring包的并发安全版本并做了易用性的封装(http://gf.johng.cn/686655)
6、gtime包新增了自定义日期格式话的支持格式化语法类似PHP的date语法(http://gf.johng.cn/494387)
7、gdb增加调试模式特性使用SetDebug方法实现在调试模式下可以获取详细的SQL执行记录增加了详细的开发文档及示例代码(http://gf.johng.cn/702801)
8、gdb增加查询缓存特性使用Cache方法实现增加了详细的开发文档及示例代码(http://gf.johng.cn/702801)
9、ghttp.Server路由功能增加字段匹配规则特性支持如/order/list/{page}.html 动态路由规则特性(http://gf.johng.cn/702766)
10、gpage分页包增加分页URL规则生成模板特性内部可使用{.page}变量指定页码位置(http://gf.johng.cn/716438)
11、增加gmap.Map对象这是gmap.InterfaceInterfaceMap的别名
## 新功能
1、gdb增加MaxIdleConnCount/MaxOpenConnCount/MaxConnLifetime三项配置并增加SetMaxConnLifetime方法
2、ghttp.Client增加HTTP账号密码设置功能(SetBasicAuth)
3、glog新增对系统换行符号的自适配调整(\n|\r\n)
4、增加glog控制台调试模式打印开关(SetDebug)
5、gcfg增加SetFileName方法设置默认读取的配置文件名称
6、gcfg/gjson/gparser包新增Int8/16/32/64,Uint8/16/32/64方法
7、增加gzip方法的封装(Zip/Unzip)
8、gview增加模板变量分隔符设置方法SetDelimiters
9、ghttp.Response增加Writef、Writefln方法
## 功能改进
1、改进gfilepool文件指针池设计改进gfile文本内容写入增加指针池使用
2、gdb包增加调试模式特性并支持在调试模式下获得已执行的SQL列表结果
3、改进gproc进程间通信机制增加进程消息分组特性并限定队列大小
4、gdb结果方法处理增加ToXml/ToJson方法
5、gregx包名修改为gregex
6、改进gtime.StrToTime方法新增对常见标准时间日期的自动转换以及对时区的自动识别支持并调整gconv,gvalid对该包的引用
7、增加对字符集转换的封装gxml包中使用新增的字符集转换包来做处理
8、ghttp.Server.EnableAdmin页面Restart接口支持GET参数newExeFilePath支持
9、ghttp.Server平滑重启机制增加可自定义重启可执行文件路径特别是针对windows系统特别有用(因为windows下不支持可执行文件覆盖更新)
10、改进ghttp.Server静态文件检索设计增加开发环境时的main包源码目录查找机制改进gcfg/gview的main包源码目录查找机制
11、优化gcache设计LRU特性非默认开启优化gtype/gcache基准测试脚本新增gregx基准测试脚本改进设计提升性能
12、gfile包增加GoRootOfBuild方法用于获取编译时的GOROOT数值并改进glog包中backtrace的GOROOT路径过滤处理
13、改进grpool代码质量并改进对池化goroutine数量的限制设计
14、改进gdb.Map/List及g.Map/List的类型定义改用别名特性以便支持原生类型输入(map/slice)并修复gdb.Model.Update方法参数处理问题
15、调整ghttp包示例代码目录结构增加ghttp.Client自定义Header方法ghttp.Cookie增加Map方法用于获得客户端提交的所有cookie值构造成map返回
16、删除gcharset中的getcharset方法
17、去掉gmap中常用的基本数据类型转换获取方法
18、改进gconv.String方法当无法使用基本类型进行字符串转换时使用json.Marshal进行转换
19、gvalid.CheckObject方法名称修改为gvalid.CheckStruct
## 问题修复
1、修正gstr.IsNumeric错误
2、修复当xml中encoding字符集为非UTF-8字符集时报错的问题
3、修正gconv包float32->float64精度问题
4、修复gpage包分页计数问题
5、修复gdb批量数据Save错误
6、去掉gpool中math.MAXINT64常量的使用以修复int64到int类型的转换错误兼容32位系统
7、修正ghttp包没有使用Server仍然初始化相关异步goroutine的问题
# `v0.98.503 beta` (2018-05-21)
## 新特性
1、平滑重启特性( http://gf.johng.cn/625833 )
2、gflock文件锁模块( http://gf.johng.cn/626062 )
3、gproc进程管理及通信模块( http://gf.johng.cn/626063 )
4、gpage分页管理模块强大的动态分页及静态分页功能并为开发者自定义分页样式提供了极高的灵活度( http://gf.johng.cn/597431 )
5、ghttp.Server增加多端口监听特性并支持HTTP/HTTPS( http://gf.johng.cn/494366 , http://gf.johng.cn/598802 )
6、增加gspath目录检索包管理工具支持对多目录下的文件检索特性
7、ghttp包控制器及执行对象注册增加更灵活的动态路由特性路由规则增加{method}变量支持;
## 新功能
1、gutil包增加MapToStruct方法支持将map数据类型映射为struct对象
2、gconv
1)、gconv包增加按照类型名称字符串进行类型转换
2)、gconv包新增Time/TimeDuration类型转换方法
3、ghttp
1)、增加Web Server目录安全访问控制机制
2)、ghttp.Server增加自定义状态码回调函数注册处理
4、gdb
1)、gdb包增加gdb.GetStruct/gdb.Model.Struct方法获取查询结果记录自动转换为指定对象
2)、gdb增加Value/Record/Result类型增加对Value类型的系列类型转换方法
3)、gdb包增加db.GetCount,tx.GetCount,model.Count数量查询方法
## 功能改进
1、改进gredis客户端功能封装
2、改进grand包随机数生成性能
3、grand/gdb/gredis包增加benchmark性能测试脚本
4、改进gjson/gparser包的ToStruct方法实现
5、gdb 改进gdb.New获取ORM操作对象性能
6、gcfg :改进配置文件检索功能;
7、gview模板引擎增加多目录检索功能
8、gfile增加源码main包目录获取方法MainPkgPath
9、ghttp
1)、ghttp.Request增加请求进入和完成时间记录并增加到默认日志内容中
2)、ghttp.Server事件回调之间支持通过ghttp.Request.Param自定义参数进行流程传参
10、gdb
1)、改进gdb.Result与gdb.List, gdb.Record与gdb.Map之间的类型转换便于业务层数据编码处理(如json/xml)
2)、改进gdb.Tx.GetValue返回值类型
3)、gdb.Model.Data参数支持更加灵活的map参数
## 问题修复
1、ghttp
1)、修复ghttp包路由缓存问题
2)、修复服务注册时的控制器及执行对象方法丢失问题;
2、gconv
1)、修正gconv.Float64方法位大小设置问题
2)、修复gconv.Int64(float64(xxx))问题;
2、gdb
1)、修复gdb.GetAll针对返回数据列表的for..range...的返回结果slice相同指针问题
2)、修复gdb.Delete方法错误
3)、修复gdb.Model.And/Or方法
4)、修复gdb.Model.Where方法参数处理问题
3、garray修复garray包Remove方法锁机制问题
4、gtype 修复gtype.Float32/gtype.Float64对象类型的方法逻辑错误
5、gfsnotify修复在windows下文件参数中不同文件分隔符引起的热更新机制失效问题
6、修复gvalid包验证问题如果值为nil并且不需要require*验证时,其他验证失效。并增加单元测试项,测试通过。
# `v0.97.399 beta` (2018-04-23)
1、 增加gfsnotify文件监控模块
2、 配置管理模块增加配置文件自动检测更新机制;
3、 模板引擎增加对模板文件的自动检测更新机制;
4、 改进gconv包基本类型转换功能提高转换性能
5、 增加gpage分页管理包支持动态分页、静态分页以及自定义分页样式特性
6、 ghttp.Request增加Exit方法用以标记服务退出当在服务执行前调用后服务将不再执行
7、 ghttp.Response去掉WriteString方法统一使用Write方法返回数据流是使用灵活的参数形式
8、 模板引擎增加模板变量暴露接口LockFunc/RLockFunc以便支持开发者灵活处理模板变量
9、 ghttp.Server增加access & error log功能并支持开发者自定义日志处理回调函数注册
10、增加gredis包支持对redis的客户端操作封装并将gredis.Redis对象加入到gins单例管理器中进行统一配置管理维护
11、gins单例管理器增加对单例对象配置文件的自动检测更新机制当配置文件在外部发生变更时自动刷新单例管理器中的单例对象
12、gdb数据库ORM包增加And/Or条件链式方法并改进Where/Data方法参数灵活性
13、对于新增加的模块同时也增加了对应的开发文档并梳理完善了现有的其他模块开发文档
14、修复ISSUE:
#IISWI gitee.com/johng/gf/issues/IISWI,
#IISMY gitee.com/johng/gf/issues/IISMY,
反馈并跟踪完成第三方依赖mxj包的ISSUE修复(github.com/clbanning/mxj/issues/48)

108
TODO.MD
View File

@ -1,108 +0,0 @@
# ON THE WAY
1. 增加图形验证码支持,至少支持数字和英文字母;
1. 增加热编译工具,提高开发环境的开发/测试效率媲美PHP开发效率
1. 增加可选择性的orm tag特性用以数据表记录与struct对象转换的键名属性映射
1. ghttp.Response增加输出内容后自动退出当前请求机制不需要用户手动return参考beego如何实现
1. Cookie&Session数据池化处理
1. ghttp.Client增加proxy特性
1. gtime增加对时区转换的封装并简化失去转换时对类似+80500时区的支持
1. orm增加sqlite对Save方法的支持(去掉触发器语句);
1. ghttp.Server增加Ip访问控制功能(DenyIps&AllowIps)
1. ghttp路由功能增加分组路由特性
1. ghttp增加返回数据压缩机制
1. gview中的template标签失效问题
1. gfile文件stat信息使用gfsnotify进行缓存更新改进
1. ghttp.Server增加proxy功能特性本地proxy和远程proxy本地即将路由规则映射远程即反向代理
1. gjson对大json数据的解析效率问题
1. ghttp增加route name特性并同时支持backend和template(提供内置函数)引用可以通过RedirectRoute方法给定route name和路由参数跳转到指定的路由地址上
1. ghttp.Client自动Close机制
1. gvalid校验支持当第一个规则失败后便不再校验后续的规则最好做成链式操作
1. 检查ghttp.Server超时问题
1. gvalid增加支持对[]rune的长度校验(一个中文占3个字节)
1. ghttp.Request增加对输入参数的自动HtmlEncode机制
1. 常量命名风格根据golint进行修改
1. 开放rwmutex包并将gjson的互斥锁使用自定义的mutex替换
1. 文档完善:
- gconv struct tag、
- 控制器及执行对象注册的Init&Shut方法、
- ghttp.Response&ServeFile、gfcache、gproc shell执行、
- ghttp Server&Client basic auth、
- glog分类&日志等级&链式操作、gdb debug自动输出调试信息、gmlock内存锁、
1. 服务注册域名增加对泛域名的支持;
1. Cookie设置中文失效问题
1. 使用gconv将slice映射到struct属性上例如redis hscan的结果集
1. 项目参考:
- https://github.com/namreg/godown
- https://github.com/Masterminds/sprig
1. gform参考 https://gohouse.github.io/gorose/dist/index.html 进行改进
1. gtcp提供简便的包发送/接收方法(SendPkg/RecvPkg)以解决常见的TCP通信粘包问题并完善文档参考https://www.cnblogs.com/kex1n/p/6502002.html
1. gfile对于文件的读写强行使用了gfpool在某些场景下不合适需要考虑剥离开并为开发者提供单独的指针池文件操作特性
1. 路由增加不区分大小写得匹配方式;
1. str_ireplace: http://php.net/manual/en/function.str-ireplace.php
1. strpos/stripos/strrpos/strripos: http://php.net/manual/en/function.stripos.php
1. 改进WebServer获取POST参数处理逻辑当提交非form数据时例如json数据针对某些方法可以直接解析
1. WebServer增加可选择的路由覆盖配置默认情况下不覆盖
1. gkafka这个包比较重未来从框架中剥离出来
1. grpool性能压测结果变慢的问题
1. 增加jumplist的数据结构容器
1. DelayQueue/PriorityQueue
1. gconv针对struct的转换增加json tag支持gconv.Map默认也支持json tag;
# DONE
1. gconv完善针对不同类型的判断例如尽量减少sprintf("%v", xxx)来执行string类型的转换
2. ghttp.Server请求执行中增加服务退出的方法不再执行后续操作
3. ghttp.Response对象完善并改进数据返回方法(Write/WriteString)
4. ghttp.Server请求执行中增加服务退出的方法不再执行后续操作
5. 增加fsnotify包支持
6. 改进gcfg和gview的文件自动更新机制
7. 将模板变量进行暴露,以便应用端可以进行灵活控制;
8. 跟踪第三方mxj包的issue问题https://github.com/clbanning/mxj/issues/48
9. gdb Where方法参数的改进研究是否可以将string参数类型修改为interface{}
10. gpage分页控制功能
11. https支持
12. ghttp.Server日志中增加请求时间和返回时间以便计算执行时间差
13. 由于去掉了gdb的单例模式并且将gins的部分对象封装迁移到了g包中需要同时梳理文档完善修改
14. 在代码中增加https与http同时开启使用的示例代码这块大家问得比较多
15. ghttp.Server多个事件之间通过ghttp.Request.Param自定义参数传参
16. 研究是否增加配置文件目录检索功能,特别是如何友好改进开发环境的配置文件默认目录问题;
17. 增加ghttp.Server不同状态码的自定义处理方法
18. ghttp.Server平滑重启方案
19. 完善gconv类型转换功能增加time.Time/time.Duration类型转换并增加benchmark测试脚本
20. 当二进制参数为nil时gjson.LoadContent并将gjson.Json对象ToMap时会报错
21. 改进控制器及执行对象注册,更友好地支持动态路由注册,例如:注册规则为 /channel/:name现有的控制器及执行对象注册很难友好支持这种动态形式
22. 当前gpage分页包的输出标签不支持li大多数CSS框架都是li+a标签模式需要提供可更加灵活的定制化功能实现
23. 平滑重启机制改进,以便于开发阶段调试;
24. 对grpool进行优化改进包括属性原子操作封装采用gtype实现修正设计BUGhttps://github.com/gogf/gf/issues/6
25. gredis增加redis密码支持
26. 改进ghttp.Server平滑重启机制当新进程接管服务后再使用进程间通信方式通知父进程销毁
27. gproc进程间通信增加分组特性不同的进程间可以通过进程ID以及分组名称发送/获取进程消息;
28. ORM增加获取被执行的sql语句的方法
29. gdb增加查询缓存特性
30. gpage分页增加对自定义后缀的支持如:2.html, 2.php等等
31. gvalid包增加struct tag的校验规则、自定义错误提示信息绑定的支持特性
32. 增加文件缓存包可根据fsnotify机制进行缓存更新
33. *any/:name路由匹配路由改进支持不带名字的*/:路由规则;
34. ghttp静态文件服务改进(特别是403返回状态的修改)
35. map转struct增加对tag的支持
36. gcache检查在i386下的int64->int转换问题
37. ghttp获取参数支持直接转struct功能
38. gfsnotify增加对于目录的监控
39. 检查windows下的平滑重启失效问题
40. ghttp.Server的Cookie及Session锁机制优化(去掉map锁机制);
41. 解决glog串日志情况
42. glog增加对日志文件名称的生成规则设定支持时间格式规则
43. ghttp日志增加客户端IP信息
44. 完善gform配置管理说明g.DB/Database和gdb.New的区别
1. 完善配置管理章节,说明默认的配置文件更改方式;
1. 服务注册时判断方法定义满足规范时才执行绑定否则提示WARN信息
1. `gfsnotify`增加添加监听文件时的监听ID返回以便调用端删除监听时只删除自己添加的监听而不影响其他对该同一文件的监听回调
1. `gfsnotify`针对添加目录监听时无法使用多个`Watcher`,考虑改进,并考虑动态扩容全局`Watcher`方案;
1. 由于系统对inotify实例数量(`fs.inotify.max_user_instances`)以及队列大小(`fs.inotify.max_user_watches`)有限制,需要改进`gfsnotify`
1. WebServer事件回调允许对同一个路由规则绑定多个事件回调
1. gcfg/gview/ghttp等模块加上对临时文件目录的自动添加监听判断基本是开发环境下特别是windows环境去掉临时文件的监听避免临时文件过大引起的运行缓慢占用内存问题
1. 改进gfpool在文件指针变化时的更新
1. ghttp hook回调使用方式在注册路由比较多的时候优先级可能使得开发者混乱考虑方式便于管理
1. gform对于MySQL字段类型为datetime类型的时区问题分析
1. 改进证书打开失败时的WebServer错误提示前置HOOK校验后关闭后续的HOOK逻辑执行
1. 目前WebServer的HOOK是按照优先级执行的需要增加覆盖特性

21
cmd/gf/LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 john@goframe.org https://goframe.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

36
cmd/gf/Makefile Normal file
View File

@ -0,0 +1,36 @@
.DEFAULT_GOAL := pack
pack: pack.template-single pack.template-mono pack.template-mono-app
pack.template-single:
@rm -fr temp
@mkdir temp || exit 0
@cd temp && git clone https://github.com/gogf/template-single
@rm -fr temp/template-single/.git
@cd temp && gf pack template-single ../internal/packed/template-single.go -n=packed -y
@rm -fr temp
pack.template-mono:
@rm -fr temp
@mkdir temp || exit 0
@cd temp && git clone https://github.com/gogf/template-mono
@rm -fr temp/template-mono/.git
@cd temp && gf pack template-mono ../internal/packed/template-mono.go -n=packed -y
@rm -fr temp
# Note:
# command `sed` only works on MacOS.
# use `grep -irl 'template-single' temp| xargs sed -i'' -e 's/template-single/template-mono-app/g'` on other platforms.
pack.template-mono-app:
@rm -fr temp
@mkdir temp || exit 0
@cd temp && git clone https://github.com/gogf/template-single
@cd temp && mv template-single template-mono-app
@rm -fr temp/template-mono-app/.git
@rm -fr temp/template-mono-app/.gitattributes
@rm -fr temp/template-mono-app/.gitignore
@rm -fr temp/template-mono-app/go.mod
@rm -fr temp/template-mono-app/go.sum
@grep -irl 'template-single' temp| xargs sed -i '' -e 's/template-single/template-mono-app/g'
@cd temp && gf pack template-mono-app ../internal/packed/template-mono-app.go -n=packed -y
@rm -fr temp

82
cmd/gf/README.MD Normal file
View File

@ -0,0 +1,82 @@
English | [简体中文](README.zh_CN.MD)
# gf
`gf` is a powerful CLI tool for building [GoFrame](https://goframe.org) application with convenience.
## 1. Install
## 1) PreCompiled Binary
You can also install `gf` tool using pre-built binaries: <https://github.com/gogf/gf/releases>
1. `Mac` & `Linux`
```shell
wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(go env GOOS)_$(go env GOARCH) && chmod +x gf && ./gf install -y && rm ./gf
```
> If you're using `zsh`, you might need rename your alias by command `alias gf=gf` to resolve the conflicts between `gf` and `git fetch`.
2. `Windows`
Manually download, execute in command line it and then follow the instruction.
3. Database support
| DB | builtin support | remarks |
| :--------: | :-------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| mysql | yes | - |
| mariadb | yes | - |
| tidb | yes | - |
| mssql | yes | - |
| oracle | yes | - |
| pgsql | yes | - |
| sqlite | yes | - |
| sqlitecgo | no | to support sqlite database on 32bit architecture systems, manually add package import to the [source codes](./internal/cmd/cmd_gen_dao.go) and do the building. |
| clickhouse | yes | - |
| dm | no | manually add package import to the [source codes](./internal/cmd/cmd_gen_dao.go) and do the building. |
## 2) Manually Install
```shell
go install github.com/gogf/gf/cmd/gf/v2@latest # latest version
go install github.com/gogf/gf/cmd/gf/v2@v2.5.5 # certain version(should be >= v2.5.5)
```
## 2. Commands
```shell
$ gf -h
USAGE
gf COMMAND [OPTION]
COMMAND
up upgrade GoFrame version/tool to latest one in current project
env show current Golang environment variables
fix auto fixing codes after upgrading to new GoFrame version
run running go codes with hot-compiled-like feature
gen automatically generate go files for dao/do/entity/pb/pbentity
tpl template parsing and building commands
init create and initialize an empty GoFrame project
pack packing any file/directory to a resource file, or a go file
build cross-building go project for lots of platforms
docker build docker image for current GoFrame project
install install gf binary to system (might need root/admin permission)
version show version information of current binary
doc download https://pages.goframe.org/ to run locally
OPTION
-y, --yes all yes for all command without prompt ask
-v, --version show version information of current binary
-d, --debug show internal detailed debugging information
-h, --help more information about this command
ADDITIONAL
Use "gf COMMAND -h" for details about a command.
```
## 3. FAQ
### 1). Command `gf run` returns `pipe: too many open files`
Please use `ulimit -n 65535` to enlarge your system configuration for max open files for current terminal shell session, and then `gf run`.

82
cmd/gf/README.zh_CN.MD Normal file
View File

@ -0,0 +1,82 @@
[English](README.MD) | 简体中文
# gf
`gf` 是一个强大的 CLI 工具,用于便捷地构建 [GoFrame](https://goframe.org) 应用程序。
## 1. 安装
## 1) 预编译二进制文件
您也可以使用预构建的二进制文件安装 `gf` 工具:<https://github.com/gogf/gf/releases>
1. `Mac` & `Linux`
```shell
wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(go env GOOS)_$(go env GOARCH) && chmod +x gf && ./gf install -y && rm ./gf
```
> 如果您使用 `zsh`,您可能需要通过命令 `alias gf=gf` 重命名别名以解决 `gf` 和 `git fetch` 之间的冲突。
2. `Windows`
手动下载,在命令行中执行,然后按照说明操作。
3. 数据库支持
| 数据库 | 内置支持 | 说明 |
| :--------: | :-------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| mysql | 是 | - |
| mariadb | 是 | - |
| tidb | 是 | - |
| mssql | 是 | - |
| oracle | 是 | - |
| pgsql | 是 | - |
| sqlite | 是 | - |
| sqlitecgo | 否 | 要在 32 位架构系统上支持 sqlite 数据库,请手动向[源代码](./internal/cmd/cmd_gen_dao.go)添加包导入并进行构建。 |
| clickhouse | 是 | - |
| dm | 否 | 手动向[源代码](./internal/cmd/cmd_gen_dao.go)添加包导入并进行构建。 |
## 2) 手动安装
```shell
go install github.com/gogf/gf/cmd/gf/v2@latest # 最新版本
go install github.com/gogf/gf/cmd/gf/v2@v2.5.5 # 特定版本(应该 >= v2.5.5)
```
## 2. 命令
```shell
$ gf -h
用法
gf 命令 [选项]
命令
up 升级项目中的 GoFrame 版本/工具到最新版本
env 显示当前 Golang 环境变量
fix 升级到新 GoFrame 版本后自动修复代码
run 运行 go 代码,具有热编译功能
gen 自动生成 dao/do/entity/pb/pbentity 的 go 文件
tpl 模板解析和构建命令
init 创建并初始化一个空的 GoFrame 项目
pack 将任何文件/目录打包到资源文件或 go 文件
build 为多个平台交叉编译 go 项目
docker 为当前 GoFrame 项目构建 docker 镜像
install 将 gf 二进制文件安装到系统(可能需要 root/admin 权限)
version 显示当前二进制文件的版本信息
doc 下载 https://pages.goframe.org/ 本地运行
选项
-y, --yes 对所有命令都使用 yes不再提示
-v, --version 显示当前二进制文件的版本信息
-d, --debug 显示内部详细的调试信息
-h, --help 显示此命令的更多信息
附加信息
使用 "gf 命令 -h" 获取有关命令的详细信息。
```
## 3. 常见问题
### 1). 命令 `gf run` 返回 `pipe: too many open files`
请使用 `ulimit -n 65535` 扩大系统配置以增加当前终端 shell 会话的最大打开文件数,然后再运行 `gf run`。

120
cmd/gf/gfcmd/gfcmd.go Normal file
View File

@ -0,0 +1,120 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
// Package gfcmd provides the management of CLI commands for `gf` tool.
package gfcmd
import (
"context"
"runtime"
_ "github.com/gogf/gf/cmd/gf/v2/internal/packed"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcfg"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/cmd/gf/v2/internal/cmd"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/allyes"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
const cliFolderName = `hack`
// Command manages the CLI command of `gf`.
// This struct can be globally accessible and extended with custom struct.
type Command struct {
*gcmd.Command
}
// Run starts running the command according the command line arguments and options.
func (c *Command) Run(ctx context.Context) {
defer func() {
if exception := recover(); exception != nil {
if err, ok := exception.(error); ok {
mlog.Print(err.Error())
} else {
panic(gerror.NewCodef(gcode.CodeInternalPanic, "%+v", exception))
}
}
}()
// CLI configuration, using the `hack/config.yaml` in priority.
if path, _ := gfile.Search(cliFolderName); path != "" {
if adapter, ok := g.Cfg().GetAdapter().(*gcfg.AdapterFile); ok {
if err := adapter.SetPath(path); err != nil {
mlog.Fatal(err)
}
}
}
// zsh alias "git fetch" conflicts checks.
handleZshAlias()
// -y option checks.
allyes.Init()
// just run.
if err := c.RunWithError(ctx); err != nil {
// Exit with error message and exit code 1.
// It is very important to exit the command process with code 1.
mlog.Fatalf(`%+v`, err)
}
}
// GetCommand retrieves and returns the root command of CLI `gf`.
func GetCommand(ctx context.Context) (*Command, error) {
root, err := gcmd.NewFromObject(cmd.GF)
if err != nil {
return nil, err
}
err = root.AddObject(
cmd.Up,
cmd.Env,
cmd.Fix,
cmd.Run,
cmd.Gen,
cmd.Tpl,
cmd.Init,
cmd.Pack,
cmd.Build,
cmd.Docker,
cmd.Install,
cmd.Version,
cmd.Doc,
cmd.CfgEditor,
)
if err != nil {
return nil, err
}
command := &Command{
root,
}
return command, nil
}
// zsh alias "git fetch" conflicts checks.
func handleZshAlias() {
if runtime.GOOS == "windows" {
return
}
if home, err := gfile.Home(); err == nil {
zshPath := gfile.Join(home, ".zshrc")
if gfile.Exists(zshPath) {
var (
aliasCommand = `alias gf=gf`
content = gfile.GetContents(zshPath)
)
if !gstr.Contains(content, aliasCommand) {
_ = gfile.PutContentsAppend(zshPath, "\n"+aliasCommand+"\n")
}
}
}
}

69
cmd/gf/go.mod Normal file
View File

@ -0,0 +1,69 @@
module github.com/gogf/gf/cmd/gf/v2
go 1.23.0
require (
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.10.0
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.10.0
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.0
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.10.0
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.0
github.com/gogf/gf/v2 v2.10.0
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f
github.com/olekukonko/tablewriter v1.1.0
github.com/schollz/progressbar/v3 v3.15.0
golang.org/x/mod v0.25.0
golang.org/x/tools v0.26.0
)
require (
aead.dev/minisign v0.2.0 // indirect
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/ClickHouse/clickhouse-go/v2 v2.0.15 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods/v2 v2.0.0-alpha // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/microsoft/go-mssqldb v1.7.1 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/paulmach/orb v0.7.1 // indirect
github.com/pierrec/lz4/v4 v4.1.14 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sijms/go-ora/v2 v2.7.10 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.38.0 // indirect
go.opentelemetry.io/otel/metric v1.38.0 // indirect
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.22.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/sqlite v1.23.1 // indirect
)

246
cmd/gf/go.sum Normal file
View File

@ -0,0 +1,246 @@
aead.dev/minisign v0.2.0 h1:kAWrq/hBRu4AARY6AlciO83xhNnW9UaC8YipS2uhLPk=
aead.dev/minisign v0.2.0/go.mod h1:zdq6LdSd9TbuSxchxwhpA9zEb9YXcVGoE8JakuiGaIQ=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
github.com/ClickHouse/clickhouse-go/v2 v2.0.15 h1:lLAZliqrZEygkxosLaW1qHyeTb4Ho7fVCZ0WKCpLocU=
github.com/ClickHouse/clickhouse-go/v2 v2.0.15/go.mod h1:Z21o82zD8FFqefOQDg93c0XITlxGbTsWQuRm588Azkk=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emirpasic/gods/v2 v2.0.0-alpha h1:dwFlh8pBg1VMOXWGipNMRt8v96dKAIvBehtCt6OtunU=
github.com/emirpasic/gods/v2 v2.0.0-alpha/go.mod h1:W0y4M2dtBB9U5z3YlghmpuUhiaZT2h6yoeE+C1sCp6A=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo=
github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.10.0 h1:9PTchr92xIJej4tq5c+HOHSU7LGOHr3YfD7tuf23LW4=
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.10.0/go.mod h1:eKtLMs9uccxFvmoKOUCRQ/Se3nxhzEZwF0Ir13qbk5g=
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.10.0 h1:mBs6XpNM34IdZPZv4Kv3LA8yhP2UisbONMLfnQVFvKM=
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.10.0/go.mod h1:mChbF9FrmiYMSE2rG3zdxI/oSTwaHsR5KbINAgt3KcY=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.0 h1:UvqxwinkelKxwdwnKUfdy51/ls4RL7MCeJqAZOVAy0I=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.0/go.mod h1:6v7oGBF9wv59WERJIOJxXmLhkUcxwON3tPYW3AZ7wbY=
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.10.0 h1:MvhoMaz8YYj4WJuYzKGDdzJYiieiYiqp0vjoOshfOF4=
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.10.0/go.mod h1:vb2fx33RGhjhOaocOTEFvlEuBSGHss5S0lZ4sS3XK6E=
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0 h1:39+jbTenm7KBj4hO2C8ANAxVHpX/7OuRDs1VcGC9ylA=
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0/go.mod h1:B0s0fVzn0W220E8UTpSGzrrGKsop5KcB90twBeLCiz0=
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.0 h1:OyAH7Ls2c9Un7CJiAq7G6eY1jWIICRkN8C5SyM94rnY=
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.0/go.mod h1:fwhAMG0qZpeHbbP2JE78rJRfV7eBbu9jXkxTMM1lwyo=
github.com/gogf/gf/v2 v2.10.0 h1:rzDROlyqGMe/eM6dCalSR8dZOuMIdLhmxKSH1DGhbFs=
github.com/gogf/gf/v2 v2.10.0/go.mod h1:Svl1N+E8G/QshU2DUbh/3J/AJauqCgUnxHurXWR4Qx0=
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f h1:7xfXR/BhG3JDqO1s45n65Oyx9t4E/UqDOXep6jXdLCM=
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f/go.mod h1:HnYoio6S7VaFJdryKcD/r9HgX+4QzYfr00XiXUo/xz0=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw=
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/microsoft/go-mssqldb v1.7.1 h1:KU/g8aWeM3Hx7IMOFpiwYiUkU+9zeISb4+tx3ScVfsM=
github.com/microsoft/go-mssqldb v1.7.1/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615/go.mod h1:Ad7oeElCZqA1Ufj0U9/liOF4BtVepxRcTvr2ey7zTvM=
github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM=
github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI=
github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
github.com/olekukonko/tablewriter v1.1.0 h1:N0LHrshF4T39KvI96fn6GT8HEjXRXYNDrDjKFDB7RIY=
github.com/olekukonko/tablewriter v1.1.0/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo=
github.com/paulmach/orb v0.7.1 h1:Zha++Z5OX/l168sqHK3k4z18LDvr+YAO/VjK0ReQ9rU=
github.com/paulmach/orb v0.7.1/go.mod h1:FWRlTgl88VI1RBx/MkrwWDRhQ96ctqMCh8boXhmqB/A=
github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4/v4 v4.1.14 h1:+fL8AQEZtz/ijeNnpduH0bROTu0O3NZAlPjQxGn8LwE=
github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/schollz/progressbar/v3 v3.15.0 h1:cNZmcNiVyea6oofBTg80ZhVXxf3wG/JoAhqCCwopkQo=
github.com/schollz/progressbar/v3 v3.15.0/go.mod h1:ncBdc++eweU0dQoeZJ3loXoAc+bjaallHRIm8pVVeQM=
github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/sijms/go-ora/v2 v2.7.10 h1:GSLdj0PYYgSndhsnm7b6p32OqgnwnUZSkFb3j+htfhI=
github.com/sijms/go-ora/v2 v2.7.10/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191220220014-0732a990476f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE=
modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY=
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM=
modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk=

22
cmd/gf/go.work Normal file
View File

@ -0,0 +1,22 @@
go 1.23.0
use ./
// =====================================================================================================
// NOTE:
// Please update associated commands in ../../.set_version.sh if any of the follows replacements change.
// =====================================================================================================
replace (
github.com/gogf/gf/contrib/drivers/clickhouse/v2 => ../../contrib/drivers/clickhouse
github.com/gogf/gf/contrib/drivers/mssql/v2 => ../../contrib/drivers/mssql
github.com/gogf/gf/contrib/drivers/mysql/v2 => ../../contrib/drivers/mysql
github.com/gogf/gf/contrib/drivers/oracle/v2 => ../../contrib/drivers/oracle
github.com/gogf/gf/contrib/drivers/pgsql/v2 => ../../contrib/drivers/pgsql
github.com/gogf/gf/contrib/drivers/sqlite/v2 => ../../contrib/drivers/sqlite
github.com/gogf/gf/contrib/drivers/mariadb/v2 => ../../contrib/drivers/mariadb
github.com/gogf/gf/contrib/drivers/tidb/v2 => ../../contrib/drivers/tidb
github.com/gogf/gf/contrib/drivers/oceanbase/v2 => ../../contrib/drivers/oceanbase
github.com/gogf/gf/contrib/drivers/gaussdb/v2 => ../../contrib/drivers/gaussdb
github.com/gogf/gf/v2 => ../../
)

View File

@ -0,0 +1,112 @@
# GoFrame Config Editor
A web-based visual configuration editor for GoFrame projects. It reads your `config.yaml` and provides an interactive UI to view, edit, and save configuration fields with type-aware inputs, validation, and i18n support.
## Quick Start
```bash
gf config # Start on port 8888, auto-detect config file
gf config -p 9000 # Use a custom port
gf config -f manifest/config/config.yaml # Specify config file path
```
The browser opens automatically at `http://127.0.0.1:<port>`.
## Features
### Supported Modules
| Module | Config Node | Description |
|--------|-------------|-------------|
| Server | `server` | HTTP server settings (address, timeouts, TLS, sessions, logging, PProf) |
| Database | `database` | Database connections (host, port, credentials, pool, timeouts) |
| Redis | `redis` | Redis connections (address, auth, pool, sentinel, cluster) |
| Logger | `logger` | Logging configuration (level, rotation, output) |
| Viewer | `viewer` | Template engine settings (paths, delimiters, auto-encode) |
### UI Features
- **Type-aware inputs**: bool fields get toggle switches, duration fields get text input with placeholder hints, map/slice fields get JSON editors
- **Default value display**: each field shows its default value from struct tags
- **Validation**: fields with `v:"required"` tags are validated on blur
- **Modified tracking**: changed fields are marked with a blue indicator bar
- **Group collapse**: fields are organized by logical groups (Basic, Connection, Pool, etc.)
- **Search**: search fields by name, key, description, or type (supports Chinese)
- **i18n**: switch between English and Chinese field descriptions
- **Export format**: save as YAML, TOML, or JSON
- **Keyboard shortcut**: `Ctrl/Cmd + S` to save
### Config File Detection
When no `-f` flag is provided, the editor searches these paths in order:
1. `config.yaml` / `config.yml` / `config.toml` / `config.json`
2. `config/config.yaml` (and variants)
3. `manifest/config/config.yaml` (and variants)
4. `app.yaml` / `app.yml`
### Nested Config Support
GoFrame stores database and redis configs under group names:
```yaml
database:
default:
host: 127.0.0.1
port: 3306
redis:
default:
address: 127.0.0.1:6379
```
The editor correctly reads and writes these nested structures.
## Architecture
```
cmd/gf/internal/cmd/
├── cmd_config.go # CLI command + REST API handlers
├── resources/
│ ├── templates/index.html # Vue 3 + Tailwind CSS SPA
│ ├── static/vue.global.prod.js # Vue 3 runtime
│ ├── static/tailwind.min.css # Tailwind CSS
│ └── i18n/{en,zh-CN}.yaml # Field descriptions
os/gcfg/
├── gcfg_schema.go # Schema registry (FieldSchema, ModuleSchema, SchemaRegistry)
└── gcfg_z_unit_schema_test.go # Unit tests
```
### API Endpoints
| Method | Path | Description |
|--------|------|-------------|
| GET | `/api/schemas` | Returns all registered module schemas (fields, types, defaults, rules) |
| GET | `/api/config` | Returns current config values from file |
| POST | `/api/config/validate` | Validates config values against schema rules |
| POST | `/api/config/save` | Saves config to file (preserves YAML comments) |
| GET | `/api/i18n/:lang` | Returns i18n translations for the given language |
### Struct Tags
Configuration field metadata is extracted from struct tags:
| Tag | Purpose | Example |
|-----|---------|---------|
| `json` | YAML/JSON key | `json:"address"` |
| `d` | Default value | `d:":0"` |
| `v` | Validation rule (gvalid) | `v:"required"` |
| `dc` | Description + i18n key | `dc:"Server address\|i18n:config.server.address"` |
## Development
### Building
```bash
go build ./cmd/gf/...
```
### Testing
```bash
go test -count=1 -v ./os/gcfg/... -run TestSchema
```

View File

@ -0,0 +1,79 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
// Package cmd provides the management of CLI commands for `gf` tool.
package cmd
import (
"context"
"strings"
"github.com/gogf/gf/v2"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/util/gtag"
"github.com/gogf/gf/cmd/gf/v2/internal/service"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
// GF is the management object for `gf` command line tool.
var GF = cGF{}
type cGF struct {
g.Meta `name:"gf" ad:"{cGFAd}"`
}
const (
cGFAd = `
ADDITIONAL
Use "gf COMMAND -h" for details about a command.
`
)
func init() {
gtag.Sets(g.MapStrStr{
`cGFAd`: cGFAd,
})
}
type cGFInput struct {
g.Meta `name:"gf"`
Yes bool `short:"y" name:"yes" brief:"all yes for all command without prompt ask" orphan:"true"`
Version bool `short:"v" name:"version" brief:"show version information of current binary" orphan:"true"`
Debug bool `short:"d" name:"debug" brief:"show internal detailed debugging information" orphan:"true"`
}
type cGFOutput struct{}
func (c cGF) Index(ctx context.Context, in cGFInput) (out *cGFOutput, err error) {
// Version.
if in.Version {
_, err = Version.Index(ctx, cVersionInput{})
return
}
answer := "n"
// No argument or option, do installation checks.
if data, isInstalled := service.Install.IsInstalled(); !isInstalled {
mlog.Print("hi, it seems it's the first time you installing gf cli.")
answer = gcmd.Scanf("do you want to install gf(%s) binary to your system? [y/n]: ", gf.VERSION)
} else if !data.IsSelf {
mlog.Print("hi, you have installed gf cli.")
answer = gcmd.Scanf("do you want to install gf(%s) binary to your system? [y/n]: ", gf.VERSION)
}
if strings.EqualFold(answer, "y") {
if err = service.Install.Run(ctx); err != nil {
return
}
gcmd.Scan("press `Enter` to exit...")
return
}
// Print help content.
gcmd.CommandFromCtx(ctx).Print()
return
}

View File

@ -0,0 +1,399 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"encoding/json"
"fmt"
"os"
"regexp"
"runtime"
"strings"
"github.com/gogf/gf/v2/encoding/gbase64"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gbuild"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/genv"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gproc"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gtag"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
var Build = cBuild{
nodeNameInConfigFile: "gfcli.build",
packedGoFileName: "internal/packed/build_pack_data.go",
}
type cBuild struct {
g.Meta `name:"build" brief:"{cBuildBrief}" dc:"{cBuildDc}" eg:"{cBuildEg}" ad:"{cBuildAd}"`
nodeNameInConfigFile string // nodeNameInConfigFile is the node name for compiler configurations in configuration file.
packedGoFileName string // packedGoFileName specifies the file name for packing common folders into one single go file.
}
const (
cBuildDefaultFile = "main.go"
cBuildBrief = `cross-building go project for lots of platforms`
cBuildEg = `
gf build main.go
gf build main.go --ps public,template
gf build main.go --cgo
gf build main.go -m none
gf build main.go -n my-app -a all -s all
gf build main.go -n my-app -a amd64,386 -s linux -p .
gf build main.go -n my-app -v 1.0 -a amd64,386 -s linux,windows,darwin -p ./docker/bin
`
cBuildDc = `
The "build" command is most commonly used command, which is designed as a powerful wrapper for
"go build" command for convenience cross-compiling usage.
It provides much more features for building binary:
1. Cross-Compiling for many platforms and architectures.
2. Configuration file support for compiling.
3. Build-In Variables.
`
cBuildAd = `
PLATFORMS
aix ppc64
android 386,amd64,arm,arm64
darwin amd64,arm64
dragonfly amd64
freebsd 386,amd64,arm
illumos amd64
ios arm64
js wasm
linux 386,amd64,arm,arm64,loong64,mips,mipsle,mips64,mips64le,ppc64,ppc64le,riscv64,s390x
netbsd 386,amd64,arm
openbsd 386,amd64,arm,arm64
plan9 386,amd64,arm
solaris amd64
wasip1 wasm
windows 386,amd64,arm,arm64
`
// https://golang.google.cn/doc/install/source
cBuildPlatforms = `
aix ppc64
android 386
android amd64
android arm
android arm64
darwin amd64
darwin arm64
dragonfly amd64
freebsd 386
freebsd amd64
freebsd arm
illumos amd64
ios arm64
js wasm
linux 386
linux amd64
linux arm
linux arm64
linux loong64
linux mips
linux mipsle
linux mips64
linux mips64le
linux ppc64
linux ppc64le
linux riscv64
linux s390x
netbsd 386
netbsd amd64
netbsd arm
openbsd 386
openbsd amd64
openbsd arm
openbsd arm64
plan9 386
plan9 amd64
plan9 arm
solaris amd64
wasip1 wasm
windows 386
windows amd64
windows arm
windows arm64
`
)
func init() {
gtag.Sets(g.MapStrStr{
`cBuildBrief`: cBuildBrief,
`cBuildDc`: cBuildDc,
`cBuildEg`: cBuildEg,
`cBuildAd`: cBuildAd,
})
}
type cBuildInput struct {
g.Meta `name:"build" config:"gfcli.build"`
File string `name:"FILE" arg:"true" brief:"building file path"`
Name string `short:"n" name:"name" brief:"output binary name"`
Version string `short:"v" name:"version" brief:"output binary version"`
Arch string `short:"a" name:"arch" brief:"output binary architecture, multiple arch separated with ','"`
System string `short:"s" name:"system" brief:"output binary system, multiple os separated with ','"`
Output string `short:"o" name:"output" brief:"output binary path, used when building single binary file"`
Path string `short:"p" name:"path" brief:"output binary directory path, default is '.'" d:"."`
Extra string `short:"e" name:"extra" brief:"extra custom \"go build\" options"`
Mod string `short:"m" name:"mod" brief:"like \"-mod\" option of \"go build\", use \"-m none\" to disable go module"`
Cgo bool `short:"c" name:"cgo" brief:"enable or disable cgo feature, it's disabled in default" orphan:"true"`
VarMap g.Map `short:"r" name:"varMap" brief:"custom built embedded variable into binary"`
PackSrc string `short:"ps" name:"packSrc" brief:"pack one or more folders into one go file before building"`
PackDst string `short:"pd" name:"packDst" brief:"temporary go file path for pack, this go file will be automatically removed after built" d:"internal/packed/build_pack_data.go"`
ExitWhenError bool `short:"ew" name:"exitWhenError" brief:"exit building when any error occurs, specially for multiple arch and system buildings. default is false" orphan:"true"`
DumpENV bool `short:"de" name:"dumpEnv" brief:"dump current go build environment before building binary" orphan:"true"`
}
type cBuildOutput struct{}
func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, err error) {
mlog.SetHeaderPrint(true)
mlog.Debugf(`build command input: %+v`, in)
// Necessary check.
if gproc.SearchBinary("go") == "" {
mlog.Fatalf(`command "go" not found in your environment, please install golang first to proceed this command`)
}
var (
parser = gcmd.ParserFromCtx(ctx)
file = in.File
)
if file == "" {
file = parser.GetArg(2).String()
// Check and use the main.go file.
if gfile.Exists(cBuildDefaultFile) {
file = cBuildDefaultFile
} else {
mlog.Fatal("build file path is empty or main.go not found in current working directory")
}
}
if in.Name == "" {
in.Name = gfile.Name(file)
}
if len(in.Name) < 1 || in.Name == "*" {
mlog.Fatal("name cannot be empty")
}
if in.Mod != "" && in.Mod != "none" {
mlog.Debugf(`mod is %s`, in.Mod)
if in.Extra == "" {
in.Extra = fmt.Sprintf(`-mod=%s`, in.Mod)
} else {
in.Extra = fmt.Sprintf(`-mod=%s %s`, in.Mod, in.Extra)
}
}
if in.Extra != "" {
in.Extra += " "
}
var (
customSystems = gstr.SplitAndTrim(in.System, ",")
customArches = gstr.SplitAndTrim(in.Arch, ",")
)
if len(in.Version) > 0 {
in.Path += "/" + in.Version
}
// System and arch checks.
var (
spaceRegex = regexp.MustCompile(`\s+`)
platformMap = make(map[string]map[string]bool)
)
for _, line := range strings.Split(strings.TrimSpace(cBuildPlatforms), "\n") {
line = gstr.Trim(line)
line = spaceRegex.ReplaceAllString(line, " ")
var (
array = strings.Split(line, " ")
system = strings.TrimSpace(array[0])
arch = strings.TrimSpace(array[1])
)
if platformMap[system] == nil {
platformMap[system] = make(map[string]bool)
}
platformMap[system][arch] = true
}
// Auto packing.
if in.PackSrc != "" {
if in.PackDst == "" {
mlog.Fatal(`parameter "packDst" should not be empty when "packSrc" is used`)
}
if gfile.Exists(in.PackDst) && !gfile.IsFile(in.PackDst) {
mlog.Fatalf(`parameter "packDst" path "%s" should be type of file not directory`, in.PackDst)
}
if !gfile.Exists(in.PackDst) {
// Remove the go file that is automatically packed resource.
defer func() {
_ = gfile.RemoveFile(in.PackDst)
mlog.Printf(`remove the automatically generated resource go file: %s`, in.PackDst)
}()
}
// remove black space in separator.
in.PackSrc, _ = gregex.ReplaceString(`,\s+`, `,`, in.PackSrc)
packCmd := fmt.Sprintf(`gf pack %s %s --keepPath=true`, in.PackSrc, in.PackDst)
mlog.Print(packCmd)
gproc.MustShellRun(ctx, packCmd)
}
// Injected information by building flags.
ldFlags := fmt.Sprintf(
`-X 'github.com/gogf/gf/v2/os/gbuild.builtInVarStr=%v'`,
c.getBuildInVarStr(ctx, in),
)
// start building
mlog.Print("start building...")
if in.Cgo {
genv.MustSet("CGO_ENABLED", "1")
} else {
genv.MustSet("CGO_ENABLED", "0")
}
// print used go env
if in.DumpENV {
_, _ = Env.Index(ctx, cEnvInput{})
}
for system, item := range platformMap {
if len(customSystems) > 0 && customSystems[0] != "all" && !gstr.InArray(customSystems, system) {
continue
}
for arch := range item {
if len(customArches) > 0 && customArches[0] != "all" && !gstr.InArray(customArches, arch) {
continue
}
if len(customSystems) == 0 && len(customArches) == 0 {
// Single binary building, output the binary to current working folder.
// For example:
// `gf build`
// `gf build -o main.exe`
c.doBinaryBuild(
ctx, file,
in.Output, in.Path,
runtime.GOOS, runtime.GOARCH, in.Name, ldFlags, in.Extra,
in.ExitWhenError,
true,
)
} else {
c.doBinaryBuild(
ctx, file,
in.Output, in.Path,
system, arch, in.Name, ldFlags, in.Extra,
in.ExitWhenError,
false,
)
}
// single binary building.
if len(customSystems) == 0 && len(customArches) == 0 {
goto buildDone
}
}
}
buildDone:
mlog.Print("done!")
return
}
func (c cBuild) doBinaryBuild(
ctx context.Context,
filePath string,
outputPath, dirPath string,
system, arch, name, ldFlags, extra string,
exitWhenError bool,
singleBuild bool,
) {
var (
cmd string
ext string
)
// Cross-building, output the compiled binary to specified path.
if system == "windows" {
ext = ".exe"
}
genv.MustSet("GOOS", system)
genv.MustSet("GOARCH", arch)
if outputPath != "" {
outputPath = "-o " + outputPath
} else {
if dirPath == "" {
dirPath = "."
} else {
dirPath = gstr.TrimRight(dirPath, "/")
}
if singleBuild {
outputPath = fmt.Sprintf(
"-o %s/%s%s",
dirPath, name, ext,
)
} else {
outputPath = fmt.Sprintf(
"-o %s/%s/%s%s",
dirPath, system+"_"+arch, name, ext,
)
}
}
cmd = fmt.Sprintf(
`go build %s -ldflags "%s" %s%s`,
outputPath, ldFlags, extra, filePath,
)
mlog.Debug(fmt.Sprintf("build for GOOS=%s GOARCH=%s", system, arch))
mlog.Debug(cmd)
// It's not necessary printing the complete command string, filtering ldFlags.
cmdShow, _ := gregex.ReplaceString(`\s+(-ldflags ".+?")\s+`, " ", cmd)
mlog.Print(cmdShow)
if result, err := gproc.ShellExec(ctx, cmd); err != nil {
mlog.Printf(
"failed to build, os:%s, arch:%s, error:\n%s\n\n%s\n",
system, arch, gstr.Trim(result),
`you may use command option "--debug" to enable debug info and check the details`,
)
if exitWhenError {
os.Exit(1)
}
} else {
mlog.Debug(gstr.Trim(result))
}
}
// getBuildInVarStr retrieves and returns the custom build-in variables in configuration
// file as json.
func (c cBuild) getBuildInVarStr(ctx context.Context, in cBuildInput) string {
buildInVarMap := in.VarMap
if buildInVarMap == nil {
buildInVarMap = make(g.Map)
}
buildInVarMap[gbuild.BuiltGit] = c.getGitCommit(ctx)
buildInVarMap[gbuild.BuiltTime] = gtime.Now().String()
buildInVarMap[gbuild.BuiltVersion] = in.Version
b, err := json.Marshal(buildInVarMap)
if err != nil {
mlog.Fatal(err)
}
return gbase64.EncodeToString(b)
}
// getGitCommit retrieves and returns the latest git commit hash string if present.
func (c cBuild) getGitCommit(ctx context.Context) string {
if gproc.SearchBinary("git") == "" {
return ""
}
var (
cmd = `git log -1 --format="%cd %H" --date=format:"%Y-%m-%d %H:%M:%S"`
s, _ = gproc.ShellExec(ctx, cmd)
)
mlog.Debug(cmd)
if s != "" {
if !gstr.Contains(s, "fatal") {
return gstr.Trim(s)
}
}
return ""
}

View File

@ -0,0 +1,575 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"embed"
"fmt"
"io/fs"
"net/http"
"os/exec"
"runtime"
"strconv"
"strings"
"time"
"gopkg.in/yaml.v3"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/database/gredis"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gyaml"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gcfg"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/glog"
"github.com/gogf/gf/v2/os/gview"
"github.com/gogf/gf/v2/util/gvalid"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
//go:embed resources/i18n/*.yaml
var i18nFS embed.FS
//go:embed resources/templates/index.html
var configEditorHTML string
//go:embed resources/static/*
var staticFS embed.FS
var (
// CfgEditor is the management object for `gf config` command.
CfgEditor = cCfgEditor{}
)
type cCfgEditor struct {
g.Meta `name:"config" brief:"start the configuration visual editor"`
}
type cCfgEditorInput struct {
g.Meta `name:"config" config:"gfcli.config"`
Port int `short:"p" name:"port" brief:"web server port" d:"8888"`
File string `short:"f" name:"file" brief:"configuration file path"`
}
type cCfgEditorOutput struct{}
func init() {
registerAllSchemas()
}
// registerAllSchemas registers configuration schemas for the five core modules.
func registerAllSchemas() {
// Server
gcfg.RegisterSchema("server", "server", ghttp.ServerConfig{}, map[string]string{
"Name": "Basic", "Address": "Basic", "HTTPSAddr": "Basic",
"HTTPSCertPath": "Basic", "HTTPSKeyPath": "Basic",
"ReadTimeout": "Basic", "WriteTimeout": "Basic", "IdleTimeout": "Basic",
"MaxHeaderBytes": "Basic", "KeepAlive": "Basic", "ServerAgent": "Basic",
"IndexFolder": "Static", "ServerRoot": "Static", "FileServerEnabled": "Static",
"CookieMaxAge": "Cookie", "CookiePath": "Cookie", "CookieDomain": "Cookie",
"CookieSameSite": "Cookie", "CookieSecure": "Cookie", "CookieHttpOnly": "Cookie",
"SessionIdName": "Session", "SessionMaxAge": "Session", "SessionPath": "Session",
"SessionCookieMaxAge": "Session", "SessionCookieOutput": "Session",
"LogPath": "Logging", "LogLevel": "Logging", "LogStdout": "Logging",
"ErrorStack": "Logging", "ErrorLogEnabled": "Logging", "ErrorLogPattern": "Logging",
"AccessLogEnabled": "Logging", "AccessLogPattern": "Logging",
"PProfEnabled": "PProf", "PProfPattern": "PProf",
"OpenApiPath": "API", "SwaggerPath": "API", "SwaggerUITemplate": "API",
"Graceful": "Graceful", "GracefulTimeout": "Graceful", "GracefulShutdownTimeout": "Graceful",
"ClientMaxBodySize": "Other", "FormParsingMemory": "Other",
"NameToUriType": "Other", "RouteOverWrite": "Other", "DumpRouterMap": "Other",
"Endpoints": "Other", "Rewrites": "Other", "IndexFiles": "Other", "SearchPaths": "Other",
"StaticPaths": "Other", "Listeners": "Other",
})
// Database
gcfg.RegisterSchema("database", "database", gdb.ConfigNode{}, map[string]string{
"Host": "Connection", "Port": "Connection", "User": "Connection",
"Pass": "Connection", "Name": "Connection", "Type": "Connection",
"Link": "Connection", "Extra": "Connection", "Protocol": "Connection",
"Charset": "Connection", "Timezone": "Connection", "Namespace": "Connection",
"MaxIdleConnCount": "Pool", "MaxOpenConnCount": "Pool",
"MaxConnLifeTime": "Pool", "MaxIdleConnTime": "Pool",
"Role": "Role", "Debug": "Role", "Prefix": "Role", "DryRun": "Role", "Weight": "Role",
"QueryTimeout": "Timeout", "ExecTimeout": "Timeout",
"TranTimeout": "Timeout", "PrepareTimeout": "Timeout",
"CreatedAt": "AutoTimestamp", "UpdatedAt": "AutoTimestamp",
"DeletedAt": "AutoTimestamp", "TimeMaintainDisabled": "AutoTimestamp",
})
// Redis
gcfg.RegisterSchema("redis", "redis", gredis.Config{}, map[string]string{
"Address": "Connection", "Db": "Connection", "User": "Connection",
"Pass": "Connection", "Protocol": "Connection",
"MinIdle": "Pool", "MaxIdle": "Pool", "MaxActive": "Pool",
"MaxConnLifetime": "Pool", "IdleTimeout": "Pool", "WaitTimeout": "Pool",
"DialTimeout": "Timeout", "ReadTimeout": "Timeout", "WriteTimeout": "Timeout",
"MasterName": "Sentinel", "SentinelUser": "Sentinel", "SentinelPass": "Sentinel",
"TLS": "Security", "TLSSkipVerify": "Security",
"SlaveOnly": "Security", "Cluster": "Security",
})
// Logger
gcfg.RegisterSchema("logger", "logger", glog.Config{}, map[string]string{
"Flags": "Basic", "TimeFormat": "Basic", "Path": "Basic",
"File": "Basic", "Level": "Basic", "Prefix": "Basic",
"HeaderPrint": "Output", "StdoutPrint": "Output", "LevelPrint": "Output",
"StdoutColorDisabled": "Output", "WriterColorEnable": "Output",
"StSkip": "Stack", "StStatus": "Stack", "StFilter": "Stack",
"RotateSize": "Rotate", "RotateExpire": "Rotate",
"RotateBackupLimit": "Rotate", "RotateBackupExpire": "Rotate",
"RotateBackupCompress": "Rotate", "RotateCheckInterval": "Rotate",
})
// Viewer
gcfg.RegisterSchema("viewer", "viewer", gview.Config{}, map[string]string{
"Paths": "Basic", "Data": "Basic", "DefaultFile": "Basic",
"Delimiters": "Basic", "AutoEncode": "Basic",
})
}
// Index starts the config editor web server.
func (c cCfgEditor) Index(ctx context.Context, in cCfgEditorInput) (out *cCfgEditorOutput, err error) {
mlog.Printf("[ConfigEditor] Starting with port=%d, file=%q", in.Port, in.File)
// Verify embedded i18n files are accessible.
for _, lang := range []string{"en", "zh-CN"} {
path := "resources/i18n/" + lang + ".yaml"
if data, e := i18nFS.ReadFile(path); e != nil {
mlog.Printf("[ConfigEditor] WARNING: embedded i18n file %q not found: %v", path, e)
} else {
mlog.Printf("[ConfigEditor] Embedded i18n file %q loaded, size=%d bytes", path, len(data))
}
}
s := g.Server("gf-config-editor")
s.SetPort(in.Port)
s.SetDumpRouterMap(false)
// API endpoints.
s.Group("/api", func(group *ghttp.RouterGroup) {
group.GET("/schemas", apiGetSchemas)
group.GET("/config", apiGetConfig(in.File))
group.POST("/config/validate", apiValidateConfig)
group.POST("/config/save", apiSaveConfig)
group.GET("/i18n/:lang", apiGetI18n)
})
// Serve embedded static files.
s.BindHandler("/static/*", func(r *ghttp.Request) {
filePath := strings.TrimPrefix(r.URL.Path, "/static/")
data, err := fs.ReadFile(staticFS, "resources/static/"+filePath)
if err != nil {
r.Response.WriteStatus(http.StatusNotFound)
return
}
if strings.HasSuffix(filePath, ".js") {
r.Response.Header().Set("Content-Type", "application/javascript; charset=utf-8")
} else if strings.HasSuffix(filePath, ".css") {
r.Response.Header().Set("Content-Type", "text/css; charset=utf-8")
}
r.Response.Header().Set("Cache-Control", "public, max-age=86400")
r.Response.Write(data)
})
// Serve the embedded UI.
s.BindHandler("/", func(r *ghttp.Request) {
r.Response.WriteHeader(http.StatusOK)
r.Response.Header().Set("Content-Type", "text/html; charset=utf-8")
r.Response.Write(configEditorHTML)
})
addr := fmt.Sprintf("http://127.0.0.1:%d", in.Port)
mlog.Printf("[ConfigEditor] GoFrame Config Editor starting at %s", addr)
go func() {
time.Sleep(500 * time.Millisecond)
if err := openBrowser(addr); err != nil {
mlog.Printf("[ConfigEditor] WARNING: failed to open browser: %v", err)
}
}()
s.Run()
return
}
// apiGetSchemas returns all registered module schemas.
func apiGetSchemas(r *ghttp.Request) {
schemas := gcfg.GetAllSchemas()
r.Response.WriteJsonExit(g.Map{
"code": 0,
"data": schemas,
})
}
// apiGetConfig returns the current configuration values.
func apiGetConfig(file string) func(r *ghttp.Request) {
return func(r *ghttp.Request) {
configFile := file
if configFile == "" {
searchPaths := []string{
"config.yaml", "config.yml", "config.toml", "config.json",
"config/config.yaml", "config/config.yml",
"config/config.toml", "config/config.json",
"manifest/config/config.yaml", "manifest/config/config.yml",
"manifest/config/config.toml", "manifest/config/config.json",
"app.yaml", "app.yml",
}
for _, name := range searchPaths {
if gfile.Exists(name) {
configFile = name
break
}
}
}
data := g.Map{}
filePath := ""
fileType := ""
if configFile != "" && gfile.Exists(configFile) {
filePath = gfile.RealPath(configFile)
fileType = gfile.ExtName(configFile)
content := gfile.GetBytes(configFile)
j, err := gjson.LoadContent(content)
if err != nil {
r.Response.WriteJsonExit(g.Map{
"code": 1,
"message": fmt.Sprintf("Failed to parse config file %q: %v", filePath, err),
})
return
}
data = j.Map()
}
r.Response.WriteJsonExit(g.Map{
"code": 0,
"data": g.Map{
"config": data,
"filePath": filePath,
"fileType": fileType,
},
})
}
}
// apiValidateConfig validates configuration values using gvalid.
func apiValidateConfig(r *ghttp.Request) {
var reqData struct {
Module string `json:"module"`
Values map[string]any `json:"values"`
}
if err := r.Parse(&reqData); err != nil {
r.Response.WriteJsonExit(g.Map{"code": 1, "message": err.Error()})
return
}
schema, ok := gcfg.GetSchema(reqData.Module)
if !ok {
r.Response.WriteJsonExit(g.Map{"code": 1, "message": fmt.Sprintf("module %q not found", reqData.Module)})
return
}
// Build validation rules from schema fields.
var rules []string
for _, field := range schema.Fields {
if field.Rule == "" {
continue
}
rule := field.JsonKey + "|" + field.Rule
rules = append(rules, rule)
}
if len(rules) > 0 {
if err := gvalid.New().Data(reqData.Values).Rules(rules).Run(r.Context()); err != nil {
// Parse validation errors into field-level messages.
validationErrors := make(map[string]string)
if vErr, ok := err.(gvalid.Error); ok {
for _, item := range vErr.Items() {
for field, ruleErrMap := range item {
for _, ruleErr := range ruleErrMap {
validationErrors[field] = ruleErr.Error()
break
}
}
}
} else {
validationErrors["_general"] = err.Error()
}
r.Response.WriteJsonExit(g.Map{
"code": 1,
"message": "Validation failed",
"errors": validationErrors,
})
return
}
}
r.Response.WriteJsonExit(g.Map{
"code": 0,
"message": "Valid",
})
}
// apiSaveConfig saves configuration to file.
func apiSaveConfig(r *ghttp.Request) {
var reqData struct {
Config map[string]any `json:"config"`
FilePath string `json:"filePath"`
FileType string `json:"fileType"`
}
if err := r.Parse(&reqData); err != nil {
r.Response.WriteJsonExit(g.Map{"code": 1, "message": err.Error()})
return
}
if reqData.FilePath == "" {
reqData.FilePath = "config.yaml"
reqData.FileType = "yaml"
}
var err error
switch reqData.FileType {
case "yaml", "yml":
err = saveYAMLPreservingComments(reqData.FilePath, reqData.Config)
default:
j := gjson.New(reqData.Config)
var content string
switch reqData.FileType {
case "toml":
content, err = j.ToTomlString()
case "json":
content, err = j.ToJsonIndentString()
case "ini":
content, err = j.ToIniString()
default:
content, err = j.ToYamlString()
}
if err == nil {
err = gfile.PutContents(reqData.FilePath, content)
}
}
if err != nil {
r.Response.WriteJsonExit(g.Map{"code": 1, "message": err.Error()})
return
}
r.Response.WriteJsonExit(g.Map{
"code": 0,
"message": "Configuration saved successfully",
"data": g.Map{
"filePath": gfile.RealPath(reqData.FilePath),
},
})
}
// saveYAMLPreservingComments writes the config map to a YAML file while preserving
// any existing comments in the file.
func saveYAMLPreservingComments(filePath string, newConfig map[string]any) error {
var (
docNode yaml.Node
indent = 2
)
if gfile.Exists(filePath) {
content := gfile.GetBytes(filePath)
indent = detectYAMLIndent(content)
if err := yaml.Unmarshal(content, &docNode); err != nil {
docNode = yaml.Node{}
}
}
if docNode.Kind == 0 {
docNode = yaml.Node{Kind: yaml.DocumentNode}
docNode.Content = []*yaml.Node{{Kind: yaml.MappingNode, Tag: "!!map"}}
} else if docNode.Kind == yaml.DocumentNode {
if len(docNode.Content) == 0 {
docNode.Content = []*yaml.Node{{Kind: yaml.MappingNode, Tag: "!!map"}}
} else if docNode.Content[0].Kind != yaml.MappingNode {
docNode.Content = []*yaml.Node{{Kind: yaml.MappingNode, Tag: "!!map"}}
}
}
applyMapToYAMLNode(docNode.Content[0], newConfig)
var buf strings.Builder
enc := yaml.NewEncoder(&buf)
enc.SetIndent(indent)
if err := enc.Encode(&docNode); err != nil {
return err
}
_ = enc.Close()
return gfile.PutContents(filePath, buf.String())
}
// detectYAMLIndent returns the number of spaces used for indentation in the YAML content.
func detectYAMLIndent(content []byte) int {
for _, line := range strings.Split(string(content), "\n") {
trimmed := strings.TrimLeft(line, " ")
if len(trimmed) == 0 || strings.HasPrefix(trimmed, "#") {
continue
}
spaces := len(line) - len(trimmed)
if spaces > 0 {
return spaces
}
}
return 2
}
// applyMapToYAMLNode recursively merges updates into an existing yaml.MappingNode,
// preserving comments and formatting style on nodes that already exist.
func applyMapToYAMLNode(mappingNode *yaml.Node, updates map[string]any) {
if mappingNode.Kind != yaml.MappingNode {
return
}
keyIndex := make(map[string]int)
for i := 0; i < len(mappingNode.Content)-1; i += 2 {
keyIndex[mappingNode.Content[i].Value] = i + 1
}
for key, value := range updates {
valIdx, exists := keyIndex[key]
if !exists {
keyNode := &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!str", Value: key}
valNode := anyToYAMLNode(value)
mappingNode.Content = append(mappingNode.Content, keyNode, valNode)
keyIndex[key] = len(mappingNode.Content) - 1
} else {
existingVal := mappingNode.Content[valIdx]
updateYAMLNodeInPlace(existingVal, value)
}
}
}
// updateYAMLNodeInPlace updates the yaml.Node in place to reflect newValue
// while maximally preserving the original formatting style and comments.
func updateYAMLNodeInPlace(node *yaml.Node, newValue any) {
head, line, foot := node.HeadComment, node.LineComment, node.FootComment
switch v := newValue.(type) {
case map[string]any:
if node.Kind == yaml.MappingNode {
applyMapToYAMLNode(node, v)
return
}
*node = *anyToYAMLNode(v)
case []any:
if node.Kind == yaml.SequenceNode {
style := node.Style
newSeq := anyToYAMLNode(v)
*node = *newSeq
node.Style = style
} else {
*node = *anyToYAMLNode(v)
}
default:
newNode := anyToYAMLNode(v)
if node.Kind == yaml.ScalarNode && newNode.Kind == yaml.ScalarNode {
node.Value = newNode.Value
node.Tag = newNode.Tag
} else {
*node = *newNode
}
}
node.HeadComment, node.LineComment, node.FootComment = head, line, foot
}
// anyToYAMLNode converts a Go value to a yaml.Node.
func anyToYAMLNode(v any) *yaml.Node {
if v == nil {
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!null", Value: "null"}
}
switch val := v.(type) {
case map[string]any:
node := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"}
for k, vv := range val {
keyNode := &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!str", Value: k}
valNode := anyToYAMLNode(vv)
node.Content = append(node.Content, keyNode, valNode)
}
return node
case []any:
node := &yaml.Node{Kind: yaml.SequenceNode, Tag: "!!seq"}
for _, item := range val {
node.Content = append(node.Content, anyToYAMLNode(item))
}
return node
case bool:
s := "false"
if val {
s = "true"
}
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!bool", Value: s}
case int:
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!int", Value: strconv.Itoa(val)}
case int64:
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!int", Value: strconv.FormatInt(val, 10)}
case float64:
s := strconv.FormatFloat(val, 'f', -1, 64)
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!float", Value: s}
case string:
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!str", Value: val}
default:
return &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!str", Value: fmt.Sprintf("%v", v)}
}
}
// apiGetI18n returns i18n translations for the given language.
func apiGetI18n(r *ghttp.Request) {
lang := r.Get("lang").String()
if lang == "" {
lang = "en"
}
fileName := lang + ".yaml"
filePath := "resources/i18n/" + fileName
content, err := i18nFS.ReadFile(filePath)
if err != nil {
r.Response.WriteJsonExit(g.Map{
"code": 0,
"data": g.Map{},
})
return
}
var translations map[string]string
if err = gyaml.DecodeTo(content, &translations); err != nil {
r.Response.WriteJsonExit(g.Map{
"code": 0,
"data": g.Map{},
})
return
}
r.Response.WriteJsonExit(g.Map{
"code": 0,
"data": translations,
})
}
// openBrowser opens the default browser to the given URL.
func openBrowser(url string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "darwin":
cmd = exec.Command("open", url)
case "windows":
cmd = exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
default:
cmd = exec.Command("xdg-open", url)
}
return cmd.Start()
}

View File

@ -0,0 +1,184 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"fmt"
"io"
"net/http"
"os"
"path"
"path/filepath"
"time"
"github.com/gogf/gf/v2/encoding/gcompress"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
const (
GitName = "gf-site"
BranchName = "gh-pages"
SiteFileName = GitName + "-" + BranchName
// DocURL is the download address of the document
DocURL = "https://github.com/gogf/" + GitName + "/archive/refs/heads/" + BranchName + ".zip"
)
var (
Doc = cDoc{}
)
type cDoc struct {
g.Meta `name:"doc" brief:"download https://pages.goframe.org/ to run locally"`
}
type cDocInput struct {
g.Meta `name:"doc" config:"gfcli.doc"`
Path string `short:"p" name:"path" brief:"download docs directory path, default is \"%temp%/goframe\""`
Port int `short:"o" name:"port" brief:"http server port, default is 8080" d:"8080"`
Update bool `short:"u" name:"update" brief:"clean docs directory and update docs"`
Clean bool `short:"c" name:"clean" brief:"clean docs directory"`
Proxy string `short:"x" name:"proxy" brief:"proxy for download, such as https://hub.gitmirror.com/;https://ghproxy.com/;https://ghproxy.net/;https://ghps.cc/"`
}
type cDocOutput struct{}
func (c cDoc) Index(ctx context.Context, in cDocInput) (out *cDocOutput, err error) {
docs := NewDocSetting(ctx, in)
mlog.Print("Directory where the document is downloaded:", docs.TempDir)
if in.Clean {
mlog.Print("Cleaning document directory")
err = docs.Clean()
if err != nil {
mlog.Print("Failed to clean document directory:", err)
return
}
return
}
if in.Update {
mlog.Print("Cleaning old document directory")
err = docs.Clean()
if err != nil {
mlog.Print("Failed to clean old document directory:", err)
return
}
}
err = docs.DownloadDoc()
if err != nil {
mlog.Print("Failed to download document:", err)
return
}
http.Handle("/", http.FileServer(http.Dir(docs.DocDir)))
mlog.Printf("Access address http://127.0.0.1:%d in %s", in.Port, docs.DocDir)
err = http.ListenAndServe(fmt.Sprintf(":%d", in.Port), nil)
if err != nil {
return nil, err
}
return
}
// DocSetting doc setting
type DocSetting struct {
TempDir string
DocURL string
DocDir string
DocZipFile string
}
// NewDocSetting new DocSetting
func NewDocSetting(ctx context.Context, in cDocInput) *DocSetting {
fileName := SiteFileName + ".zip"
tempDir := in.Path
if tempDir == "" {
tempDir = gfile.Temp("goframe/docs")
} else {
tempDir = gfile.Abs(path.Join(tempDir, "docs"))
}
return &DocSetting{
TempDir: filepath.FromSlash(tempDir),
DocDir: filepath.FromSlash(path.Join(tempDir, SiteFileName)),
DocURL: in.Proxy + DocURL,
DocZipFile: filepath.FromSlash(path.Join(tempDir, fileName)),
}
}
// Clean cleans the temporary directory
func (d *DocSetting) Clean() error {
if _, err := os.Stat(d.TempDir); err == nil {
err = gfile.RemoveAll(d.TempDir)
if err != nil {
mlog.Print("Failed to delete temporary directory:", err)
return err
}
}
return nil
}
// DownloadDoc download the document
func (d *DocSetting) DownloadDoc() error {
if _, err := os.Stat(d.TempDir); err != nil {
err = gfile.Mkdir(d.TempDir)
if err != nil {
mlog.Print("Failed to create temporary directory:", err)
return nil
}
}
// Check if the file exists
if _, err := os.Stat(d.DocDir); err == nil {
mlog.Print("Document already exists, no need to download and unzip")
return nil
}
if _, err := os.Stat(d.DocZipFile); err == nil {
mlog.Print("File already exists, no need to download")
} else {
mlog.Printf("File does not exist, start downloading: %s", d.DocURL)
startTime := time.Now()
// Download the file
resp, err := http.Get(d.DocURL)
if err != nil {
mlog.Print("Failed to download file:", err)
return err
}
defer resp.Body.Close()
// Create the file
out, err := os.Create(d.DocZipFile)
if err != nil {
mlog.Print("Failed to create file:", err)
return err
}
defer out.Close()
// Write the response body to the file
_, err = io.Copy(out, resp.Body)
if err != nil {
mlog.Print("Failed to write file:", err)
return err
}
mlog.Printf("Download successful, time-consuming: %v", time.Since(startTime))
}
mlog.Print("Start unzipping the file...")
// Unzip the file
err := gcompress.UnZipFile(d.DocZipFile, d.TempDir)
if err != nil {
mlog.Print("Failed to unzip the file, please run again:", err)
_ = gfile.RemoveFile(d.DocZipFile)
return err
}
mlog.Print("Download and unzip successful")
return nil
}

View File

@ -0,0 +1,179 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"fmt"
"runtime"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gproc"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gtag"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
var (
Docker = cDocker{}
)
type cDocker struct {
g.Meta `name:"docker" usage:"{cDockerUsage}" brief:"{cDockerBrief}" eg:"{cDockerEg}" dc:"{cDockerDc}"`
}
const (
cDockerUsage = `gf docker [MAIN] [OPTION]`
cDockerBrief = `build docker image for current GoFrame project`
cDockerEg = `
gf docker
gf docker -t hub.docker.com/john/image:tag
gf docker -p -t hub.docker.com/john/image:tag
gf docker main.go
gf docker main.go -t hub.docker.com/john/image:tag
gf docker main.go -t hub.docker.com/john/image:tag
gf docker main.go -p -t hub.docker.com/john/image:tag
gf docker main.go -p -tp ["hub.docker.com/john","hub.docker.com/smith"] -tn image:tag
`
cDockerDc = `
The "docker" command builds the GF project to a docker images.
It runs "gf build" firstly to compile the project to binary file.
It then runs "docker build" command automatically to generate the docker image.
You should have docker installed, and there must be a Dockerfile in the root of the project.
`
cDockerMainBrief = `main file path for "gf build", it's "main.go" in default. empty string for no binary build`
cDockerBuildBrief = `binary build options before docker image build, it's "-a amd64 -s linux" in default`
cDockerFileBrief = `file path of the Dockerfile. it's "manifest/docker/Dockerfile" in default`
cDockerShellBrief = `path of the shell file which is executed before docker build`
cDockerPushBrief = `auto push the docker image to docker registry if "-t" option passed`
cDockerTagBrief = `full tag for this docker, pattern like "xxx.xxx.xxx/image:tag"`
cDockerTagNameBrief = `tag name for this docker, pattern like "image:tag". this option is required with TagPrefixes`
cDockerTagPrefixesBrief = `tag prefixes for this docker, which are used for docker push. this option is required with TagName`
cDockerExtraBrief = `extra build options passed to "docker image"`
)
func init() {
gtag.Sets(g.MapStrStr{
`cDockerUsage`: cDockerUsage,
`cDockerBrief`: cDockerBrief,
`cDockerEg`: cDockerEg,
`cDockerDc`: cDockerDc,
`cDockerMainBrief`: cDockerMainBrief,
`cDockerFileBrief`: cDockerFileBrief,
`cDockerShellBrief`: cDockerShellBrief,
`cDockerBuildBrief`: cDockerBuildBrief,
`cDockerPushBrief`: cDockerPushBrief,
`cDockerTagBrief`: cDockerTagBrief,
`cDockerTagNameBrief`: cDockerTagNameBrief,
`cDockerTagPrefixesBrief`: cDockerTagPrefixesBrief,
`cDockerExtraBrief`: cDockerExtraBrief,
})
}
type cDockerInput struct {
g.Meta `name:"docker" config:"gfcli.docker"`
Main string `name:"MAIN" arg:"true" brief:"{cDockerMainBrief}" d:"main.go"`
File string `name:"file" short:"f" brief:"{cDockerFileBrief}" d:"manifest/docker/Dockerfile"`
Shell string `name:"shell" short:"s" brief:"{cDockerShellBrief}" d:"manifest/docker/docker.sh"`
Build string `name:"build" short:"b" brief:"{cDockerBuildBrief}"`
Tag string `name:"tag" short:"t" brief:"{cDockerTagBrief}"`
TagName string `name:"tagName" short:"tn" brief:"{cDockerTagNameBrief}" v:"required-with:TagPrefixes"`
TagPrefixes []string `name:"tagPrefixes" short:"tp" brief:"{cDockerTagPrefixesBrief}" v:"required-with:TagName"`
Push bool `name:"push" short:"p" brief:"{cDockerPushBrief}" orphan:"true"`
Extra string `name:"extra" short:"e" brief:"{cDockerExtraBrief}"`
}
type cDockerOutput struct{}
func (c cDocker) Index(ctx context.Context, in cDockerInput) (out *cDockerOutput, err error) {
// Necessary check.
if gproc.SearchBinary("docker") == "" {
mlog.Fatalf(`command "docker" not found in your environment, please install docker first to proceed this command`)
}
mlog.Debugf(`docker command input: %+v`, in)
// Binary build.
if in.Main != "" && in.Build != "" {
in.Build += " --exitWhenError"
if in.Main != "" {
if err = gproc.ShellRun(ctx, fmt.Sprintf(`gf build %s %s`, in.Main, in.Build)); err != nil {
mlog.Debugf(`build binary failed with error: %+v`, err)
return
}
}
}
// Shell executing.
if in.Shell != "" && gfile.Exists(in.Shell) {
if err = c.exeDockerShell(ctx, in.Shell); err != nil {
mlog.Debugf(`build docker failed with error: %+v`, err)
return
}
}
// Docker build.
var (
dockerBuildOptions string
dockerTags []string
dockerTagBase string
)
if len(in.TagPrefixes) > 0 {
for _, tagPrefix := range in.TagPrefixes {
tagPrefix = gstr.TrimRight(tagPrefix, "/")
dockerTags = append(dockerTags, fmt.Sprintf(`%s/%s`, tagPrefix, in.TagName))
}
}
if len(dockerTags) == 0 {
dockerTags = []string{in.Tag}
}
for i, dockerTag := range dockerTags {
if i > 0 {
err = gproc.ShellRun(ctx, fmt.Sprintf(`docker tag %s %s`, dockerTagBase, dockerTag))
if err != nil {
return
}
continue
}
dockerTagBase = dockerTag
dockerBuildOptions = ""
if dockerTag != "" {
dockerBuildOptions = fmt.Sprintf(`-t %s`, dockerTag)
}
if in.Extra != "" {
dockerBuildOptions = fmt.Sprintf(`%s %s`, dockerBuildOptions, in.Extra)
}
err = gproc.ShellRun(ctx, fmt.Sprintf(`docker build -f %s . %s`, in.File, dockerBuildOptions))
if err != nil {
return
}
}
// Docker push.
if !in.Push {
return
}
for _, dockerTag := range dockerTags {
if dockerTag == "" {
continue
}
err = gproc.ShellRun(ctx, fmt.Sprintf(`docker push %s`, dockerTag))
if err != nil {
return
}
}
return
}
func (c cDocker) exeDockerShell(ctx context.Context, shellFilePath string) error {
if gfile.ExtName(shellFilePath) == "sh" && runtime.GOOS == "windows" {
mlog.Debugf(`ignore shell file "%s", as it cannot be run on windows system`, shellFilePath)
return nil
}
return gproc.ShellRun(ctx, gfile.GetContents(shellFilePath))
}

View File

@ -0,0 +1,89 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"bytes"
"context"
"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/renderer"
"github.com/olekukonko/tablewriter/tw"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gproc"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
var (
Env = cEnv{}
)
type cEnv struct {
g.Meta `name:"env" brief:"show current Golang environment variables"`
}
type cEnvInput struct {
g.Meta `name:"env"`
}
type cEnvOutput struct{}
func (c cEnv) Index(ctx context.Context, in cEnvInput) (out *cEnvOutput, err error) {
result, execErr := gproc.ShellExec(ctx, "go env")
// Note: go env may return non-zero exit code when there are warnings (e.g., invalid characters in env vars),
// but it still outputs valid environment variables. So we only fail if result is empty.
if result == "" {
if execErr != nil {
mlog.Fatal(execErr)
}
mlog.Fatal(`retrieving Golang environment variables failed, did you install Golang?`)
}
var (
lines = gstr.Split(result, "\n")
buffer = bytes.NewBuffer(nil)
)
array := make([][]string, 0)
for _, line := range lines {
line = gstr.Trim(line)
if line == "" {
continue
}
if gstr.Pos(line, "set ") == 0 {
line = line[4:]
}
match, _ := gregex.MatchString(`(.+?)=(.*)`, line)
if len(match) < 3 {
// Skip lines that don't match key=value format (e.g., warning messages from go env)
mlog.Debugf(`invalid Golang environment variable: "%s"`, line)
continue
}
array = append(array, []string{gstr.Trim(match[1]), gstr.Trim(match[2])})
}
table := tablewriter.NewTable(buffer,
tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{
Settings: tw.Settings{
Separators: tw.Separators{BetweenRows: tw.Off, BetweenColumns: tw.On},
},
Symbols: tw.NewSymbols(tw.StyleASCII),
})),
tablewriter.WithConfig(tablewriter.Config{
Row: tw.CellConfig{
Formatting: tw.CellFormatting{AutoWrap: tw.WrapNone},
Alignment: tw.CellAlignment{PerColumn: []tw.Align{tw.AlignLeft, tw.AlignLeft}},
ColMaxWidths: tw.CellWidth{Global: 84},
},
}),
)
table.Bulk(array)
table.Render()
mlog.Print(buffer.String())
return
}

View File

@ -0,0 +1,152 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gproc"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
)
var (
Fix = cFix{}
)
type cFix struct {
g.Meta `name:"fix" brief:"auto fixing codes after upgrading to new GoFrame version" usage:"gf fix" `
}
type cFixInput struct {
g.Meta `name:"fix"`
Path string `name:"path" short:"p" brief:"directory path, it uses current working directory in default"`
Version string `name:"version" short:"v" brief:"custom specified version to fix, leave it empty to auto detect"`
}
type cFixOutput struct{}
type cFixItem struct {
Version string
Func func(version string) error
}
func (c cFix) Index(ctx context.Context, in cFixInput) (out *cFixOutput, err error) {
if in.Path == "" {
in.Path = gfile.Pwd()
}
if in.Version == "" {
in.Version, err = c.autoDetectVersion(in)
if err != nil {
mlog.Fatal(err)
}
if in.Version == "" {
mlog.Print(`no GoFrame usage found, exit fixing`)
return
}
mlog.Debugf(`current GoFrame version auto detect "%s"`, in.Version)
}
if !gproc.IsChild() {
mlog.Printf(`start auto fixing directory path "%s"...`, in.Path)
defer mlog.Print(`done!`)
}
err = c.doFix(in)
return
}
func (c cFix) doFix(in cFixInput) (err error) {
var items = []cFixItem{
{Version: "v2.3", Func: c.doFixV23},
{Version: "v2.5", Func: c.doFixV25},
}
for _, item := range items {
if gstr.CompareVersionGo(in.Version, item.Version) < 0 {
mlog.Debugf(
`current GoFrame or contrib package version "%s" is lesser than "%s", nothing to do`,
in.Version, item.Version,
)
continue
}
if err = item.Func(in.Version); err != nil {
return
}
}
return
}
// doFixV23 fixes code when upgrading to GoFrame v2.3.
func (c cFix) doFixV23(version string) error {
replaceFunc := func(path, content string) string {
// gdb.TX from struct to interface.
content = gstr.Replace(content, "*gdb.TX", "gdb.TX")
// function name changes for package gtcp/gudp.
if gstr.Contains(content, "/gf/v2/net/gtcp") || gstr.Contains(content, "/gf/v2/net/gudp") {
content = gstr.ReplaceByMap(content, g.MapStrStr{
".SetSendDeadline": ".SetDeadlineSend",
".SetReceiveDeadline": ".SetDeadlineRecv",
".SetReceiveBufferWait": ".SetBufferWaitRecv",
})
}
return content
}
return gfile.ReplaceDirFunc(replaceFunc, ".", "*.go", true)
}
// doFixV25 fixes code when upgrading to GoFrame v2.5.
func (c cFix) doFixV25(version string) (err error) {
replaceFunc := func(path, content string) string {
content, err = c.doFixV25Content(content)
return content
}
return gfile.ReplaceDirFunc(replaceFunc, ".", "*.go", true)
}
func (c cFix) doFixV25Content(content string) (newContent string, err error) {
newContent = content
if gstr.Contains(content, `.BindHookHandlerByMap(`) {
var pattern = `\.BindHookHandlerByMap\((.+?), map\[string\]ghttp\.HandlerFunc`
newContent, err = gregex.ReplaceString(
pattern,
`.BindHookHandlerByMap($1, map[ghttp.HookName]ghttp.HandlerFunc`,
content,
)
}
return
}
func (c cFix) autoDetectVersion(in cFixInput) (string, error) {
var (
err error
path = gfile.Join(in.Path, "go.mod")
version string
)
if !gfile.Exists(path) {
return "", gerror.Newf(`"%s" not found in current working directory`, path)
}
err = gfile.ReadLines(path, func(line string) error {
array := gstr.SplitAndTrim(line, " ")
if len(array) > 0 {
if gstr.HasPrefix(array[0], gfPackage) {
version = array[1]
}
}
return nil
})
if err != nil {
mlog.Fatal(err)
}
return version, nil
}

View File

@ -0,0 +1,42 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/gtag"
)
var (
Gen = cGen{}
)
type cGen struct {
g.Meta `name:"gen" brief:"{cGenBrief}" dc:"{cGenDc}"`
cGenDao
cGenEnums
cGenCtrl
cGenPb
cGenPbEntity
cGenService
}
const (
cGenBrief = `automatically generate go files for dao/do/entity/pb/pbentity`
cGenDc = `
The "gen" command is designed for multiple generating purposes.
It's currently supporting generating go files for ORM models, protobuf and protobuf entity files.
Please use "gf gen dao -h" for specified type help.
`
)
func init() {
gtag.Sets(g.MapStrStr{
`cGenBrief`: cGenBrief,
`cGenDc`: cGenDc,
})
}

View File

@ -0,0 +1,15 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genctrl"
)
type (
cGenCtrl = genctrl.CGenCtrl
)

View File

@ -0,0 +1,25 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
_ "github.com/gogf/gf/contrib/drivers/clickhouse/v2"
_ "github.com/gogf/gf/contrib/drivers/mssql/v2"
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
_ "github.com/gogf/gf/contrib/drivers/oracle/v2"
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
_ "github.com/gogf/gf/contrib/drivers/sqlite/v2"
// do not add dm in cli pre-compilation,
// the dm driver does not support certain target platforms.
// _ "github.com/gogf/gf/contrib/drivers/dm/v2"
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/gendao"
)
type (
cGenDao = gendao.CGenDao
)

View File

@ -0,0 +1,15 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genenums"
)
type (
cGenEnums = genenums.CGenEnums
)

View File

@ -0,0 +1,13 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import "github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpb"
type (
cGenPb = genpb.CGenPb
)

View File

@ -0,0 +1,13 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import "github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpbentity"
type (
cGenPbEntity = genpbentity.CGenPbEntity
)

View File

@ -0,0 +1,15 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genservice"
)
type (
cGenService = genservice.CGenService
)

View File

@ -0,0 +1,441 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"bufio"
"context"
"fmt"
"os"
"strconv"
"strings"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gproc"
"github.com/gogf/gf/v2/os/gres"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gtag"
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/geninit"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/allyes"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
)
var (
// Init .
Init = cInit{}
)
type cInit struct {
g.Meta `name:"init" brief:"{cInitBrief}" eg:"{cInitEg}"`
}
const (
cInitRepoPrefix = `github.com/gogf/`
cInitMonoRepo = `template-mono`
cInitMonoRepoApp = `template-mono-app`
cInitSingleRepo = `template-single`
cInitBrief = `create and initialize an empty GoFrame project`
cInitEg = `
gf init my-project
gf init my-mono-repo -m
gf init my-mono-repo -a
gf init my-project -u
gf init my-project -g "github.com/myorg/myproject"
gf init -r github.com/gogf/template-single my-project
gf init -r github.com/gogf/examples/httpserver/jwt my-jwt
gf init -r github.com/gogf/gf/cmd/gf/v2@v2.9.7 mygf
gf init -r github.com/gogf/gf/cmd/gf/v2 mygf -s
gf init -i
`
cInitNameBrief = `
name for the project. It will create a folder with NAME in current directory.
The NAME will also be the module name for the project.
`
// cInitGitDir the git directory
cInitGitDir = ".git"
// cInitGitignore the gitignore file
cInitGitignore = ".gitignore"
)
// defaultTemplates is the list of predefined templates for interactive selection
var defaultTemplates = []struct {
Name string
Repo string
Desc string
}{
{"template-single", "github.com/gogf/template-single", "Single project template"},
{"template-mono", "github.com/gogf/template-mono", "Mono-repo project template"},
}
func init() {
gtag.Sets(g.MapStrStr{
`cInitBrief`: cInitBrief,
`cInitEg`: cInitEg,
`cInitNameBrief`: cInitNameBrief,
})
}
type cInitInput struct {
g.Meta `name:"init"`
Name string `name:"NAME" arg:"true" brief:"{cInitNameBrief}"`
Mono bool `name:"mono" short:"m" brief:"initialize a mono-repo instead a single-repo" orphan:"true"`
MonoApp bool `name:"monoApp" short:"a" brief:"initialize a mono-repo-app instead a single-repo" orphan:"true"`
Update bool `name:"update" short:"u" brief:"update to the latest goframe version" orphan:"true"`
Module string `name:"module" short:"g" brief:"custom go module"`
Repo string `name:"repo" short:"r" brief:"remote repository URL for template download"`
SelectVer bool `name:"select" short:"s" brief:"enable interactive version selection for remote template" orphan:"true"`
Interactive bool `name:"interactive" short:"i" brief:"enable interactive mode to select template" orphan:"true"`
}
type cInitOutput struct{}
func (c cInit) Index(ctx context.Context, in cInitInput) (out *cInitOutput, err error) {
// Check if using remote template mode
if in.Repo != "" || in.Interactive {
return c.initFromRemote(ctx, in)
}
// If no name provided and no remote mode, enter interactive mode
if in.Name == "" {
return c.initInteractive(ctx, in)
}
// Default: use built-in template
return c.initFromBuiltin(ctx, in)
}
// initFromRemote initializes project from remote repository
func (c cInit) initFromRemote(ctx context.Context, in cInitInput) (out *cInitOutput, err error) {
repo := in.Repo
name := in.Name
// If interactive mode and no repo specified, let user select
if in.Interactive && repo == "" {
var modPath string
var upgradeDeps bool
repo, name, modPath, upgradeDeps, err = interactiveSelectTemplate()
if err != nil {
return nil, err
}
if modPath != "" {
in.Module = modPath
}
if upgradeDeps {
in.Update = true
}
}
if repo == "" {
return nil, fmt.Errorf("repository URL is required for remote template mode")
}
// Default name to repo basename if empty
if name == "" {
name = gfile.Basename(repo)
mlog.Printf("Using repository basename as project name: %s", name)
}
mlog.Print("initializing from remote template...")
opts := &geninit.ProcessOptions{
SelectVersion: in.SelectVer,
ModulePath: in.Module,
UpgradeDeps: in.Update,
}
if err = geninit.Process(ctx, repo, name, opts); err != nil {
return nil, err
}
mlog.Print("initialization done!")
if name != "" && name != "." {
mlog.Printf(`you can now run "cd %s && gf run main.go" to start your journey, enjoy!`, name)
}
return
}
// initFromBuiltin initializes project from built-in template
func (c cInit) initFromBuiltin(ctx context.Context, in cInitInput) (out *cInitOutput, err error) {
var overwrote = false
if !gfile.IsEmpty(in.Name) && !allyes.Check() {
s := gcmd.Scanf(`the folder "%s" is not empty, files might be overwrote, continue? [y/n]: `, in.Name)
if strings.EqualFold(s, "n") {
return
}
overwrote = true
}
mlog.Print("initializing...")
// Create project folder and files.
var (
templateRepoName string
gitignoreFile = in.Name + "/" + cInitGitignore
)
if in.Mono {
templateRepoName = cInitMonoRepo
} else if in.MonoApp {
templateRepoName = cInitMonoRepoApp
} else {
templateRepoName = cInitSingleRepo
}
err = gres.Export(templateRepoName, in.Name, gres.ExportOption{
RemovePrefix: templateRepoName,
})
if err != nil {
return
}
// build ignoreFiles from the .gitignore file
ignoreFiles := make([]string, 0, 10)
ignoreFiles = append(ignoreFiles, cInitGitDir)
// in.MonoApp is a mono-repo-app, it should ignore the .gitignore file
if overwrote && !in.MonoApp {
err = gfile.ReadLines(gitignoreFile, func(line string) error {
// Add only hidden files or directories
// If other directories are added, it may cause the entire directory to be ignored
// such as 'main' in the .gitignore file, but the path is ' D:\main\my-project '
if line != "" && strings.HasPrefix(line, ".") {
ignoreFiles = append(ignoreFiles, line)
}
return nil
})
// if not found the .gitignore file will skip os.ErrNotExist error
if err != nil && !os.IsNotExist(err) {
return
}
}
// Get template name and module name.
if in.Module == "" {
in.Module = gfile.Basename(gfile.RealPath(in.Name))
}
if in.MonoApp {
pwd := gfile.Pwd() + string(os.PathSeparator) + in.Name
in.Module = utils.GetImportPath(pwd)
}
// Replace template name to project name.
err = gfile.ReplaceDirFunc(func(path, content string) string {
for _, ignoreFile := range ignoreFiles {
if strings.Contains(path, ignoreFile) {
return content
}
}
return gstr.Replace(gfile.GetContents(path), cInitRepoPrefix+templateRepoName, in.Module)
}, in.Name, "*", true)
if err != nil {
return
}
// Format the generated Go files.
utils.GoFmt(in.Name)
// Update the GoFrame version.
if in.Update {
mlog.Print("update goframe...")
// go get -u github.com/gogf/gf/v2@latest
updateCommand := `go get -u github.com/gogf/gf/v2@latest`
if in.Name != "." {
updateCommand = fmt.Sprintf(`cd %s && %s`, in.Name, updateCommand)
}
if err = gproc.ShellRun(ctx, updateCommand); err != nil {
mlog.Fatal(err)
}
// go mod tidy
gomModTidyCommand := `go mod tidy`
if in.Name != "." {
gomModTidyCommand = fmt.Sprintf(`cd %s && %s`, in.Name, gomModTidyCommand)
}
if err = gproc.ShellRun(ctx, gomModTidyCommand); err != nil {
mlog.Fatal(err)
}
}
mlog.Print("initialization done! ")
if !in.Mono {
enjoyCommand := `gf run main.go`
if in.Name != "." {
enjoyCommand = fmt.Sprintf(`cd %s && %s`, in.Name, enjoyCommand)
}
mlog.Printf(`you can now run "%s" to start your journey, enjoy!`, enjoyCommand)
}
return
}
// initInteractive enters interactive mode when no arguments provided
func (c cInit) initInteractive(ctx context.Context, in cInitInput) (out *cInitOutput, err error) {
reader := bufio.NewReader(os.Stdin)
// Ask user which mode to use
fmt.Println("\nPlease select initialization mode:")
fmt.Println(strings.Repeat("-", 50))
fmt.Println(" [1] Built-in template (default)")
fmt.Println(" [2] Remote template")
fmt.Println(strings.Repeat("-", 50))
fmt.Print("Select mode [1-2] (default: 1): ")
input, err := reader.ReadString('\n')
if err != nil {
mlog.Fatalf("failed to read input: %v", err)
return
}
input = strings.TrimSpace(input)
if input == "2" {
in.Interactive = true
return c.initFromRemote(ctx, in)
}
// Built-in template mode
fmt.Println("\nPlease select project type:")
fmt.Println(strings.Repeat("-", 50))
fmt.Println(" [1] Single project (default)")
fmt.Println(" [2] Mono-repo project")
fmt.Println(" [3] Mono-repo app")
fmt.Println(strings.Repeat("-", 50))
fmt.Print("Select type [1-3] (default: 1): ")
input, err = reader.ReadString('\n')
if err != nil {
mlog.Fatalf("failed to read input: %v", err)
return
}
input = strings.TrimSpace(input)
switch input {
case "2":
in.Mono = true
case "3":
in.MonoApp = true
}
// Get project name
for {
fmt.Print("Enter project name: ")
input, err = reader.ReadString('\n')
if err != nil {
mlog.Fatalf("failed to read input: %v", err)
return
}
in.Name = strings.TrimSpace(input)
if in.Name != "" {
break
}
fmt.Println("Project name cannot be empty")
}
// Get module path (optional)
fmt.Printf("Enter Go module path (leave empty to use \"%s\"): ", in.Name)
input, err = reader.ReadString('\n')
if err != nil {
mlog.Fatalf("failed to read input: %v", err)
return
}
in.Module = strings.TrimSpace(input)
// Ask about update
fmt.Print("Update to latest GoFrame version? [y/N]: ")
input, err = reader.ReadString('\n')
if err != nil {
mlog.Fatalf("failed to read input: %v", err)
return
}
input = strings.TrimSpace(strings.ToLower(input))
in.Update = input == "y" || input == "yes"
fmt.Println()
return c.initFromBuiltin(ctx, in)
}
// interactiveSelectTemplate prompts user to select a template interactively
func interactiveSelectTemplate() (repo, name, modPath string, upgradeDeps bool, err error) {
reader := bufio.NewReader(os.Stdin)
// 1. Select template
fmt.Println("\nPlease select a project template:")
fmt.Println(strings.Repeat("-", 50))
for i, t := range defaultTemplates {
fmt.Printf(" [%d] %s - %s\n", i+1, t.Name, t.Desc)
}
fmt.Printf(" [%d] Custom repository URL\n", len(defaultTemplates)+1)
fmt.Println(strings.Repeat("-", 50))
for {
fmt.Printf("Select template [1-%d]: ", len(defaultTemplates)+1)
input, err := reader.ReadString('\n')
if err != nil {
return "", "", "", false, fmt.Errorf("failed to read template selection: %w", err)
}
input = strings.TrimSpace(input)
idx, e := strconv.Atoi(input)
if e != nil || idx < 1 || idx > len(defaultTemplates)+1 {
fmt.Printf("Invalid selection, please enter a number between 1-%d\n", len(defaultTemplates)+1)
continue
}
if idx <= len(defaultTemplates) {
repo = defaultTemplates[idx-1].Repo
fmt.Printf("Selected: %s\n\n", repo)
} else {
// Custom URL
fmt.Print("Enter repository URL: ")
input, err = reader.ReadString('\n')
if err != nil {
return "", "", "", false, fmt.Errorf("failed to read repository URL: %w", err)
}
repo = strings.TrimSpace(input)
if repo == "" {
fmt.Println("Repository URL cannot be empty")
continue
}
}
break
}
// 2. Enter project name
for {
fmt.Print("Enter project name: ")
input, err := reader.ReadString('\n')
if err != nil {
return "", "", "", false, fmt.Errorf("failed to read project name: %w", err)
}
name = strings.TrimSpace(input)
if name == "" {
fmt.Println("Project name cannot be empty")
continue
}
break
}
// 3. Enter module path (optional)
fmt.Printf("Enter Go module path (leave empty to use \"%s\"): ", name)
input, err := reader.ReadString('\n')
if err != nil {
return "", "", "", false, fmt.Errorf("failed to read module path: %w", err)
}
modPath = strings.TrimSpace(input)
// 4. Ask about upgrade
fmt.Print("Upgrade dependencies to latest (go get -u)? [y/N]: ")
input, err = reader.ReadString('\n')
if err != nil {
return "", "", "", false, fmt.Errorf("failed to read upgrade confirmation: %w", err)
}
input = strings.TrimSpace(strings.ToLower(input))
upgradeDeps = input == "y" || input == "yes"
fmt.Println()
return repo, name, modPath, upgradeDeps, nil
}

View File

@ -0,0 +1,34 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/cmd/gf/v2/internal/service"
)
var (
Install = cInstall{}
)
type cInstall struct {
g.Meta `name:"install" brief:"install gf binary to system (might need root/admin permission)"`
}
type cInstallInput struct {
g.Meta `name:"install"`
}
type cInstallOutput struct{}
func (c cInstall) Index(ctx context.Context, in cInstallInput) (out *cInstallOutput, err error) {
err = service.Install.Run(ctx)
return
}

Some files were not shown because too many files have changed in this diff Show More