?? ??? ?? ???, ???? Huma? ??? ?? ?? ?? ??? ???? ????. ??? ??(https://github.com/danielgtaylor/huma/issues/325)? ???? ?? ???? Github ??? ??????. ??? ??? ??? ?????.filters=postcode:eq:RM7(EX, ???:gt:2024-01-01
??? ??
??? ???? ??? ?? ???? ???? ???? ??? ? ?? ?? ????? ?? ??? ?? ???? ??? ??? ??? ???? ???.
??? Huma.Param ??? ?? ??(?? ??)? ??? ??? ? ????.
Parameters: []*huma.Param{{ Name: "filters", In: "query", Description: "Filter properties by various fields. Separate filters by comma.\n\n" + "Format: field:operator:value\n\n" + "Supported fields:\n" + "- postcode (operator: eq)\n" + "- created (operators: gt, lt, gte, lte)\n", Schema: &huma.Schema{ Type: "string", Items: &huma.Schema{ Type: "string", Pattern: "^[a-zA-Z_]+:(eq|neq|gt|lt|gte|lte):[a-zA-Z0-9-:.]+$", }, Examples: []any{ "postcode:eq:RM7 8EX", "created:gt:2024-01-01", }, }, Required: false, }},
?? ??? ??? ?? PropertyFilterParams ???? ??? ? ????.
type FilterParam struct { Field string Operator string Value interface{} } type PropertyFilterParams struct { Items []FilterParam } func (s *PropertyFilterParams) UnmarshalText(text []byte) error { equalityFields := []string{"postcode"} greaterSmallerFields := []string{} dateFields := []string{"created"} for _, item := range strings.Split(string(text), ",") { filterParam, err := parseAndValidateFilterItem(item, equalityFields, greaterSmallerFields, dateFields) if err != nil { return err } s.Items = append(s.Items, filterParam) } return nil } func (s *PropertyFilterParams) Schema(registry huma.Registry) *huma.Schema { return &huma.Schema{ Type: huma.TypeString, } } func parseAndValidateFilterItem(item string, equalityFields []string, greaterSmallerFields []string, dateFields []string) (FilterParam, error) { parts := strings.SplitN(item, ":", 3) field := parts[0] operator := parts[1] value := parts[2] if contains(equalityFields, field) { if operator != "eq" && operator != "neq" { return FilterParam{}, fmt.Errorf("Unsupported operator %s for field %s. Only 'eq' and 'neq' are supported.", operator, field) } } else if contains(greaterSmallerFields, field) { if !validation.IsValidCompareGreaterSmallerOperator(operator) { return FilterParam{}, fmt.Errorf("Unsupported operator %s for field %s. Supported operators: eq, neq, gt, lt, gte, lte.", operator, field) } } else if contains(dateFields, field) { if !validation.IsValidCompareGreaterSmallerOperator(operator) { return FilterParam{}, fmt.Errorf("Unsupported operator %s for field %s. Supported operators: eq, neq, gt, lt, gte, lte.", operator, field) } if !validation.IsValidDate(value) { return FilterParam{}, fmt.Errorf("Invalid date format: %s. Expected: YYYY-MM-DD", value) } } else { return FilterParam{}, fmt.Errorf("Unsupported filter field: %s", field) } return FilterParam{Field: field, Operator: operator, Value: value}, nil }
PropertyFilterParams? PropertyQueryParams ???? ??????.
type PropertyQueryParams struct { PaginationParams Filter PropertyFilterParams `query:"filters" doc:"Filter properties by various fields"` Sort PropertySortParams `query:"sorts" doc:"Sort properties by various fields"` }
??? PropertyQueryParams? ???? ??? ??? ????(?? ??? ??? ?? ?? ??? getAllPropertyOperation ??? ????. ?? ??? ????? ???? ??? ????? ????). . ??? ??? ???? 422 ??? ?????. ?? ??? ?? ?? ???? ??? ??????.
huma.Register(api, getAllPropertyOperation(schema, "get-properties", "/properties", []string{"Properties"}), func(ctx context.Context, input *struct { models.Headers models.PropertyQueryParams }) (*models.MultiplePropertyOutput, error) { for _, filter := range input.Filter.Items { fmt.Println(filter) } return mockMultiplePropertyResponse(), err }) }
? ?? ????? ??? ??? ????. ? ?? ???? ???? ??? ?????.
? ??? Go Huma? ?? ?? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

