{"id":38241945,"url":"https://github.com/itrabbit/sieve","last_synced_at":"2026-01-17T01:14:48.117Z","repository":{"id":57599825,"uuid":"129142465","full_name":"itrabbit/sieve","owner":"itrabbit","description":"GoLang Package for filtering fields models during serialization","archived":false,"fork":false,"pushed_at":"2018-07-22T16:46:30.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T22:12:04.304Z","etag":null,"topics":["entities","exclude","filtering","golang","jms-serializer","json","models","scopes","serialization","xml","yml"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itrabbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-11T19:15:42.000Z","updated_at":"2024-05-18T12:25:10.000Z","dependencies_parsed_at":"2022-09-26T19:53:37.204Z","dependency_job_id":null,"html_url":"https://github.com/itrabbit/sieve","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/itrabbit/sieve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itrabbit%2Fsieve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itrabbit%2Fsieve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itrabbit%2Fsieve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itrabbit%2Fsieve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itrabbit","download_url":"https://codeload.github.com/itrabbit/sieve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itrabbit%2Fsieve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["entities","exclude","filtering","golang","jms-serializer","json","models","scopes","serialization","xml","yml"],"created_at":"2026-01-17T01:14:48.012Z","updated_at":"2026-01-17T01:14:48.091Z","avatar_url":"https://github.com/itrabbit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg height=\"48\" src=\"https://raw.githubusercontent.com/itrabbit/sieve/master/logo.png\"\u003e\n\n[![Build Status](https://travis-ci.org/itrabbit/sieve.svg?branch=master)](https://travis-ci.org/itrabbit/sieve)\n [![CodeCov](https://codecov.io/gh/itrabbit/sieve/branch/master/graph/badge.svg)](https://codecov.io/gh/itrabbit/sieve)\n [![GoDoc](https://godoc.org/github.com/itrabbit/sieve?status.svg)](https://godoc.org/github.com/itrabbit/sieve)\n\nGoLang Package for filtering fields models during serialization\n\n**Support:**\n\n- Scopes filtration fields structures\n- Exclude strategy (equal fieldValue, equal value)\n- Export values of higher level\n\n**Plans**:\n- Add version for fields\n- Add code generation for fast serialization\n- Add support XML, YML serializers\n\n\n### Tag options\n\n- `s`, `scopes` - for the pane fields in structures;\n\n- `ns`, `nextScopes` - next scopes in the attachment;\n\n- `k`, `exportKeys` - exported field or value from the structure fields;\n\n- `ef`, `eef`, `excludeEqualField` - exclusion rule field (comparison with another field);\n\n- `ev`, `eev`, `excludeEqualValue` -  exclusion rule field (comparison with value);\n\n- `e.any` - if you are using multiple conditions, exceptions, if specified, is triggered when any condition.\n\n**Example:**\n```go\ntype A struct {\n    Status string `sieve:\"ev:unknown;ev:null;e.any\"\n\n    CreatedAt time.Time `sieve:\"s:private\"`\n    UpdatedAt time.Time `sieve:\"s:private,admin;ef:CreatedAt\"`\n}\n```\n\n## Example\n\n```go\n\n...\n\ntype Option struct {\n    Name  string `json:\"name\"`\n    Value string `json:\"value\"`\n}\n\ntype Object struct {\n    idx       uint64\n    Name      string   `json:\"name\" sieve:\"s:*\"`\n    FullName  string   `json:\"full_name\" sieve:\"s:private\"`\n    CreatedAt uint64   `json:\"created_at\"`\n    UpdatedAt uint64   `json:\"updated_at\" sieve:\"ef:CreatedAt\"`\n    Options   []Option `json:\"options\" sieve:\"k:Name\"`\n}\n\n...\n\nfunc main() {\n    obj := Object{\n        100,\n        \"One\",\n        \"Full\",\n        100,\n        100,\n        []Option{\n            Option{\"1\", \"Cool\"},\n            Option{\"2\", \"Great\"},\n            Option{\"3\", \"Best\"},\n        },\n    }\n    if b, err := json.Marshal(Sieve(\u0026obj, \"public\")); err == nil {\n        fmt.Println(string(b))\n        // -\u003e {\"created_at\":100,\"name\":\"One\",\"options\":[\"1\",\"2\",\"3\"]}\n    }\n    if b, err := json.Marshal(Sieve(\u0026obj, \"private\")); err == nil {\n        fmt.Println(string(b))\n        // -\u003e {\"created_at\":100,\"full_name\":\"Full\",\"name\":\"One\",\"options\":[\"1\",\"2\",\"3\"]}\n    }\n}\n```\n\n\n# Donation to development\n\n`BTC: 1497z5VaY3AUEUYURS5b5fUTehVwv7wosX`\n\n`DASH: XjBr7sqaCch4Lo1A7BctQz3HzRjybfpx2c`\n\n`XRP: rEQwgdCr8Jma3GY2s55SLoZq2jmqmWUBDY`\n\n`PayPal / Yandex Money: garin1221@yandex.ru`\n\n\n## License\n\nJUST is licensed under the [MIT](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitrabbit%2Fsieve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitrabbit%2Fsieve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitrabbit%2Fsieve/lists"}