{"id":25830895,"url":"https://github.com/lab5e/goplate","last_synced_at":"2025-02-28T19:34:37.736Z","repository":{"id":57631104,"uuid":"409542135","full_name":"lab5e/goplate","owner":"lab5e","description":"Go template library","archived":false,"fork":false,"pushed_at":"2023-03-12T14:55:29.000Z","size":27,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T07:55:45.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lab5e.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}},"created_at":"2021-09-23T10:14:05.000Z","updated_at":"2023-03-12T14:55:31.000Z","dependencies_parsed_at":"2024-06-20T06:56:14.561Z","dependency_job_id":"1c93887c-fe9f-4ca9-8af0-988da8bf002c","html_url":"https://github.com/lab5e/goplate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fgoplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fgoplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fgoplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fgoplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lab5e","download_url":"https://codeload.github.com/lab5e/goplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241212344,"owners_count":19927926,"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":[],"created_at":"2025-02-28T19:34:35.579Z","updated_at":"2025-02-28T19:34:37.729Z","avatar_url":"https://github.com/lab5e.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goplate - yet another go template library\n\nFields are enclosed in double curly braces like regular Go templates:\n\n    {{ fieldName }}\n\nNested data structures use dot separators.\n\n    {{ fieldName.subStructure.field }}\n\nTemplate syntax is fairly obvious - the names match roughly the JSON\nequivalent when marshalled. Names are case insensitive so `{{ fieldName }}` and\n`{{ fieldname }}` resolves to the same field.\n\nMap access is limited to `map[string]string` only and map access is also\nfairly obvious if you are familiar with Go:\n\n    {{ mapName[\"name\"] }}\n\n## Transformation functions\n\n\nThere is a few transformations available in the templates. This marshals the\nentire field as a JSON structure and includes it in the output\n\n    {{ fieldName | json }}\n\nThis formats an int64 nanosecond field to a string representation of the data:\n\n    {{ timestampField | asTime }}\n\n\nThis formats a byte buffer to a hex string:\n\n    {{ byteField | asHex }}\n\n## Usage\n\nThis will build a template and execute it:\n\n    type testStruct struct {\n        Field1 int\n        Field2 int\n    }\n\n    // ...\n\n    tmpl, err := New(`{{ field1 }}/{{ field2 }}`).\n        WithParameters(\u0026testStruct{}).\n        Build()\n    if err != nil {\n        panic()\n    }\n\n    buf := \u0026bytes.Buffer{}\n    if err := tmpl.Execute(buf, \u0026testStruct{Field1: 1, Field2: 2}) {\n        panic()\n    }\n\n    // Print buffer\n    fmt.Println(buf.String())\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fgoplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flab5e%2Fgoplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fgoplate/lists"}