golangofferssuperiorperperperperferforperformance, nativeconcurrencyviagoroutines ? lefficientresourceusage, makingitidealforhigh-traffic, 2.python, whileslowerduetointerpretationandghilegil, arrethecoSystem, andisbettersuitedfori/o-ko

Golang? ?? ??? ??? ????? ??? ?? ???? ??? ? ??? ? ?? ????. ?? ??? ???, ?? ?? ? ??? ?? ?????? ????? API ??, ???? ???, ?? ???, ?????? ?? ? CLI ??? ?? ??? ?? ????? ???? ? ?????. Golang? ? ??? ??? ?? ??? ???? Gopherjs? ?? JavaScript? ?????? Tinygo? ?? WebAssembly?? ????? ??? ?? ??? ???? ?? ??? ???? HTML ???? ?? ? ? ????. ??? ???? ??? ?? ??? ??? ??JavaScript/TypeScript ? ???? ???????. ??? Golang? ??? ???? ???? ?? ?? ??? ? ?????.

GO?? GraphQlapi? ????? GQLGEN ?????? ???? ?? ???? ????? ?? ????. 1. ?? ???? ???? ?? ?? ??? ???? GQLGEN? ?? ??? ?????? ??????. 2. ?? ?? GraphQLSchema? ???? POST ?? ? ?? ??? ??? ?? API ?? ? ?? ??? ??????. 3. ?? ?? ????? ????? ?? ??? ???? Resolver?? ???? ??? ?????. 4. ????? ??? Qlhandler? httpserver? ???? ?? ???? ?? API? ???????. ?? ?? ?? ??, ?? ??, ?? ??? ? ?? ??? ???? ???? ?? ??? ?????.

GO? ???? ?? ??? ??? ???? ?? ??? ???? ??? ???? ????. 1. ?? ???? ?? ???? ??????? ?? ? ???? ??????. Windows? .msi ??? ???? MacOS? .pkg ??? ???? Linux? .tar.gz ??? ???? /usr /local ????? ??? ????. 2. Linux/MacOS?? ?? ??, ?? ~/.bashrc ?? ~/.zshrc? ???? ??? Gopath? ???? Windows Set ??? ??? ???? ?????. 3. ?? ??? ???? ??? ???? ??? ???? Hello.Go? ???? ?? ? ??? ???? ??????. ???? ???? ?? ?? ? ??

Golang? ????? ? ???? ?? ? ? Python?? CPU? ???? ? ?????. 1. Golang? Goroutine ??? ????? ????? ?? ?? ?? ??? ??? CPU ???? ????. 2. GO? ?? ??? ????? ??? ?? ?? ??? ???? ??? ??? ???? ????. 3. Python? GIL ? ?? ?? ?????? ?? ?? ?????? ? ? CPU ? ??? ?? ??? ????. 4. Python? ?? ???? ?? ???? ????? ??? ?? ??? ?? ????? ??? ?? ??? ?????.

sync.waitgroup? ?? ? ??? ??? ?? ? ??? ???? ? ?????. ??? ??? ? ?? ??? ?? ?? ??? ???? : ??, ?? ? ??. 1. Aadd (n) ?? ? ?? ? ?? ?????. 2. DONE ()? ? ? ??? ??? ???? ???? 1 ? ?? ???. 3. Wait ()? ?? ??? ?? ? ??? ?? ? ??? ?????. ?? ??? ?? ?? ?? : ADD? ?? ? ???? ????????. ?? ??? ??? DON? ????? ??????. ??? ?? ???? ?? ????. ? ???? ?? ???, ?? ??? ?? ? ?? ?????? ????? ??? ????? ????? ?? ? ? ????.

Go? Embed ???? ???? ? ???? ??? HTML, CSS, ?? ? ?? ??? ???? ? ??? ?? ???? ????? ?? ???? ? ????. 1. ?? ? ???? ????? ??????. 2. ??/*? ?? ?? ????? ??? ? ??? embed.fs? ?? ?? ?? ??? ??? ? ????. 3. ?? ?? ?? ?? ??? ?? ??? ?? ??? ???? ???? ????? ?? ????. 4. ???? ???? ?? ???, ?? ?? ?? ? ?? ?? ?????????. Embed? ???? ??? ??? ????? ???? ??? ??? ? ? ????.

WhenCogingBetwengolangpyThonforCodeReadability ? Mainability, TheDecisionHiSontEamPriorities.1.GolangoffersstrictConsistencyWithminimal, OpinionatedSyntaxandBuilt-Intooling-intoofmt, inficeUniformcodestyleanDearlyErrordetection.2
