Tyk
mockery
Tyk | mockery | |
---|---|---|
6 | 20 | |
9,257 | 5,621 | |
0.8% | 1.4% | |
9.6 | 8.6 | |
4 days ago | 8 days ago | |
Go | Go | |
GNU General Public License v3.0 or later | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Tyk
-
5 Ways to Improve Your API Reliability
Tyk: An open-source API Gateway that is fast and scalable, running on either its own standalone server or alongside your existing nginx installation.
-
I want to contribute to open source but don't know where to start
We're a friendly bunch at https://github.com/TykTechnologies/tyk - I'll gladly pick up onboarding contributors for some meaningful tasks, if you'd like to ease into it. Lots of tech debt to address, so it's more maintenance work, testing, introducing DDD, etc.
- Open source webhook service
-
One-click trial on TYK API gateway with Tin
Traditional way to try an open-source project Tyk is an open source API gateway project. Organizations can control access to the gateway and protect the security of enterprises and organizations. To start with, I chose the traditional way, using docker-compose to install it, which requires the Git and Docker environment on the computer.
- TykTechnologies/tyk: Open source Enterprise API Gateway, supporting REST, GraphQL, TCP and gRPC protocols
-
Microservices Design - API Gateway Pattern
Amazon API Gateway AWS provides fully managed service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket where developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. Kong API Gateway Kong Gateway is an open-source, lightweight API gateway optimized for microservices, delivering unparalleled latency performance and scalability. If you just want the basics, this option will work for you. It is scalable easily horizontally by adding more nodes. It supports large and variable workloads with very low latency. Other API Gateways Apigee API Gateway MuleSoft Tyk.io Akana SwaggerHub Azure API Gateway Express API Gateway Karken D Choosing the right API gateway Some of the common baseline for evaluation criteria include simplicity, open-source vs propriety, scalability & flexibility, security, features, community, administrative (support, monitoring & deployment), environment provisioning(installation, configuration, hosting offering), pricing, and documentation. API Composition / Aggregation Some API requests in API Gateway map directly to single service API which can be served by routing request to the corresponding microservice. However, in the case of complex API operations that requires results from several microservices can be served by API composition/aggregation (a scatter-gather mechanism). In case of dependency of one another service where synchronous communication is required, the chained composition pattern has to be followed. The composition layer has to support a significant portion of ESB/integration capabilities such as transformations, orchestration, resiliency, and stability patterns. A root container is deployed with the special distributor and aggregator functionalities (or microservices). The distributor is responsible for breaking down into granular tasks and distributing those tasks to microservice instances. The aggregator is responsible for aggregating the results derived by business workflow from composed microservice. API Gateway and Aggregation API gateway with added features results in overambitious gateways that encourage designs that continue to be difficult to test and deploy. It is highly recommended to avoid aggregation and data transformation in the API Gateway. Domain smarts are better suited to be done in application code that follows the defined software development practices. Netflix API Gateway, Zuul 2 removed a lot of the business logic from Gateway that they had in Zuul to origin systems. For more details, refer here. Service Mesh and API Gateway Service mesh in microservices is a configurable network infrastructure layer that handles interprocess communication. This is akin to what is often termed as sidecar proxy or sidecar gateway. It provides a lot of functionalities such as:
mockery
-
I Write Tests in Go
I'm far too lazy to write mocks by hand in go. You can generate a mock for a given interface with mockery https://github.com/vektra/mockery
-
go-ecommerce-microservices: A practical e-commerce microservices, built with cqrs, event sourcing, vertical slice architecture, event-driven architecture.
Some of the features: - ✅ Using Vertical Slice Architecture as a high level architecture - ✅ Using Event Driven Architecture on top of RabbitMQ Message Broker with a custom [Event Bus](pkg/messaging/bus/) - ✅ Using Event Sourcing in Audit Based services like [Orders Service](services/orders/) - ✅ Using CQRS Pattern and Mediator Patternon top of Go-MediatR library - ✅ Using Dependency Injection and Inversion of Controlon top of uber-go/fx library - ✅ Using RESTFul api with Echo framework and using swagger with swaggo/swag library - ✅ Using Postgres and EventStoreDB to write databases with fully supports transactions(ACID) - ✅ Using MongoDB and Elastic Search for read databases (NOSQL) - ✅ Using OpenTelemetry for collection Distributed Tracing with using Jaeger and Zipkin - ✅ Using OpenTelemetry for collection Metrics with using Prometheus and Grafana - ✅ Using Unit Test for testing small units with mocking dependent classes and using Mockery for mocking dependencies - ✅ Using End2End Test and Integration Test for testing features with all of their real dependeinces using docker containers (cleanup tests) and testcontainers-go library
- Direction of mockery: absorb different styles of mocks into this project · vektra mockery · Discussion #671
-
Go: Write Mock Test cases using Mockery and
Read mockery documentation: https://vektra.github.io/mockery/
-
Mocking unexported interfaces?
https://github.com/vektra/mockery is the better mocking framework in my biased opinion. The Google maintainers for gomock seem to have neglected the project.
-
I want to contribute to open source but don't know where to start
There are some one liner changes you can implement in https://github.com/vektra/mockery
-
Is gomock still maintained and recommended?
When there's just one heavyweight dependency you're interacting with, perhaps a one-off stub/fake is simpler, but I would posit that auto-generated mocks via things like mockery + go:generate leave less test code to maintain vs. perhaps many stubs across the project.
-
vektra/mockery: v2.21.0 includes "packages" config section, allowing 5x faster mock generation and more fine-grained control over mocks
Please take a look at the documentation linked here, and the related discussion topic that spawned this.
-
Issue implementing interface method that returns another interface
As you can see, the package has a chained method Logical().Write() . Since I want to create tests for PublicFunctionIWantToTest, I want to pass down all the functionality as interface so that I can use https://vektra.github.io/mockery/ to create mocks for it.
- FEEDBACK REQUESTED: Deprecation of automatic interface discovery · Discussion #549 · vektra/mockery
What are some alternatives?
KrakenD - Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation
gomock - GoMock is a mocking framework for the Go programming language.
Kong - 🦍 The Cloud-Native API Gateway and AI Gateway.
counterfeiter - A tool for generating self-contained, type-safe test doubles in go
Hoppscotch - Open source API development ecosystem.
minimock - Powerful mock generation tool for Go programming language
apisix-docker - the docker for Apache APISIX
go-sqlmock - Sql mock driver for golang to test database interactions
Pizzly - The simplest, fastest way to integrate your app with an OAuth API
hoverfly - Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
API Platform - Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
moq - Interface mocking tool for go generate