{"id":28326588,"url":"https://github.com/go-nop/maskify","last_synced_at":"2026-02-22T16:14:16.222Z","repository":{"id":270327169,"uuid":"909970931","full_name":"go-nop/maskify","owner":"go-nop","description":"Is a Go library used to mask fields in a struct with tag.","archived":false,"fork":false,"pushed_at":"2024-12-30T19:04:58.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-01T14:08:26.874Z","etag":null,"topics":["golang-package","masker","masking","sanitize"],"latest_commit_sha":null,"homepage":"","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/go-nop.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-30T07:17:40.000Z","updated_at":"2024-12-30T19:05:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f9a0a4a-07fd-4d0b-a225-e36caf2780d9","html_url":"https://github.com/go-nop/maskify","commit_stats":null,"previous_names":["go-nop/sanitizer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/go-nop/maskify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nop%2Fmaskify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nop%2Fmaskify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nop%2Fmaskify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nop%2Fmaskify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-nop","download_url":"https://codeload.github.com/go-nop/maskify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-nop%2Fmaskify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29718157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: 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":["golang-package","masker","masking","sanitize"],"created_at":"2025-05-25T23:13:31.411Z","updated_at":"2026-02-22T16:14:16.215Z","avatar_url":"https://github.com/go-nop.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Maskify\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/go-nop/maskify/blob/main/LICENSE)\n[![Release](https://img.shields.io/github/v/release/go-nop/maskify)](https://github.com/go-nop/maskify/releases/latest)\n![GolangVersion](https://img.shields.io/github/go-mod/go-version/go-nop/maskify)\n[![Go Reference](https://pkg.go.dev/badge/github.com/go-nop/maskify.svg)](https://pkg.go.dev/github.com/go-nop/maskify)\n\n`maskify` is a Go library used to mask fields in a struct. This library supports various types of masking such as censor, asterisk, email, credit card, phone, and zip code.\n\n## Features\n\n- Asterisk masking\n- Censor masking\n- Email masking\n- Credit card number masking\n- Phone number masking\n- Zip code masking\n- Custom masking with start and end positions\n- Supports nested structs, slices, and maps\n\n## Installation\n\nYou can install this library using `go get`:\n\n```sh\ngo get github.com/go-nop/maskify\n```\n\n## Usage\nHere is an example of how to use this library:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/go-nop/maskify\"\n)\n\ntype User struct {\n    Name       string `mask:\"start=2,end=2\"`\n    Password   string `mask:\"asterisk\"`\n    Email      string `mask:\"email\"`\n    Phone      string `mask:\"phone\"`\n    Zip        string `mask:\"zip\"`\n    CreditCard string `mask:\"credit_card\"`\n    TokenJWT   string `mask:\"censor\"`\n}\n\nfunc main() {\n    m := maskify.New()\n    user := \u0026User{\n        Name:       \"John Doe\",\n        Password:   \"supersecret\",\n        Email:      \"john.doe@example.com\",\n        Phone:      \"1234567890\",\n        Zip:        \"10025\",\n        CreditCard: \"1234 5678 1234 5678\",\n        TokenJWT:   \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\",\n    }\n\n    fmt.Println(\"Before masking:\", user)\n\n    err := m.Mask(user)\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n\n    fmt.Println(\"After masking:\", user)\n}\n```\n\n## Documentation\n### MaskType\n`MaskType` is a type used to specify the kind of masking to apply to a field. The available `MaskType` values are:\n\n- `MaskAsterisk`: Masking with asterisks.\n- `MaskCensor`: Masking with censor.\n- `MaskEmail`: Masking email.\n- `MaskCreditCard`: Masking credit card number.\n- `MaskPhone`: Masking phone number.\n- `MaskZip`: Masking zip code.\n\n### Masking Tags\nYou can use the mask tag on struct fields to specify the type of masking to apply. Here is an example of using the mask tag:\n\n```go\ntype User struct {\n    Name       string `mask:\"start=2,end=2\"`\n    Password   string `mask:\"asterisk\"`\n    Email      string `mask:\"email\"`\n    Phone      string `mask:\"phone\"`\n    Zip        string `mask:\"zip\"`\n    CreditCard string `mask:\"credit_card\"`\n    TokenJWT   string `mask:\"censor\"`\n}\n```\n\n### Functions\n`New(opts ...Option) *Masker`: Creates a new instance of Masker with the given options.\n\n`Mask(o interface{}) error`: Masks the fields of the given struct.\n\n### Options\n`Option` is a type used to specify options for the Masker. The available options are:\n\n- `OptionTagName`: Specifies the tag name to use for the mask tag. Default is `mask`.\n\n- `OptionMaskByName`: Specifies whether to mask fields by name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-nop%2Fmaskify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-nop%2Fmaskify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-nop%2Fmaskify/lists"}