Skip to content

Instantly share code, notes, and snippets.

View emilien-puget's full-sized avatar

emilien puget emilien-puget

View GitHub Profile
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface {
return &strictHandler{ssi: ssi, middlewares: middlewares, options: StrictHTTPServerOptions {
[package]
name = "oas-merger"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
oas3 = "0.4.0"
serde = { version = "1.0", features = ["derive"] }
@emilien-puget
emilien-puget / go.mod
Last active April 6, 2024 20:18
oas merge golang
module oas_merger
go 1.22.0
require (
github.com/pb33f/libopenapi v0.15.14
gopkg.in/yaml.v2 v2.4.0
)
require (
@emilien-puget
emilien-puget / main.go
Created June 8, 2022 09:56
kafka balancer time window
package main
import (
"fmt"
"time"
"github.com/segmentio/kafka-go"
)
func main() {
@emilien-puget
emilien-puget / cancellable_errgroup.go
Created April 29, 2022 10:14
sample on how to use cancelable err group
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/rs/xid"
"go.mongodb.org/mongo-driver/bson"
<?php
namespace App\Service\Swagger;
use ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
final class SwaggerDecorator implements NormalizerInterface
{
private $decorated;
<?php
namespace App\Service\DataProvider;
use ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface;
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/