{"id":21192208,"url":"https://github.com/bujosa/adapter-design-pattern","last_synced_at":"2025-03-14T21:13:18.929Z","repository":{"id":219837221,"uuid":"750039942","full_name":"bujosa/adapter-design-pattern","owner":"bujosa","description":"See example of adapter design pattern in go","archived":false,"fork":false,"pushed_at":"2024-01-29T22:00:04.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T10:53:17.683Z","etag":null,"topics":["adapter-pattern","design-patterns","go","structural-patterns"],"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/bujosa.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":"2024-01-29T21:47:08.000Z","updated_at":"2024-02-04T23:56:24.000Z","dependencies_parsed_at":"2024-02-06T06:15:21.083Z","dependency_job_id":null,"html_url":"https://github.com/bujosa/adapter-design-pattern","commit_stats":null,"previous_names":["bujosa/adapter-design-pattern"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bujosa%2Fadapter-design-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bujosa%2Fadapter-design-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bujosa%2Fadapter-design-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bujosa%2Fadapter-design-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bujosa","download_url":"https://codeload.github.com/bujosa/adapter-design-pattern/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243646667,"owners_count":20324586,"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":["adapter-pattern","design-patterns","go","structural-patterns"],"created_at":"2024-11-20T19:07:58.720Z","updated_at":"2025-03-14T21:13:18.908Z","avatar_url":"https://github.com/bujosa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adapter-design-pattern\nSee example of adapter design pattern in go, this is a structural design pattern that allows two incompatible interfaces to work together.\n\n## Documentation\n\n### NewPrinter Interface\nNewPrinter is an interface that represents a new printer. It has a method PrintStored that returns a string.\n\n#### PrintStored Method\nPrintStored is a method that prints the stored message. It returns the printed message as a string.\n\n### PrinterAdapter Struct\nPrinterAdapter is a struct that represents an adapter for a printer. It contains an OldPrinter of type LegacyPrinter and a Msg of type string.\n\n#### OldPrinter\nOldPrinter is a LegacyPrinter that represents the old printer.\n\n#### Msg\nMsg is a string that represents the message to be printed.\n\n### PrintStored Method\nPrintStored is a method of PrinterAdapter that prints the stored message using the adapter. It calls the Print method of the OldPrinter and appends \"Adapter\" to the returned message. The modified message is then printed to the console. If the OldPrinter is nil, no action is taken. The modified message is returned.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbujosa%2Fadapter-design-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbujosa%2Fadapter-design-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbujosa%2Fadapter-design-pattern/lists"}