{"id":21380108,"url":"https://github.com/o98k-ok/lazy","last_synced_at":"2026-02-08T21:04:37.811Z","repository":{"id":57656274,"uuid":"457327716","full_name":"o98k-ok/lazy","owner":"o98k-ok","description":"LDD -\u003e Lazy Driven Development","archived":false,"fork":false,"pushed_at":"2024-10-19T01:43:28.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T10:51:27.115Z","etag":null,"topics":["alferd","doc","golang","iris","package"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/o98k-ok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-02-09T11:21:21.000Z","updated_at":"2024-10-19T01:43:03.000Z","dependencies_parsed_at":"2024-11-13T15:59:33.592Z","dependency_job_id":null,"html_url":"https://github.com/o98k-ok/lazy","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/o98k-ok/lazy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o98k-ok%2Flazy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o98k-ok%2Flazy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o98k-ok%2Flazy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o98k-ok%2Flazy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o98k-ok","download_url":"https://codeload.github.com/o98k-ok/lazy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o98k-ok%2Flazy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263469057,"owners_count":23471441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["alferd","doc","golang","iris","package"],"created_at":"2024-11-22T10:36:32.877Z","updated_at":"2026-02-08T21:04:32.520Z","avatar_url":"https://github.com/o98k-ok.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## lazy golang package \n\n### 1. alfred\n\nJust a alfred toolkit, can be used to create alfred plugin quikcly. \u003cbr /\u003e\n\ne.g.\n```golang\nfunc entry() {\n\tcli := alfred.NewApp(\"new doc search plugin\")\n\tcli.Bind(\"query\", func(s []string) {\n\t\tenv, err := alfred.GetFlowEnv()\n\t\tif err != nil {\n\t\t\talfred.ErrItems(\"alfred get envs failed\", err).Show()\n\t\t\treturn\n\t\t}\n\n\t\tcli := doc.NewLark().CustomSession(env.GetAsString(\"session\", \"\")).WithPage(0, env.GetAsInt(\"count\", 9))\n\t\tparams := strings.Join(s, \" \")\n\t\tentities, err := cli.Query(params)\n\t\tif err != nil {\n\t\t\talfred.ErrItems(\"query lark failed\", err)\n\t\t\treturn\n\t\t}\n\n\t\tmsg := alfred.NewItems()\n\t\tfor _, entity := range entities {\n\t\t\titem := alfred.NewItem(title(entity), intro(entity), entity.Url)\n\t\t\titem.Extra = entity.ViewTS\n\t\t\tmsg.Append(item)\n\t\t}\n\n\t\tmsg.Order(func(l, r *alfred.Item) bool {\n\t\t\treturn l.Extra.(uint32) \u003e r.Extra.(uint32)\n\t\t})\n\t\tmsg.Show()\n\t})\n\n\tif err := cli.Run(os.Args); err != nil {\n\t\talfred.ErrItems(\"alfred run failed\", err).Show()\n\t\treturn\n\t}\n}\n```\n\nMore you can get from https://github.com/o98k-ok/awesome-alfred-workflow\n\n### 2. cache\n\nA simple cache interface, just imp file cache.\n\n### 3. format\n\nOften you need format json, so this package would help you.\n1. format with spec char;\n2. format with custom color;\n\n\n### 4. mac\n\nSome mac interface, you can read/write plist easily.\n\n\n### 5. route\n\nA simple pack for iris, you can do following via it:\n1. Custom your core handler\n2. Custom any compenents of route\n3. Provide a simple version for generate api doc\n\n```golang\ntype Level1 struct {\n\t\tAge *string `schema:\"age\" fake:\"{word}\"`\n\t}\n\ttype Level2 struct {\n\t\tName  string  `json:\"name\"  fake:\"{firstname}\"`\n\t\tLevel *Level1 `json:\"level\"`\n\t}\n\n\tvar l1 Level1\n\tvar l2 Level2\n\tgofakeit.Struct(\u0026l2)\n\tgofakeit.Struct(\u0026l1)\n\telems := Elems{\n\t\tMethod: \"GET\",\n\t\tURI:    \"/api/v1/users\",\n\t\tReq:    l1,\n\t\tResp:   l2,\n\t}\n\n\tfmt.Println(GenerateAPIDoc(elems))\n```\n\nwill get result:\n\n```markdown\n## 1. 接口简介\n\n|  类型  |     信息      | 备注 |\n|--------|---------------|------|\n| URI    | /api/v1/users |      |\n| METHOD | GET           |      |\n\n## 2. 参数信息\n\n请求数据类型为: Level1\n| 字段名称 | 字段类型 | 字段含义 | 是否必要 | 备注 |\n|----------|----------|----------|----------|------|\n| age      | string   |          | NO       |      |\n\n## 3. 返回信息\n\n返回数据类型为: Level2\n| 字段名称 | 字段类型 | 字段含义 | 备注 |\n|----------|----------|----------|------|\n| name     | string   |          |      |\n| level    | Level1   |          |      |\n\n## 4. 请求示例\n\n\n```json\nGET /api/v1/users?age=what\n\n{\n    \"name\": \"Maryse\",\n    \"level\": {\n        \"Age\": \"should\"\n    }\n}\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo98k-ok%2Flazy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo98k-ok%2Flazy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo98k-ok%2Flazy/lists"}