{"id":13711397,"url":"https://github.com/NYTimes/gizmo","last_synced_at":"2025-05-06T20:32:50.996Z","repository":{"id":43787867,"uuid":"48060472","full_name":"nytimes/gizmo","owner":"nytimes","description":"A Microservice Toolkit from The New York Times","archived":false,"fork":false,"pushed_at":"2023-07-13T14:31:44.000Z","size":3808,"stargazers_count":3763,"open_issues_count":33,"forks_count":223,"subscribers_count":117,"default_branch":"master","last_synced_at":"2024-11-11T13:34:43.503Z","etag":null,"topics":["gizmo","go","google-pubsub","googlecloud","http-server","kafka","pubsub","sns","sqs"],"latest_commit_sha":null,"homepage":"https://open.nytimes.com/introducing-gizmo-aa7ea463b208","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/nytimes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-15T18:09:36.000Z","updated_at":"2024-11-08T06:53:12.000Z","dependencies_parsed_at":"2023-01-31T15:00:45.090Z","dependency_job_id":"270e886b-3ba2-4a91-bb9b-b1cc91514d0d","html_url":"https://github.com/nytimes/gizmo","commit_stats":{"total_commits":405,"total_committers":54,"mean_commits":7.5,"dds":"0.46172839506172836","last_synced_commit":"07c338b522c458c77cdb85b42b961bb11b743153"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgizmo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgizmo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgizmo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgizmo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nytimes","download_url":"https://codeload.github.com/nytimes/gizmo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224528402,"owners_count":17326359,"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":["gizmo","go","google-pubsub","googlecloud","http-server","kafka","pubsub","sns","sqs"],"created_at":"2024-08-02T23:01:07.797Z","updated_at":"2024-11-13T21:31:49.132Z","avatar_url":"https://github.com/nytimes.png","language":"Go","readme":"# Gizmo Microservice Toolkit [![GoDoc](https://godoc.org/github.com/NYTimes/gizmo?status.svg)](https://godoc.org/github.com/NYTimes/gizmo) [![Build Status](https://travis-ci.org/nytimes/gizmo.svg?branch=master)](https://travis-ci.org/nytimes/gizmo) [![Coverage Status](https://coveralls.io/repos/nytimes/gizmo/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/nytimes/gizmo?branch=master)\n\n\u003cp align=\"center\" style=\"font-size:x-large;\"\u003e\n  \u003cB\u003e\u003cI\u003eAs of late April, 2021 Gizmo has been placed in maintenance mode.\u003c/I\u003e\u003c/B\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://graphics8.nytimes.com/images/blogs/open/2015/gizmo.png\"/\u003e\n\u003c/p\u003e\n\nThis toolkit provides packages to put together server and pubsub daemons with the following features:\n\n* Standardized configuration and logging\n* Health check endpoints with configurable strategies\n* Configuration for managing pprof endpoints and log levels\n* Basic interfaces to define expectations and vocabulary\n* Structured logging containing basic request information\n* Useful metrics for endpoints\n* Graceful shutdowns\n\n\n### Install\nNotice the capitalization!\n\n`go get github.com/NYTimes/gizmo/...`\n\n### Import Path Change Notice\nThe New York Times recently changed the github organization from `NYTimes` to `nytimes`. This should not affect the installation as long as you use the proper casing `NYTimes` and not `nytimes` per installation instructions above.\n\nHowever, the intention is to migrate the import paths to be consistent with how it's shown on GitHub. This will be a breaking change and we will introduce a major tag when we update the code. Therefore, the import path will go from `github.com/NYTimes/gizmo/server` to `github.com/nytimes/gizmo/v2/server`. This ensures that people will not have type-mismatches between import path changes.\n\n### Packages\n\n#### [`server`](https://godoc.org/github.com/NYTimes/gizmo/server)\n\nThe `server` package is the bulk of the toolkit and relies on `server.Config` to manage `Server` implementations.\n\nIt offers 1 server implementation:\n\n[`SimpleServer`](https://godoc.org/github.com/NYTimes/gizmo/server#SimpleServer), which is capable of handling basic HTTP and JSON requests via 5 of the available `Service` implementations: `SimpleService`, `JSONService`, `ContextService`, `MixedService` and a `MixedContextService`.\n\n#### [`server/kit`](https://godoc.org/github.com/NYTimes/gizmo/server/kit)\n\nThe `server/kit` package embodies Gizmo's goals to combine with go-kit.\n\n* In this package you'll find:\n    * A more opinionated server with fewer choices.\n    * go-kit used for serving HTTP/JSON \u0026 gRPC used for serving HTTP2/RPC\n    * Monitoring, traces and metrics are automatically registered if running within App Engine, Cloud Run, Kubernetes Engine, Compute Engine or AWS EC2 Instances.\n        * to change the name and version for Error reporting and Traces use `SERVICE_NAME` and `SERVICE_VERSION` environment variables.\n    * Logs go to stdout locally or directly to Stackdriver when in GCP.\n    * Using Go's 1.8 graceful HTTP shutdown.\n    * Services using this package are expected to deploy to GCP.\n\n\n#### [`observe`](https://godoc.org/github.com/NYTimes/gizmo/observe)\n\nThe `observe` package provides observability helpers for metrics and tracing through OpenCensus\n\n* `server/kit` (and soon SimpleServer) utilizes this package to create a StackDriver exporter with sane defaults\n* `GoogleProjectID`, `IsGAE`, and `IsCloudRun` can help you make decisions about the underlying platform\n\n#### [`auth`](https://godoc.org/github.com/NYTimes/gizmo/auth)\n\nThe `auth` package provides primitives for verifying inbound authentication tokens:\n\n* The `PublicKeySource` interface is meant to provide `*rsa.PublicKeys` from JSON Web Key Sets.\n* The `Verifier` struct composes key source implementations with custom decoders and verifier functions to streamline server side token verification.\n\n#### [`auth/gcp`](https://godoc.org/github.com/NYTimes/gizmo/auth/gcp)\n\nThe `auth/gcp` package provides 2 Google Cloud Platform based `auth.PublicKeySource` and `oauth2.TokenSource` implementations:\n\n* The \"Identity\" key source and token source rely on GCP's [identity JWT mechanism for asserting instance identities](https://cloud.google.com/compute/docs/instances/verifying-instance-identity). This is the preferred method for asserting instance identity on GCP.\n* The \"IAM\" key source and token source rely on GCP's IAM services for [signing](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/signJwt) and [verifying JWTs](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts.keys/get). This method can be used outside of GCP, if needed and can provide a bridge for users transitioning from the 1st generation App Engine (where Identity tokens are not available) runtime to the 2nd.\n\nThe `auth/gcp` package also includes an `Authenticator`, which encapsulates a Google Identity verifier and [`oauth2`](https://godoc.org/golang.org/x/oauth2) credentials [to manage a basic web auth flow.](https://developers.google.com/identity/sign-in/web/backend-auth#verify-the-integrity-of-the-id-token)\n\n\n#### [`config`](https://godoc.org/github.com/NYTimes/gizmo/config)\n\nThe `config` package contains a handful of useful functions to load to configuration structs from JSON files or environment variables.\n\nThere are also many structs for common configuration options and credentials of different Cloud Services and Databases.\n\n#### [`pubsub`](https://godoc.org/github.com/NYTimes/gizmo/pubsub)\n\nThe `pubsub` package contains two (`publisher` and `subscriber`) generic interfaces for publishing data to queues as well as subscribing and consuming data from those queues.\n\nThere are 4 implementations of `pubsub` interfaces:\n\n* For pubsub via Amazon's SNS/SQS, you can use the [`pubsub/aws`](https://godoc.org/github.com/NYTimes/gizmo/pubsub/aws) package\n\n* For pubsub via Google's Pubsub, you can use the [`pubsub/gcp`](https://godoc.org/github.com/NYTimes/gizmo/pubsub/gcp) package\n\n* For pubsub via Kafka topics, you can use the [`pubsub/kafka`](https://godoc.org/github.com/NYTimes/gizmo/pubsub/kafka) package\n\n* For publishing via HTTP, you can use the [`pubsub/http`](https://godoc.org/github.com/NYTimes/gizmo/pubsub/http) package\n\n\n#### [`pubsub/pubsubtest`](https://godoc.org/github.com/NYTimes/gizmo/pubsub/pubsubtest)\n\nThe `pubsub/pubsubtest` package contains test implementations of the `pubsub.Publisher`, `pubsub.MultiPublisher`, and `pubsub.Subscriber` interfaces that will allow developers to easily mock out and test their `pubsub` implementations.\n\n#### Examples\n\n* Several reference implementations utilizing `server` and `pubsub` are available in the [`examples`](https://github.com/NYTimes/gizmo/tree/master/examples) subdirectory.\n* There are also examples within the GoDoc: [here](https://godoc.org/github.com/NYTimes/gizmo/examples)\n\n\u003csub\u003e\u003cstrong\u003eIf you experience any issues please create an issue and/or reach out on the #gizmo channel in the [Gophers Slack Workspace](https://invite.slack.golangbridge.org) with what you've found.\u003c/strong\u003e\u003c/sub\u003e\n\n\u003csub\u003eThe Gizmo logo was based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.\u003c/sub\u003e\n","funding_links":[],"categories":["Web Frameworks","Go","web框架","Web框架","web框架`web 框架`","Web 框架"],"sub_categories":["HTTP Clients","Utility/Miscellaneous","版本控制","实用程序/Miscellaneous","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Advanced Console UIs","版本控制`版本控制相关库`","交流","高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNYTimes%2Fgizmo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNYTimes%2Fgizmo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNYTimes%2Fgizmo/lists"}