Skip to content

Instantly share code, notes, and snippets.

View pablodz's full-sized avatar
🤠
9.99x Engineer

Pablo pablodz

🤠
9.99x Engineer
View GitHub Profile
@pablodz
pablodz / main.go
Created January 10, 2023 23:21
Send a sentry error with custom fields simplistic way
package logger
import (
"fmt"
"log"
"os"
"time"
"github.com/getsentry/sentry-go"
)
@pablodz
pablodz / main.go
Created January 11, 2023 03:38
Example multitenant microservice written in golang
package main
import (
"fmt"
"net/http"
)
// Tenant struct to hold tenant information
type Tenant struct {
ID int
package example
import "github.com/pablodz/inotifywaitgo/inotifywaitgo"
func Example() {
dir := "./my_files"
files := make(chan []byte)
errors := make(chan []byte)
go inotifywaitgo.WatchPath(&inotifywaitgo.Settings{
@pablodz
pablodz / gobs.go
Created March 23, 2023 05:41
gobs instead of json marshal golang
package main
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/go-redis/redis"
)
type Address struct {
@pablodz
pablodz / Dockerfile
Last active July 11, 2023 23:10
Easy way to compile grpc, grpc_plugins and protoc to compile all .proto files to any language
FROM ubuntu:latest
WORKDIR /app
RUN apt-get update && \
apt-get install -y \
build-essential \
autoconf \
libtool \
pkg-config \