{"id":18832745,"url":"https://github.com/linka-cloud/printer","last_synced_at":"2026-01-25T19:30:20.398Z","repository":{"id":114454395,"uuid":"594193423","full_name":"linka-cloud/printer","owner":"linka-cloud","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-21T17:01:21.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T07:22:36.742Z","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/linka-cloud.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}},"created_at":"2023-01-27T20:23:54.000Z","updated_at":"2023-01-27T20:34:00.000Z","dependencies_parsed_at":"2023-06-07T23:45:12.525Z","dependency_job_id":null,"html_url":"https://github.com/linka-cloud/printer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linka-cloud","download_url":"https://codeload.github.com/linka-cloud/printer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768926,"owners_count":19693763,"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":"2024-11-08T01:58:53.267Z","updated_at":"2026-01-25T19:30:20.334Z","avatar_url":"https://github.com/linka-cloud.png","language":"Go","readme":"# Printer\n\nPrinter is a simple tool to print a table on the terminal.\n\n\n## Installation\n\n```bash\ngo get go.linka.cloud/printer\n```\n\n## Usage\n\nThe main exported function is `Print` which takes any value as input and prints it on the terminal.\n\nThe table is formatted using the struct's `printer` tags.\n\nIt is expected to have the following format: `printer:\"\u003ccolumn name: string\u003e(,\u003ccolumn order: int\u003e)\"`, or `printer:\"-\"` to ignore the field.\n\nIf no `printer` tag is found, the field name is used as the column name.\n\n**Only exported fields are printed.**\n\n## API\n\n```go\npackage printer // import \"go.linka.cloud/printer\"\n\n\nFUNCTIONS\n\nfunc Print(v any, opts ...Option) (err error)\n\nTYPES\n\ntype Encoder func(v any) ([]byte, error)\n\ntype Format int\n\nconst (\n\tTable Format = iota\n\tJSON\n\tYAML\n)\nfunc (f Format) String() string\n\ntype Option func(*printer)\n\nfunc WithFields(fields ...string) Option\n\nfunc WithFormat(format Format) Option\n\nfunc WithFormatter(fieldName string, fn func(v any) string) Option\n\nfunc WithJSON() Option\n\nfunc WithJSONMarshaler(fn Encoder) Option\n\nfunc WithLowerHeaders() Option\n\nfunc WithLowerValues() Option\n\nfunc WithMax(max int) Option\n\nfunc WithNoHeaders() Option\n\nfunc WithTypeFormatter(t any, fn func(v any) string) Option\n\nfunc WithUpperHeaders() Option\n\nfunc WithUpperValues() Option\n\nfunc WithWriter(writer *tabwriter.Writer) Option\n\nfunc WithYAML() Option\n\nfunc WithYAMLMarshaler(fn Encoder) Option\n\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinka-cloud%2Fprinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinka-cloud%2Fprinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinka-cloud%2Fprinter/lists"}