├── .gitignore ├── README.md ├── configs └── prometheus │ └── prometheus.yml ├── docker-compose.yml ├── examples ├── caching │ └── redis │ │ ├── app.go │ │ ├── cached_repository.go │ │ ├── http_utils.go │ │ ├── interfaces.go │ │ ├── main.go │ │ ├── models.go │ │ └── repository.go ├── engine │ ├── .gitignore │ ├── Makefile │ ├── cmd │ │ ├── client │ │ │ └── main.go │ │ └── server │ │ │ └── main.go │ ├── internal │ │ ├── app │ │ │ └── app.go │ │ ├── config │ │ │ └── config.go │ │ ├── grpc │ │ │ ├── client │ │ │ │ └── client.go │ │ │ └── server │ │ │ │ ├── server.go │ │ │ │ └── server_test.go │ │ └── logger │ │ │ ├── interface.go │ │ │ └── zap.go │ ├── pb │ │ └── v1 │ │ │ └── calculation │ │ │ ├── calculation.pb.go │ │ │ └── calculation_grpc.pb.go │ ├── pkg │ │ └── cache │ │ │ ├── interfaca.go │ │ │ └── redis.go │ └── proto │ │ └── calculation.proto ├── logging │ ├── logrus │ │ ├── app.go │ │ ├── http_utils.go │ │ ├── main.go │ │ ├── models.go │ │ └── repository.go │ ├── zap │ │ ├── app.go │ │ ├── http_utils.go │ │ ├── main.go │ │ ├── models.go │ │ ├── repository.go │ │ └── zap │ └── zerolog │ │ ├── app.go │ │ ├── http_utils.go │ │ ├── main.go │ │ ├── models.go │ │ └── repository.go ├── metrics │ ├── opencensus │ │ └── main.go │ ├── opentelementry │ │ └── main.go │ └── prometheus │ │ └── main.go └── tracing │ └── jaeger │ ├── app.go │ ├── http_utils.go │ ├── main.go │ ├── models.go │ └── repository.go ├── go.mod ├── go.sum └── process.http /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/* 2 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rebrainme 2 | -------------------------------------------------------------------------------- /configs/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 30s 3 | scrape_timeout: 30s 4 | evaluation_interval: 5s 5 | 6 | rule_files: 7 | 8 | alerting: 9 | alertmanagers: 10 | - scheme: http 11 | path_prefix: /alertmanager 12 | static_configs: 13 | 14 | # A scrape configuration containing exactly one endpoint to scrape. 15 | scrape_configs: 16 | - job_name: "apps" 17 | scheme: http 18 | metrics_path: /metrics 19 | scrape_interval: 30s 20 | static_configs: 21 | - targets: 22 | - 192.168.88.11:9000 23 | labels: 24 | environment: dev 25 | relabel_configs: 26 | - source_labels: [__address__] 27 | target_label: __address__ 28 | - source_labels: [__param_target] 29 | target_label: instance 30 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | volumes: 4 | prometheus_data: 5 | 6 | 7 | services: 8 | db: 9 | image: postgres:15.1-bullseye 10 | restart: unless-stopped 11 | ports: 12 | - 5432:5432 13 | environment: 14 | POSTGRES_DB: example 15 | POSTGRES_USER: usr 16 | POSTGRES_PASSWORD: pwd 17 | 18 | jaeger: 19 | image: jaegertracing/all-in-one:1.41 20 | ports: 21 | - "6831:6831/udp" 22 | - "16686:16686" 23 | 24 | redis: 25 | image: "redis:5.0.5-alpine3.10" 26 | ports: 27 | - 6379:6379 28 | 29 | prometheus: 30 | image: prom/prometheus:v2.40.0 31 | restart: unless-stopped 32 | volumes: 33 | - ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml 34 | - prometheus_data:/prometheus 35 | command: 36 | - '--config.file=/etc/prometheus/prometheus.yml' 37 | - '--storage.tsdb.path=/prometheus' 38 | - '--storage.tsdb.retention.time=70d' 39 | - '--log.level=debug' 40 | - '--web.enable-lifecycle' 41 | ports: 42 | - 9090:9090 43 | -------------------------------------------------------------------------------- /examples/caching/redis/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "net/http" 8 | "net/http/pprof" 9 | 10 | "github.com/go-chi/chi/v5" 11 | "github.com/google/uuid" 12 | "github.com/jackc/pgx/v4" 13 | "github.com/jackc/pgx/v4/log/zapadapter" 14 | "github.com/jackc/pgx/v4/pgxpool" 15 | 16 | "go.uber.org/zap" 17 | "go.uber.org/zap/zapcore" 18 | ) 19 | 20 | type app struct { 21 | logger *zap.Logger 22 | 23 | pool *pgxpool.Pool 24 | repository Repository 25 | } 26 | 27 | func (a *app) parseUserID(r *http.Request) (*uuid.UUID, error) { 28 | strUserID := chi.URLParam(r, "id") 29 | 30 | if strUserID == "" { 31 | return nil, nil 32 | } 33 | 34 | userID, err := uuid.Parse(strUserID) 35 | if err != nil { 36 | a.logger.Debug( 37 | fmt.Sprintf("failed to parse userID (uuid) from: '%s'", strUserID), 38 | zap.Field{Key: "error", String: err.Error(), Type: zapcore.StringType}, 39 | ) 40 | 41 | return nil, err 42 | } 43 | 44 | a.logger.Debug(fmt.Sprintf("userID parsed: %s", userID)) 45 | 46 | return &userID, nil 47 | } 48 | 49 | func (a *app) usersHandler(w http.ResponseWriter, r *http.Request) { 50 | a.logger.Info("usersHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 51 | 52 | ctx := r.Context() 53 | 54 | users, err := a.repository.GetUsers(ctx) 55 | if err != nil { 56 | msg := fmt.Sprintf(`failed to get users: %s`, err) 57 | 58 | a.logger.Error(msg) 59 | 60 | writeResponse(w, http.StatusInternalServerError, msg) 61 | return 62 | } 63 | 64 | writeJsonResponse(w, http.StatusOK, users) 65 | } 66 | 67 | func (a *app) userHandler(w http.ResponseWriter, r *http.Request) { 68 | a.logger.Info("userHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 69 | 70 | ctx := r.Context() 71 | 72 | userID, err := a.parseUserID(r) 73 | if err != nil { 74 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 75 | return 76 | } 77 | 78 | user, err := a.repository.GetUser(ctx, *userID) 79 | if err != nil { 80 | status := http.StatusInternalServerError 81 | 82 | switch { 83 | case errors.Is(err, ErrNotFound): 84 | status = http.StatusNotFound 85 | } 86 | 87 | writeResponse(w, status, fmt.Sprintf(`failed to get user with id %s: %s`, userID, err)) 88 | return 89 | } 90 | 91 | writeJsonResponse(w, http.StatusOK, user) 92 | } 93 | 94 | func (a *app) userArticlesHandler(w http.ResponseWriter, r *http.Request) { 95 | a.logger.Info("userArticlesHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 96 | 97 | userID, err := a.parseUserID(r) 98 | if err != nil { 99 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 100 | return 101 | } 102 | 103 | articles, err := a.repository.GetUserArticles(r.Context(), *userID) 104 | if err != nil { 105 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf(`failed to get user's (id: %s) articles: %s`, userID, err)) 106 | return 107 | } 108 | 109 | writeJsonResponse(w, http.StatusOK, articles) 110 | } 111 | 112 | func (a *app) panicHandler(w http.ResponseWriter, r *http.Request) { 113 | defer func() { 114 | _ = recover() 115 | 116 | writeResponse(w, http.StatusOK, "panic logged, see server log") 117 | }() 118 | 119 | a.logger.Panic("panic!!!") 120 | } 121 | 122 | func (a *app) Init(ctx context.Context, logger *zap.Logger) error { 123 | config, err := pgxpool.ParseConfig(DatabaseURL) 124 | if err != nil { 125 | return fmt.Errorf("failed to parse conn string (%s): %w", DatabaseURL, err) 126 | } 127 | 128 | config.ConnConfig.LogLevel = pgx.LogLevelDebug 129 | config.ConnConfig.Logger = zapadapter.NewLogger(logger) // логгер запросов в БД 130 | 131 | pool, err := pgxpool.ConnectConfig(ctx, config) 132 | if err != nil { 133 | return fmt.Errorf("unable to connect to database: %w", err) 134 | } 135 | 136 | a.logger = logger 137 | a.pool = pool 138 | a.repository = NewCachedRepository(NewRepository(a.pool)) 139 | 140 | return a.repository.InitSchema(ctx) 141 | } 142 | 143 | func (a *app) Serve() error { 144 | r := chi.NewRouter() 145 | 146 | r.Get("/users", http.HandlerFunc(a.usersHandler)) 147 | r.Get("/users/{id}", http.HandlerFunc(a.userHandler)) 148 | r.Get("/users/{id}/articles", http.HandlerFunc(a.userArticlesHandler)) 149 | r.Get("/panic", http.HandlerFunc(a.panicHandler)) 150 | 151 | // profiling 152 | r.Mount("/debug", Profiler()) 153 | 154 | return http.ListenAndServe("0.0.0.0:9000", r) 155 | } 156 | 157 | func Profiler() http.Handler { 158 | r := chi.NewRouter() 159 | 160 | r.Get("/", func(w http.ResponseWriter, r *http.Request) { 161 | http.Redirect(w, r, r.RequestURI+"/pprof/", http.StatusMovedPermanently) 162 | }) 163 | r.HandleFunc("/pprof", func(w http.ResponseWriter, r *http.Request) { 164 | http.Redirect(w, r, r.RequestURI+"/", http.StatusMovedPermanently) 165 | }) 166 | 167 | r.HandleFunc("/pprof/*", pprof.Index) 168 | r.HandleFunc("/pprof/cmdline", pprof.Cmdline) 169 | r.HandleFunc("/pprof/profile", pprof.Profile) 170 | r.HandleFunc("/pprof/symbol", pprof.Symbol) 171 | r.HandleFunc("/pprof/trace", pprof.Trace) 172 | 173 | r.Handle("/pprof/goroutine", pprof.Handler("goroutine")) 174 | r.Handle("/pprof/threadcreate", pprof.Handler("threadcreate")) 175 | r.Handle("/pprof/mutex", pprof.Handler("mutex")) 176 | r.Handle("/pprof/heap", pprof.Handler("heap")) 177 | r.Handle("/pprof/block", pprof.Handler("block")) 178 | r.Handle("/pprof/allocs", pprof.Handler("allocs")) 179 | 180 | return r 181 | } 182 | -------------------------------------------------------------------------------- /examples/caching/redis/cached_repository.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "time" 7 | 8 | "github.com/go-redis/cache/v8" 9 | "github.com/go-redis/redis/v8" 10 | 11 | "github.com/google/uuid" 12 | ) 13 | 14 | type cachedRepository struct { 15 | repository Repository 16 | 17 | cache *cache.Cache 18 | } 19 | 20 | func (r *cachedRepository) InitSchema(ctx context.Context) error { 21 | return r.repository.InitSchema(ctx) 22 | } 23 | 24 | func (r *cachedRepository) GetUser(ctx context.Context, id uuid.UUID) (*User, error) { 25 | key := fmt.Sprintf("user:%s", id) 26 | 27 | var user User 28 | 29 | err := r.cache.Get(ctx, key, &user) 30 | 31 | switch err { 32 | case nil: 33 | return &user, nil 34 | 35 | case cache.ErrCacheMiss: 36 | dbUser, dbErr := r.repository.GetUser(ctx, id) 37 | if dbErr != nil { 38 | return nil, dbErr 39 | } 40 | 41 | err = r.cache.Set(&cache.Item{ 42 | Ctx: ctx, 43 | Key: key, 44 | Value: dbUser, 45 | TTL: time.Hour, 46 | }) 47 | 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | return dbUser, nil 53 | } 54 | 55 | return nil, err 56 | } 57 | 58 | func (r *cachedRepository) GetUsers(ctx context.Context) ([]User, error) { 59 | return r.repository.GetUsers(ctx) 60 | } 61 | 62 | func (r *cachedRepository) GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) { 63 | key := fmt.Sprintf("user_articles:%s", userID) 64 | 65 | var articles []Article 66 | 67 | err := r.cache.Get(ctx, key, &articles) 68 | 69 | switch err { 70 | case nil: 71 | return articles, nil 72 | 73 | case cache.ErrCacheMiss: 74 | dbArticles, dbErr := r.repository.GetUserArticles(ctx, userID) 75 | if dbErr != nil { 76 | return nil, dbErr 77 | } 78 | 79 | fmt.Println(dbArticles) 80 | 81 | err = r.cache.Set(&cache.Item{ 82 | Ctx: ctx, 83 | Key: key, 84 | Value: dbArticles, 85 | TTL: time.Hour, 86 | }) 87 | 88 | if err != nil { 89 | return nil, err 90 | } 91 | 92 | return dbArticles, nil 93 | } 94 | 95 | return nil, err 96 | } 97 | 98 | func NewCachedRepository(repository Repository) Repository { 99 | rdb := redis.NewClient(&redis.Options{ 100 | Addr: "localhost:6379", 101 | Password: "", // no password set 102 | DB: 0, // use default DB 103 | }) 104 | 105 | rCache := cache.New(&cache.Options{ 106 | Redis: rdb, 107 | LocalCache: cache.NewTinyLFU(1000, time.Minute), 108 | }) 109 | 110 | return &cachedRepository{ 111 | repository: repository, 112 | cache: rCache, 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /examples/caching/redis/http_utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | // writeResponse - вспомогательная функция, которая записывет http статус-код и текстовое сообщение в ответ клиенту. 10 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 11 | func writeResponse(w http.ResponseWriter, status int, message string) { 12 | w.WriteHeader(status) 13 | _, _ = w.Write([]byte(message)) 14 | _, _ = w.Write([]byte("\n")) 15 | } 16 | 17 | // writeJsonResponse - вспомогательная функция, которая записывает http статус-код и сообщение в формате json в ответ клиенту. 18 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 19 | func writeJsonResponse(w http.ResponseWriter, status int, payload interface{}) { 20 | response, err := json.Marshal(payload) 21 | if err != nil { 22 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf("can't marshal data: %s", err)) 23 | return 24 | } 25 | 26 | w.Header().Set("Content-Type", "application/json") 27 | 28 | writeResponse(w, status, string(response)) 29 | } 30 | -------------------------------------------------------------------------------- /examples/caching/redis/interfaces.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/google/uuid" 7 | ) 8 | 9 | type Repository interface { 10 | InitSchema(ctx context.Context) error 11 | GetUser(ctx context.Context, id uuid.UUID) (*User, error) 12 | GetUsers(ctx context.Context) ([]User, error) 13 | GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) 14 | } 15 | -------------------------------------------------------------------------------- /examples/caching/redis/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "go.uber.org/zap" 8 | ) 9 | 10 | const ( 11 | DatabaseURL = "postgres://usr:pwd@localhost:5432/example?sslmode=disable" 12 | ) 13 | 14 | func main() { 15 | // Предустановленный конфиг. Можно выбрать NewProduction/NewDevelopment/NewExample или создать свой 16 | // Production - уровень логгирования InfoLevel, формат вывода: json 17 | // Development - уровень логгирования DebugLevel, формат вывода: console 18 | logger, err := zap.NewDevelopment() 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | 23 | defer func() { _ = logger.Sync() }() 24 | 25 | // можно установить глобальный логгер (но лучше не надо: используйте внедрение зависимостей где это возможно) 26 | // undo := zap.ReplaceGlobals(logger) 27 | // defer undo() 28 | // 29 | // zap.L().Info("replaced zap's global loggers") 30 | 31 | a := app{} 32 | 33 | if err := a.Init(context.Background(), logger); err != nil { 34 | log.Fatal(err) 35 | } 36 | 37 | if err := a.Serve(); err != nil { 38 | log.Fatal(err) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/caching/redis/models.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | ) 6 | 7 | type User struct { 8 | ID uuid.UUID `json:"id"` 9 | Name string `json:"name"` 10 | } 11 | 12 | type Article struct { 13 | ID uuid.UUID `json:"id"` 14 | Title string `json:"title"` 15 | Text string `json:"string"` 16 | 17 | UserID uuid.UUID `json:"user_id"` 18 | } 19 | -------------------------------------------------------------------------------- /examples/caching/redis/repository.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | 8 | "github.com/google/uuid" 9 | "github.com/jackc/pgx/v4/pgxpool" 10 | ) 11 | 12 | const ( 13 | DDL = ` 14 | DROP TABLE IF EXISTS articles; 15 | DROP TABLE IF EXISTS users; 16 | 17 | CREATE TABLE IF NOT EXISTS users 18 | ( 19 | id uuid NOT NULL 20 | CONSTRAINT users_pk 21 | PRIMARY KEY, 22 | name varchar(150) NOT NULL 23 | ); 24 | 25 | CREATE TABLE IF NOT EXISTS articles 26 | ( 27 | id uuid NOT NULL 28 | CONSTRAINT articles_pk 29 | PRIMARY KEY, 30 | title varchar(150) NOT NULL, 31 | text text NOT NULL, 32 | user_id uuid 33 | CONSTRAINT articles_users_id_fk 34 | REFERENCES users 35 | ); 36 | 37 | INSERT INTO public.users (id, name) VALUES ('b29f95a2-499a-4079-97f5-ff55c3854fcb', 'usr1'); 38 | INSERT INTO public.users (id, name) VALUES ('b6dede74-ad09-4bb7-a036-997ab3ab3130', 'usr2'); 39 | 40 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e4e12c87-88d8-413c-8ab6-57bfa4e953a8', 'article_11', 'some text', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 41 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('68792339-715c-4823-a4d5-a85cefec8d36', 'article_12', 'hello, world!', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 42 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e095e3a2-5b8e-4bc8-b793-bc3606c4fdd5', 'article_21', 'why so serious?', 'b6dede74-ad09-4bb7-a036-997ab3ab3130'); 43 | ` 44 | 45 | UsersSelect = `SELECT id, name FROM users` 46 | UserByIDSelect = `SELECT id, name FROM users WHERE id = $1` 47 | UserArticlesSelect = `SELECT id, title, text, user_id FROM articles WHERE user_id = $1` 48 | ) 49 | 50 | var ( 51 | ErrNotFound = errors.New("not found") 52 | ErrMultipleFound = errors.New("multiple found") 53 | ) 54 | 55 | type repository struct { 56 | pool *pgxpool.Pool 57 | } 58 | 59 | func (r *repository) InitSchema(ctx context.Context) error { 60 | _, err := r.pool.Exec(ctx, DDL) 61 | return err 62 | } 63 | 64 | func (r *repository) GetUser(ctx context.Context, id uuid.UUID) (*User, error) { 65 | rows, _ := r.pool.Query(ctx, UserByIDSelect, id) 66 | 67 | var ( 68 | user User 69 | found bool 70 | ) 71 | 72 | for rows.Next() { 73 | if found { 74 | return nil, fmt.Errorf("%w: user id %s", ErrMultipleFound, id) 75 | } 76 | 77 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 78 | return nil, err 79 | } 80 | 81 | found = true 82 | } 83 | 84 | if err := rows.Err(); err != nil { 85 | return nil, err 86 | } 87 | 88 | if !found { 89 | return nil, fmt.Errorf("%w: user id %s", ErrNotFound, id) 90 | } 91 | 92 | return &user, nil 93 | } 94 | 95 | func (r *repository) GetUsers(ctx context.Context) ([]User, error) { 96 | rows, _ := r.pool.Query(ctx, UsersSelect) 97 | 98 | ret := make([]User, 0) 99 | 100 | for rows.Next() { 101 | var user User 102 | 103 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 104 | return nil, err 105 | } 106 | 107 | ret = append(ret, user) 108 | } 109 | 110 | if err := rows.Err(); err != nil { 111 | return nil, err 112 | } 113 | 114 | return ret, nil 115 | } 116 | 117 | func (r *repository) GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) { 118 | rows, _ := r.pool.Query(ctx, UserArticlesSelect, userID) 119 | 120 | ret := make([]Article, 0) 121 | 122 | for rows.Next() { 123 | var article Article 124 | 125 | if err := rows.Scan(&article.ID, &article.Title, &article.Text, &article.UserID); err != nil { 126 | return nil, err 127 | } 128 | 129 | ret = append(ret, article) 130 | } 131 | 132 | if err := rows.Err(); err != nil { 133 | return nil, err 134 | } 135 | 136 | return ret, nil 137 | } 138 | 139 | func NewRepository(pool *pgxpool.Pool) Repository { 140 | return &repository{pool: pool} 141 | } 142 | -------------------------------------------------------------------------------- /examples/engine/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ -------------------------------------------------------------------------------- /examples/engine/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: compile 2 | 3 | compile: 4 | protoc -Iproto/ --go_out=. --go_opt=module=github.com/SergeyParamoshkin/rebrainme/engine --go-grpc_out=. --go-grpc_opt=module=github.com/SergeyParamoshkin/rebrainme/engine proto/*.proto 5 | 6 | run: 7 | go run cmd/main.go -------------------------------------------------------------------------------- /examples/engine/cmd/client/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "flag" 6 | "log" 7 | "path" 8 | "time" 9 | 10 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/pb/v1/calculation" 11 | "google.golang.org/grpc" 12 | "google.golang.org/grpc/credentials" 13 | "google.golang.org/grpc/credentials/insecure" 14 | ) 15 | 16 | var ( 17 | tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP") 18 | caFile = flag.String("ca_file", "", "The file containing the CA root cert file") 19 | serverAddr = flag.String("addr", "localhost:8080", "The server address in the format of host:port") 20 | serverHostOverride = flag.String("server_host_override", "x.test.example.com", "The server name used to verify the hostname returned by the TLS handshake") 21 | ) 22 | 23 | func main() { 24 | flag.Parse() 25 | 26 | var opts []grpc.DialOption 27 | 28 | if *tls { 29 | if *caFile == "" { 30 | *caFile = path.Base("x509/ca_cert.pem") 31 | } 32 | 33 | creds, err := credentials.NewClientTLSFromFile(*caFile, *serverHostOverride) 34 | if err != nil { 35 | log.Fatalf("Failed to create TLS credentials %v", err) 36 | } 37 | 38 | opts = append(opts, grpc.WithTransportCredentials(creds)) 39 | } else { 40 | opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) 41 | } 42 | 43 | conn, err := grpc.Dial(*serverAddr, opts...) 44 | if err != nil { 45 | log.Fatalf("fail to dial: %v", err) 46 | } 47 | defer conn.Close() 48 | client := calculation.NewCalculationServiceClient(conn) 49 | 50 | printFeature(client, &calculation.Calculation{ 51 | Id: 0, 52 | Comment: "hello world", 53 | }) 54 | 55 | } 56 | 57 | func printFeature(client calculation.CalculationServiceClient, c *calculation.Calculation) { 58 | // log.Printf("Getting feature for point (%d, %d)", point.Latitude, point.Longitude) 59 | ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) 60 | defer cancel() 61 | 62 | feature, err := client.Get(ctx, c) 63 | if err != nil { 64 | 65 | } 66 | 67 | log.Println(feature) 68 | } 69 | -------------------------------------------------------------------------------- /examples/engine/cmd/server/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/internal/app" 8 | ) 9 | 10 | func main() { 11 | ctx := context.Background() 12 | 13 | app, err := app.NewApp(ctx) 14 | if err != nil { 15 | log.Fatal(err) 16 | } 17 | 18 | app.Run(ctx) 19 | } 20 | -------------------------------------------------------------------------------- /examples/engine/internal/app/app.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "net" 7 | 8 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/internal/grpc/server" 9 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/internal/logger" 10 | "go.uber.org/zap" 11 | ) 12 | 13 | type App struct { 14 | Log logger.Logger 15 | } 16 | 17 | func NewApp(ctx context.Context) (*App, error) { 18 | zapLogger, err := zap.NewProduction() 19 | 20 | if err != nil { 21 | return nil, fmt.Errorf("failed to create logger: %w", err) 22 | } 23 | 24 | return &App{ 25 | Log: logger.NewZapLogger(zapLogger), 26 | }, nil 27 | } 28 | 29 | func (a *App) Run(ctx context.Context) { 30 | a.Log.Info(fmt.Errorf("Starting listening on port 8080")) 31 | port := ":8080" 32 | 33 | lis, err := net.Listen("tcp", port) 34 | if err != nil { 35 | a.Log.Info(fmt.Errorf("failed to listen: %w", err)) 36 | } 37 | 38 | a.Log.Info(fmt.Errorf("Listening on %s", port)) 39 | 40 | srv := server.NewServer() 41 | 42 | if err := srv.Serve(lis); err != nil { 43 | a.Log.Error(fmt.Errorf("failed to serve: %w", err)) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /examples/engine/internal/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | -------------------------------------------------------------------------------- /examples/engine/internal/grpc/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | -------------------------------------------------------------------------------- /examples/engine/internal/grpc/server/server.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/pb/v1/calculation" 7 | "google.golang.org/grpc" 8 | ) 9 | 10 | type CalculationServiceServer struct { 11 | calculation.UnimplementedCalculationServiceServer 12 | 13 | Response *calculation.CalculationResponse 14 | } 15 | 16 | func (s *CalculationServiceServer) Get( 17 | context.Context, *calculation.Calculation, 18 | ) (*calculation.CalculationResponse, error) { 19 | return &calculation.CalculationResponse{ 20 | Result: 0.9999, 21 | }, nil 22 | } 23 | 24 | func NewServer() *grpc.Server { 25 | gsrv := grpc.NewServer() 26 | srv := &CalculationServiceServer{ 27 | UnimplementedCalculationServiceServer: calculation.UnimplementedCalculationServiceServer{}, 28 | } 29 | calculation.RegisterCalculationServiceServer(gsrv, srv) 30 | 31 | return gsrv 32 | } 33 | -------------------------------------------------------------------------------- /examples/engine/internal/grpc/server/server_test.go: -------------------------------------------------------------------------------- 1 | package server_test 2 | 3 | import ( 4 | "context" 5 | "reflect" 6 | "testing" 7 | 8 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/internal/grpc/server" 9 | "github.com/SergeyParamoshkin/rebrainme/examples/engine/pb/v1/calculation" 10 | ) 11 | 12 | func TestCalculationServiceServer_Get(t *testing.T) { 13 | type fields struct { 14 | UnimplementedCalculationServiceServer calculation.UnimplementedCalculationServiceServer 15 | Response *calculation.CalculationResponse 16 | } 17 | type args struct { 18 | in0 context.Context 19 | in1 *calculation.Calculation 20 | } 21 | tests := []struct { 22 | name string 23 | fields fields 24 | args args 25 | want *calculation.CalculationResponse 26 | wantErr bool 27 | }{ 28 | // TODO: Add test cases. 29 | } 30 | for _, tt := range tests { 31 | t.Run(tt.name, func(t *testing.T) { 32 | s := &server.CalculationServiceServer{ 33 | UnimplementedCalculationServiceServer: tt.fields.UnimplementedCalculationServiceServer, 34 | Response: tt.fields.Response, 35 | } 36 | got, err := s.Get(tt.args.in0, tt.args.in1) 37 | if (err != nil) != tt.wantErr { 38 | t.Errorf("CalculationServiceServer.Get() error = %v, wantErr %v", err, tt.wantErr) 39 | return 40 | } 41 | if !reflect.DeepEqual(got, tt.want) { 42 | t.Errorf("CalculationServiceServer.Get() = %v, want %v", got, tt.want) 43 | } 44 | }) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/engine/internal/logger/interface.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import "context" 4 | 5 | type Tag struct { 6 | Key string `json:"key"` 7 | Value string `json:"value"` 8 | } 9 | 10 | type Logger interface { 11 | Debug(err error, tags ...Tag) 12 | Info(err error, tags ...Tag) 13 | Error(err error, tags ...Tag) 14 | 15 | With(tags ...Tag) Logger 16 | WithContext(ctx context.Context) Logger 17 | 18 | NewContext(ctx context.Context, tags ...Tag) context.Context 19 | } 20 | -------------------------------------------------------------------------------- /examples/engine/internal/logger/zap.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | "context" 5 | 6 | "go.uber.org/zap" 7 | ) 8 | 9 | type zapLoggerKeyType string 10 | 11 | const zapLoggerKey zapLoggerKeyType = "zap" 12 | 13 | type ZapLogger struct { 14 | logger *zap.Logger 15 | } 16 | 17 | func NewZapLogger(logger *zap.Logger) *ZapLogger { 18 | return &ZapLogger{ 19 | logger: logger, 20 | } 21 | } 22 | 23 | func (l *ZapLogger) Debug(err error, tags ...Tag) { 24 | l.logger.Debug(err.Error(), makeFields(tags)...) 25 | } 26 | 27 | func (l *ZapLogger) Info(err error, tags ...Tag) { 28 | l.logger.Info(err.Error(), makeFields(tags)...) 29 | } 30 | 31 | func (l *ZapLogger) Error(err error, tags ...Tag) { 32 | l.logger.Error(err.Error(), makeFields(tags)...) 33 | } 34 | 35 | func (l ZapLogger) With(tags ...Tag) Logger { 36 | l.logger = l.logger.With(makeFields(tags)...) 37 | 38 | return &l 39 | } 40 | 41 | func (l ZapLogger) NewContext(ctx context.Context, tags ...Tag) context.Context { 42 | return context.WithValue(ctx, zapLoggerKey, l.WithContext(ctx).With(tags...)) 43 | } 44 | 45 | func (l ZapLogger) WithContext(ctx context.Context) Logger { 46 | if ctx == nil { 47 | return &l 48 | } 49 | 50 | if ctxLogger, ok := ctx.Value(zapLoggerKey).(ZapLogger); ok { 51 | return &ctxLogger 52 | } 53 | 54 | return &l 55 | } 56 | 57 | func makeFields(tags []Tag) []zap.Field { 58 | fields := make([]zap.Field, len(tags)) 59 | for i, tag := range tags { 60 | fields[i] = zap.String(tag.Key, tag.Value) 61 | } 62 | 63 | return fields 64 | } 65 | -------------------------------------------------------------------------------- /examples/engine/pb/v1/calculation/calculation.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.28.1 4 | // protoc v3.21.12 5 | // source: calculation.proto 6 | 7 | package calculation 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type Calculation struct { 24 | state protoimpl.MessageState 25 | sizeCache protoimpl.SizeCache 26 | unknownFields protoimpl.UnknownFields 27 | 28 | Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` 29 | Comment string `protobuf:"bytes,2,opt,name=Comment,proto3" json:"Comment,omitempty"` 30 | } 31 | 32 | func (x *Calculation) Reset() { 33 | *x = Calculation{} 34 | if protoimpl.UnsafeEnabled { 35 | mi := &file_calculation_proto_msgTypes[0] 36 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 37 | ms.StoreMessageInfo(mi) 38 | } 39 | } 40 | 41 | func (x *Calculation) String() string { 42 | return protoimpl.X.MessageStringOf(x) 43 | } 44 | 45 | func (*Calculation) ProtoMessage() {} 46 | 47 | func (x *Calculation) ProtoReflect() protoreflect.Message { 48 | mi := &file_calculation_proto_msgTypes[0] 49 | if protoimpl.UnsafeEnabled && x != nil { 50 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 51 | if ms.LoadMessageInfo() == nil { 52 | ms.StoreMessageInfo(mi) 53 | } 54 | return ms 55 | } 56 | return mi.MessageOf(x) 57 | } 58 | 59 | // Deprecated: Use Calculation.ProtoReflect.Descriptor instead. 60 | func (*Calculation) Descriptor() ([]byte, []int) { 61 | return file_calculation_proto_rawDescGZIP(), []int{0} 62 | } 63 | 64 | func (x *Calculation) GetId() int64 { 65 | if x != nil { 66 | return x.Id 67 | } 68 | return 0 69 | } 70 | 71 | func (x *Calculation) GetComment() string { 72 | if x != nil { 73 | return x.Comment 74 | } 75 | return "" 76 | } 77 | 78 | type CalculationResponse struct { 79 | state protoimpl.MessageState 80 | sizeCache protoimpl.SizeCache 81 | unknownFields protoimpl.UnknownFields 82 | 83 | Result float32 `protobuf:"fixed32,1,opt,name=result,proto3" json:"result,omitempty"` 84 | } 85 | 86 | func (x *CalculationResponse) Reset() { 87 | *x = CalculationResponse{} 88 | if protoimpl.UnsafeEnabled { 89 | mi := &file_calculation_proto_msgTypes[1] 90 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 91 | ms.StoreMessageInfo(mi) 92 | } 93 | } 94 | 95 | func (x *CalculationResponse) String() string { 96 | return protoimpl.X.MessageStringOf(x) 97 | } 98 | 99 | func (*CalculationResponse) ProtoMessage() {} 100 | 101 | func (x *CalculationResponse) ProtoReflect() protoreflect.Message { 102 | mi := &file_calculation_proto_msgTypes[1] 103 | if protoimpl.UnsafeEnabled && x != nil { 104 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 105 | if ms.LoadMessageInfo() == nil { 106 | ms.StoreMessageInfo(mi) 107 | } 108 | return ms 109 | } 110 | return mi.MessageOf(x) 111 | } 112 | 113 | // Deprecated: Use CalculationResponse.ProtoReflect.Descriptor instead. 114 | func (*CalculationResponse) Descriptor() ([]byte, []int) { 115 | return file_calculation_proto_rawDescGZIP(), []int{1} 116 | } 117 | 118 | func (x *CalculationResponse) GetResult() float32 { 119 | if x != nil { 120 | return x.Result 121 | } 122 | return 0 123 | } 124 | 125 | var File_calculation_proto protoreflect.FileDescriptor 126 | 127 | var file_calculation_proto_rawDesc = []byte{ 128 | 0x0a, 0x11, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 129 | 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x22, 0x37, 0x0a, 130 | 0x0b, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 131 | 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 132 | 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 133 | 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x13, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 134 | 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 135 | 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x72, 136 | 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0x51, 0x0a, 0x12, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 137 | 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x03, 0x47, 138 | 0x65, 0x74, 0x12, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x61, 139 | 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 140 | 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 141 | 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 142 | 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x72, 0x67, 0x65, 0x79, 0x50, 0x61, 0x72, 143 | 0x61, 0x6d, 0x6f, 0x73, 0x68, 0x6b, 0x69, 0x6e, 0x2f, 0x72, 0x65, 0x62, 0x72, 0x61, 0x69, 0x6e, 144 | 0x6d, 0x65, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x31, 0x2f, 145 | 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 146 | 0x74, 0x6f, 0x33, 147 | } 148 | 149 | var ( 150 | file_calculation_proto_rawDescOnce sync.Once 151 | file_calculation_proto_rawDescData = file_calculation_proto_rawDesc 152 | ) 153 | 154 | func file_calculation_proto_rawDescGZIP() []byte { 155 | file_calculation_proto_rawDescOnce.Do(func() { 156 | file_calculation_proto_rawDescData = protoimpl.X.CompressGZIP(file_calculation_proto_rawDescData) 157 | }) 158 | return file_calculation_proto_rawDescData 159 | } 160 | 161 | var file_calculation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 162 | var file_calculation_proto_goTypes = []interface{}{ 163 | (*Calculation)(nil), // 0: constant.Calculation 164 | (*CalculationResponse)(nil), // 1: constant.CalculationResponse 165 | } 166 | var file_calculation_proto_depIdxs = []int32{ 167 | 0, // 0: constant.CalculationService.Get:input_type -> constant.Calculation 168 | 1, // 1: constant.CalculationService.Get:output_type -> constant.CalculationResponse 169 | 1, // [1:2] is the sub-list for method output_type 170 | 0, // [0:1] is the sub-list for method input_type 171 | 0, // [0:0] is the sub-list for extension type_name 172 | 0, // [0:0] is the sub-list for extension extendee 173 | 0, // [0:0] is the sub-list for field type_name 174 | } 175 | 176 | func init() { file_calculation_proto_init() } 177 | func file_calculation_proto_init() { 178 | if File_calculation_proto != nil { 179 | return 180 | } 181 | if !protoimpl.UnsafeEnabled { 182 | file_calculation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 183 | switch v := v.(*Calculation); i { 184 | case 0: 185 | return &v.state 186 | case 1: 187 | return &v.sizeCache 188 | case 2: 189 | return &v.unknownFields 190 | default: 191 | return nil 192 | } 193 | } 194 | file_calculation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 195 | switch v := v.(*CalculationResponse); i { 196 | case 0: 197 | return &v.state 198 | case 1: 199 | return &v.sizeCache 200 | case 2: 201 | return &v.unknownFields 202 | default: 203 | return nil 204 | } 205 | } 206 | } 207 | type x struct{} 208 | out := protoimpl.TypeBuilder{ 209 | File: protoimpl.DescBuilder{ 210 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 211 | RawDescriptor: file_calculation_proto_rawDesc, 212 | NumEnums: 0, 213 | NumMessages: 2, 214 | NumExtensions: 0, 215 | NumServices: 1, 216 | }, 217 | GoTypes: file_calculation_proto_goTypes, 218 | DependencyIndexes: file_calculation_proto_depIdxs, 219 | MessageInfos: file_calculation_proto_msgTypes, 220 | }.Build() 221 | File_calculation_proto = out.File 222 | file_calculation_proto_rawDesc = nil 223 | file_calculation_proto_goTypes = nil 224 | file_calculation_proto_depIdxs = nil 225 | } 226 | -------------------------------------------------------------------------------- /examples/engine/pb/v1/calculation/calculation_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.12 5 | // source: calculation.proto 6 | 7 | package calculation 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // CalculationServiceClient is the client API for CalculationService service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type CalculationServiceClient interface { 25 | Get(ctx context.Context, in *Calculation, opts ...grpc.CallOption) (*CalculationResponse, error) 26 | } 27 | 28 | type calculationServiceClient struct { 29 | cc grpc.ClientConnInterface 30 | } 31 | 32 | func NewCalculationServiceClient(cc grpc.ClientConnInterface) CalculationServiceClient { 33 | return &calculationServiceClient{cc} 34 | } 35 | 36 | func (c *calculationServiceClient) Get(ctx context.Context, in *Calculation, opts ...grpc.CallOption) (*CalculationResponse, error) { 37 | out := new(CalculationResponse) 38 | err := c.cc.Invoke(ctx, "/constant.CalculationService/Get", in, out, opts...) 39 | if err != nil { 40 | return nil, err 41 | } 42 | return out, nil 43 | } 44 | 45 | // CalculationServiceServer is the server API for CalculationService service. 46 | // All implementations must embed UnimplementedCalculationServiceServer 47 | // for forward compatibility 48 | type CalculationServiceServer interface { 49 | Get(context.Context, *Calculation) (*CalculationResponse, error) 50 | mustEmbedUnimplementedCalculationServiceServer() 51 | } 52 | 53 | // UnimplementedCalculationServiceServer must be embedded to have forward compatible implementations. 54 | type UnimplementedCalculationServiceServer struct { 55 | } 56 | 57 | func (UnimplementedCalculationServiceServer) Get(context.Context, *Calculation) (*CalculationResponse, error) { 58 | return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") 59 | } 60 | func (UnimplementedCalculationServiceServer) mustEmbedUnimplementedCalculationServiceServer() {} 61 | 62 | // UnsafeCalculationServiceServer may be embedded to opt out of forward compatibility for this service. 63 | // Use of this interface is not recommended, as added methods to CalculationServiceServer will 64 | // result in compilation errors. 65 | type UnsafeCalculationServiceServer interface { 66 | mustEmbedUnimplementedCalculationServiceServer() 67 | } 68 | 69 | func RegisterCalculationServiceServer(s grpc.ServiceRegistrar, srv CalculationServiceServer) { 70 | s.RegisterService(&CalculationService_ServiceDesc, srv) 71 | } 72 | 73 | func _CalculationService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 74 | in := new(Calculation) 75 | if err := dec(in); err != nil { 76 | return nil, err 77 | } 78 | if interceptor == nil { 79 | return srv.(CalculationServiceServer).Get(ctx, in) 80 | } 81 | info := &grpc.UnaryServerInfo{ 82 | Server: srv, 83 | FullMethod: "/constant.CalculationService/Get", 84 | } 85 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 86 | return srv.(CalculationServiceServer).Get(ctx, req.(*Calculation)) 87 | } 88 | return interceptor(ctx, in, info, handler) 89 | } 90 | 91 | // CalculationService_ServiceDesc is the grpc.ServiceDesc for CalculationService service. 92 | // It's only intended for direct use with grpc.RegisterService, 93 | // and not to be introspected or modified (even as a copy) 94 | var CalculationService_ServiceDesc = grpc.ServiceDesc{ 95 | ServiceName: "constant.CalculationService", 96 | HandlerType: (*CalculationServiceServer)(nil), 97 | Methods: []grpc.MethodDesc{ 98 | { 99 | MethodName: "Get", 100 | Handler: _CalculationService_Get_Handler, 101 | }, 102 | }, 103 | Streams: []grpc.StreamDesc{}, 104 | Metadata: "calculation.proto", 105 | } 106 | -------------------------------------------------------------------------------- /examples/engine/pkg/cache/interfaca.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | type Cache interface { 4 | Get(key string) interface{} 5 | Set(key string, value interface{}) 6 | Del(key string) 7 | Flush() error 8 | } 9 | -------------------------------------------------------------------------------- /examples/engine/pkg/cache/redis.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | type Redis struct{} 4 | -------------------------------------------------------------------------------- /examples/engine/proto/calculation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package constant; 4 | 5 | option go_package = "github.com/SergeyParamoshkin/rebrainme/engine/pb/v1/calculation"; 6 | 7 | message Calculation { 8 | int64 Id = 1; 9 | string Comment = 2; 10 | } 11 | 12 | message CalculationResponse { 13 | float result = 1; 14 | } 15 | 16 | service CalculationService { 17 | rpc Get (Calculation) returns (CalculationResponse); 18 | } -------------------------------------------------------------------------------- /examples/logging/logrus/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "net/http" 8 | "runtime/debug" 9 | 10 | "github.com/go-chi/chi/v5" 11 | "github.com/google/uuid" 12 | "github.com/jackc/pgx/v4" 13 | "github.com/jackc/pgx/v4/log/logrusadapter" 14 | "github.com/jackc/pgx/v4/pgxpool" 15 | 16 | "github.com/sirupsen/logrus" 17 | ) 18 | 19 | type app struct { 20 | logger *logrus.Logger 21 | 22 | pool *pgxpool.Pool 23 | repository *Repository 24 | } 25 | 26 | func (a *app) parseUserID(r *http.Request) (*uuid.UUID, error) { 27 | strUserID := chi.URLParam(r, "id") 28 | 29 | if strUserID == "" { 30 | return nil, nil 31 | } 32 | 33 | userID, err := uuid.Parse(strUserID) 34 | if err != nil { 35 | a.logger.WithField("error", err).Debug(fmt.Sprintf("failed to parse userID (uuid) from: '%s'", strUserID)) 36 | 37 | return nil, err 38 | } 39 | 40 | a.logger.Debug(fmt.Sprintf("userID parsed: %s", userID)) 41 | 42 | return &userID, nil 43 | } 44 | 45 | func (a *app) usersHandler(w http.ResponseWriter, r *http.Request) { 46 | a.logger.WithField("method", r.Method).Info("usersHandler called") 47 | 48 | ctx := r.Context() 49 | 50 | users, err := a.repository.GetUsers(ctx) 51 | if err != nil { 52 | msg := fmt.Sprintf(`failed to get users: %s`, err) 53 | 54 | a.logger.Error(msg) 55 | 56 | writeResponse(w, http.StatusInternalServerError, msg) 57 | return 58 | } 59 | 60 | writeJsonResponse(w, http.StatusOK, users) 61 | } 62 | 63 | func (a *app) userHandler(w http.ResponseWriter, r *http.Request) { 64 | a.logger.WithField("method", r.Method).Info("userHandler called") 65 | 66 | ctx := r.Context() 67 | 68 | userID, err := a.parseUserID(r) 69 | if err != nil { 70 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 71 | return 72 | } 73 | 74 | user, err := a.repository.GetUser(ctx, *userID) 75 | if err != nil { 76 | status := http.StatusInternalServerError 77 | 78 | switch { 79 | case errors.Is(err, ErrNotFound): 80 | status = http.StatusNotFound 81 | } 82 | 83 | writeResponse(w, status, fmt.Sprintf(`failed to get user with id %s: %s`, userID, err)) 84 | return 85 | } 86 | 87 | writeJsonResponse(w, http.StatusOK, user) 88 | } 89 | 90 | func (a *app) userArticlesHandler(w http.ResponseWriter, r *http.Request) { 91 | a.logger.WithField("method", r.Method).Info("userArticlesHandler called") 92 | 93 | userID, err := a.parseUserID(r) 94 | if err != nil { 95 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 96 | return 97 | } 98 | 99 | articles, err := a.repository.GetUserArticles(r.Context(), *userID) 100 | if err != nil { 101 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf(`failed to get user's (id: %s) articles: %s`, userID, err)) 102 | return 103 | } 104 | 105 | writeJsonResponse(w, http.StatusOK, articles) 106 | } 107 | 108 | func (a *app) panicHandler(w http.ResponseWriter, r *http.Request) { 109 | defer func() { 110 | _ = recover() 111 | 112 | writeResponse(w, http.StatusOK, "panic logged, see server log") 113 | }() 114 | 115 | a.logger.WithField("stacktrace", string(debug.Stack())).Panicf("panic!!!") 116 | } 117 | 118 | func (a *app) Init(ctx context.Context, logger *logrus.Logger) error { 119 | config, err := pgxpool.ParseConfig(DatabaseURL) 120 | if err != nil { 121 | return fmt.Errorf("failed to parse conn string (%s): %w", DatabaseURL, err) 122 | } 123 | 124 | config.ConnConfig.LogLevel = pgx.LogLevelDebug 125 | config.ConnConfig.Logger = logrusadapter.NewLogger(logger) // логгер запросов в БД 126 | 127 | pool, err := pgxpool.ConnectConfig(ctx, config) 128 | if err != nil { 129 | return fmt.Errorf("unable to connect to database: %w", err) 130 | } 131 | 132 | a.logger = logger 133 | a.pool = pool 134 | a.repository = NewRepository(a.pool) 135 | 136 | return a.repository.InitSchema(ctx) 137 | } 138 | 139 | func (a *app) Serve() error { 140 | r := chi.NewRouter() 141 | 142 | r.Get("/users", http.HandlerFunc(a.usersHandler)) 143 | r.Get("/users/{id}", http.HandlerFunc(a.userHandler)) 144 | r.Get("/users/{id}/articles", http.HandlerFunc(a.userArticlesHandler)) 145 | r.Get("/panic", http.HandlerFunc(a.panicHandler)) 146 | 147 | return http.ListenAndServe("0.0.0.0:9000", r) 148 | } 149 | -------------------------------------------------------------------------------- /examples/logging/logrus/http_utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | // writeResponse - вспомогательная функция, которая записывет http статус-код и текстовое сообщение в ответ клиенту. 10 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 11 | func writeResponse(w http.ResponseWriter, status int, message string) { 12 | w.WriteHeader(status) 13 | _, _ = w.Write([]byte(message)) 14 | _, _ = w.Write([]byte("\n")) 15 | } 16 | 17 | // writeJsonResponse - вспомогательная функция, которая запсывает http статус-код и сообщение в формате json в ответ клиенту. 18 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 19 | func writeJsonResponse(w http.ResponseWriter, status int, payload interface{}) { 20 | response, err := json.Marshal(payload) 21 | if err != nil { 22 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf("can't marshal data: %s", err)) 23 | return 24 | } 25 | 26 | w.Header().Set("Content-Type", "application/json") 27 | 28 | writeResponse(w, status, string(response)) 29 | } 30 | -------------------------------------------------------------------------------- /examples/logging/logrus/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | const ( 11 | DatabaseURL = "postgres://usr:pwd@localhost:5432/example?sslmode=disable" 12 | ) 13 | 14 | func main() { 15 | logger := logrus.New() 16 | logger.SetLevel(logrus.DebugLevel) 17 | // logger.SetFormatter(&logrus.JSONFormatter{}) 18 | 19 | a := app{} 20 | 21 | if err := a.Init(context.Background(), logger); err != nil { 22 | log.Fatal(err) 23 | } 24 | 25 | if err := a.Serve(); err != nil { 26 | log.Fatal(err) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/logging/logrus/models.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/google/uuid" 4 | 5 | type User struct { 6 | ID uuid.UUID `json:"id"` 7 | Name string `json:"name"` 8 | } 9 | 10 | type Article struct { 11 | ID uuid.UUID `json:"id"` 12 | Title string `json:"title"` 13 | Text string `json:"string"` 14 | 15 | UserID uuid.UUID `json:"user_id"` 16 | } 17 | -------------------------------------------------------------------------------- /examples/logging/logrus/repository.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | 8 | "github.com/google/uuid" 9 | "github.com/jackc/pgx/v4/pgxpool" 10 | ) 11 | 12 | const ( 13 | DDL = ` 14 | DROP TABLE IF EXISTS articles; 15 | DROP TABLE IF EXISTS users; 16 | 17 | CREATE TABLE IF NOT EXISTS users 18 | ( 19 | id uuid NOT NULL 20 | CONSTRAINT users_pk 21 | PRIMARY KEY, 22 | name varchar(150) NOT NULL 23 | ); 24 | 25 | CREATE TABLE IF NOT EXISTS articles 26 | ( 27 | id uuid NOT NULL 28 | CONSTRAINT articles_pk 29 | PRIMARY KEY, 30 | title varchar(150) NOT NULL, 31 | text text NOT NULL, 32 | user_id uuid 33 | CONSTRAINT articles_users_id_fk 34 | REFERENCES users 35 | ); 36 | 37 | INSERT INTO public.users (id, name) VALUES ('b29f95a2-499a-4079-97f5-ff55c3854fcb', 'usr1'); 38 | INSERT INTO public.users (id, name) VALUES ('b6dede74-ad09-4bb7-a036-997ab3ab3130', 'usr2'); 39 | 40 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e4e12c87-88d8-413c-8ab6-57bfa4e953a8', 'article_11', 'some text', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 41 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('68792339-715c-4823-a4d5-a85cefec8d36', 'article_12', 'hello, world!', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 42 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e095e3a2-5b8e-4bc8-b793-bc3606c4fdd5', 'article_21', 'why so serious?', 'b6dede74-ad09-4bb7-a036-997ab3ab3130'); 43 | ` 44 | 45 | UsersSelect = `SELECT id, name FROM users` 46 | UserByIDSelect = `SELECT id, name FROM users WHERE id = $1` 47 | UserArticlesSelect = `SELECT id, title, text, user_id FROM articles WHERE user_id = $1` 48 | ) 49 | 50 | var ( 51 | ErrNotFound = errors.New("not found") 52 | ErrMultipleFound = errors.New("multiple found") 53 | ) 54 | 55 | type Repository struct { 56 | pool *pgxpool.Pool 57 | } 58 | 59 | func (r *Repository) InitSchema(ctx context.Context) error { 60 | _, err := r.pool.Exec(ctx, DDL) 61 | return err 62 | } 63 | 64 | func (r *Repository) GetUser(ctx context.Context, id uuid.UUID) (*User, error) { 65 | rows, _ := r.pool.Query(ctx, UserByIDSelect, id) 66 | 67 | var ( 68 | user User 69 | found bool 70 | ) 71 | 72 | for rows.Next() { 73 | if found { 74 | return nil, fmt.Errorf("%w: user id %s", ErrMultipleFound, id) 75 | } 76 | 77 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 78 | return nil, err 79 | } 80 | 81 | found = true 82 | } 83 | 84 | if err := rows.Err(); err != nil { 85 | return nil, err 86 | } 87 | 88 | if !found { 89 | return nil, fmt.Errorf("%w: user id %s", ErrNotFound, id) 90 | } 91 | 92 | return &user, nil 93 | } 94 | 95 | func (r *Repository) GetUsers(ctx context.Context) ([]User, error) { 96 | rows, _ := r.pool.Query(ctx, UsersSelect) 97 | 98 | ret := make([]User, 0) 99 | 100 | for rows.Next() { 101 | var user User 102 | 103 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 104 | return nil, err 105 | } 106 | 107 | ret = append(ret, user) 108 | } 109 | 110 | if err := rows.Err(); err != nil { 111 | return nil, err 112 | } 113 | 114 | return ret, nil 115 | } 116 | 117 | func (r *Repository) GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) { 118 | rows, _ := r.pool.Query(ctx, UserArticlesSelect, userID) 119 | 120 | ret := make([]Article, 0) 121 | 122 | for rows.Next() { 123 | var article Article 124 | 125 | if err := rows.Scan(&article.ID, &article.Title, &article.Text, &article.UserID); err != nil { 126 | return nil, err 127 | } 128 | 129 | ret = append(ret, article) 130 | } 131 | 132 | if err := rows.Err(); err != nil { 133 | return nil, err 134 | } 135 | 136 | return ret, nil 137 | } 138 | 139 | func NewRepository(pool *pgxpool.Pool) *Repository { 140 | return &Repository{pool: pool} 141 | } 142 | -------------------------------------------------------------------------------- /examples/logging/zap/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "net/http" 8 | 9 | "github.com/go-chi/chi/v5" 10 | "github.com/google/uuid" 11 | "github.com/jackc/pgx/v4" 12 | "github.com/jackc/pgx/v4/log/zapadapter" 13 | "github.com/jackc/pgx/v4/pgxpool" 14 | 15 | "go.uber.org/zap" 16 | "go.uber.org/zap/zapcore" 17 | ) 18 | 19 | type app struct { 20 | logger *zap.Logger 21 | 22 | pool *pgxpool.Pool 23 | repository *Repository 24 | } 25 | 26 | func (a *app) parseUserID(r *http.Request) (*uuid.UUID, error) { 27 | strUserID := chi.URLParam(r, "id") 28 | 29 | if strUserID == "" { 30 | return nil, nil 31 | } 32 | 33 | userID, err := uuid.Parse(strUserID) 34 | if err != nil { 35 | a.logger.Debug( 36 | fmt.Sprintf("failed to parse userID (uuid) from: '%s'", strUserID), 37 | zap.Field{Key: "error", String: err.Error(), Type: zapcore.StringType}, 38 | ) 39 | 40 | return nil, err 41 | } 42 | 43 | a.logger.Debug(fmt.Sprintf("userID parsed: %s", userID)) 44 | 45 | return &userID, nil 46 | } 47 | 48 | func (a *app) usersHandler(w http.ResponseWriter, r *http.Request) { 49 | a.logger.Info("usersHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 50 | 51 | ctx := r.Context() 52 | 53 | users, err := a.repository.GetUsers(ctx) 54 | if err != nil { 55 | msg := fmt.Sprintf(`failed to get users: %s`, err) 56 | 57 | a.logger.Error(msg) 58 | 59 | writeResponse(w, http.StatusInternalServerError, msg) 60 | return 61 | } 62 | 63 | writeJsonResponse(w, http.StatusOK, users) 64 | } 65 | 66 | func (a *app) userHandler(w http.ResponseWriter, r *http.Request) { 67 | a.logger.Info("userHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 68 | 69 | ctx := r.Context() 70 | 71 | userID, err := a.parseUserID(r) 72 | if err != nil { 73 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 74 | return 75 | } 76 | 77 | user, err := a.repository.GetUser(ctx, *userID) 78 | if err != nil { 79 | status := http.StatusInternalServerError 80 | 81 | switch { 82 | case errors.Is(err, ErrNotFound): 83 | status = http.StatusNotFound 84 | } 85 | 86 | writeResponse(w, status, fmt.Sprintf(`failed to get user with id %s: %s`, userID, err)) 87 | return 88 | } 89 | 90 | writeJsonResponse(w, http.StatusOK, user) 91 | } 92 | 93 | func (a *app) userArticlesHandler(w http.ResponseWriter, r *http.Request) { 94 | a.logger.Info("userArticlesHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 95 | 96 | userID, err := a.parseUserID(r) 97 | if err != nil { 98 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 99 | return 100 | } 101 | 102 | articles, err := a.repository.GetUserArticles(r.Context(), *userID) 103 | if err != nil { 104 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf(`failed to get user's (id: %s) articles: %s`, userID, err)) 105 | return 106 | } 107 | 108 | writeJsonResponse(w, http.StatusOK, articles) 109 | } 110 | 111 | func (a *app) panicHandler(w http.ResponseWriter, r *http.Request) { 112 | defer func() { 113 | _ = recover() 114 | 115 | writeResponse(w, http.StatusOK, "panic logged, see server log") 116 | }() 117 | 118 | a.logger.Panic("panic!!!") 119 | } 120 | 121 | func (a *app) Init(ctx context.Context, logger *zap.Logger) error { 122 | config, err := pgxpool.ParseConfig(DatabaseURL) 123 | if err != nil { 124 | return fmt.Errorf("failed to parse conn string (%s): %w", DatabaseURL, err) 125 | } 126 | 127 | config.ConnConfig.LogLevel = pgx.LogLevelDebug 128 | config.ConnConfig.Logger = zapadapter.NewLogger(logger) // логгер запросов в БД 129 | 130 | pool, err := pgxpool.ConnectConfig(ctx, config) 131 | if err != nil { 132 | return fmt.Errorf("unable to connect to database: %w", err) 133 | } 134 | 135 | a.logger = logger 136 | a.pool = pool 137 | a.repository = NewRepository(a.pool) 138 | 139 | return a.repository.InitSchema(ctx) 140 | } 141 | 142 | func (a *app) Serve() error { 143 | r := chi.NewRouter() 144 | 145 | r.Get("/users", http.HandlerFunc(a.usersHandler)) 146 | r.Get("/users/{id}", http.HandlerFunc(a.userHandler)) 147 | r.Get("/users/{id}/articles", http.HandlerFunc(a.userArticlesHandler)) 148 | r.Get("/panic", http.HandlerFunc(a.panicHandler)) 149 | 150 | return http.ListenAndServe("0.0.0.0:9000", r) 151 | } 152 | -------------------------------------------------------------------------------- /examples/logging/zap/http_utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | // writeResponse - вспомогательная функция, которая записывет http статус-код и текстовое сообщение в ответ клиенту. 10 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 11 | func writeResponse(w http.ResponseWriter, status int, message string) { 12 | w.WriteHeader(status) 13 | _, _ = w.Write([]byte(message)) 14 | _, _ = w.Write([]byte("\n")) 15 | } 16 | 17 | // writeJsonResponse - вспомогательная функция, которая запсывает http статус-код и сообщение в формате json в ответ клиенту. 18 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 19 | func writeJsonResponse(w http.ResponseWriter, status int, payload interface{}) { 20 | response, err := json.Marshal(payload) 21 | if err != nil { 22 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf("can't marshal data: %s", err)) 23 | return 24 | } 25 | 26 | w.Header().Set("Content-Type", "application/json") 27 | 28 | writeResponse(w, status, string(response)) 29 | } 30 | -------------------------------------------------------------------------------- /examples/logging/zap/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "go.uber.org/zap" 8 | ) 9 | 10 | const ( 11 | DatabaseURL = "postgres://usr:pwd@localhost:5432/example?sslmode=disable" 12 | ) 13 | 14 | func main() { 15 | // Предустановленный конфиг. Можно выбрать NewProduction/NewDevelopment/NewExample или создать свой 16 | // Production - уровень логгирования InfoLevel, формат вывода: json 17 | // Development - уровень логгирования DebugLevel, формат вывода: console 18 | logger, err := zap.NewDevelopment() 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | 23 | defer func() { _ = logger.Sync() }() 24 | 25 | // можно установить глобальный логгер (но лучше не надо: используйте внедрение зависимостей где это возможно) 26 | // undo := zap.ReplaceGlobals(logger) 27 | // defer undo() 28 | // 29 | // zap.L().Info("replaced zap's global loggers") 30 | 31 | a := app{} 32 | 33 | if err := a.Init(context.Background(), logger); err != nil { 34 | log.Fatal(err) 35 | } 36 | 37 | if err := a.Serve(); err != nil { 38 | log.Fatal(err) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/logging/zap/models.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/google/uuid" 4 | 5 | type User struct { 6 | ID uuid.UUID `json:"id"` 7 | Name string `json:"name"` 8 | } 9 | 10 | type Article struct { 11 | ID uuid.UUID `json:"id"` 12 | Title string `json:"title"` 13 | Text string `json:"string"` 14 | 15 | UserID uuid.UUID `json:"user_id"` 16 | } 17 | -------------------------------------------------------------------------------- /examples/logging/zap/repository.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | 8 | "github.com/google/uuid" 9 | "github.com/jackc/pgx/v4/pgxpool" 10 | ) 11 | 12 | const ( 13 | DDL = ` 14 | DROP TABLE IF EXISTS articles; 15 | DROP TABLE IF EXISTS users; 16 | 17 | CREATE TABLE IF NOT EXISTS users 18 | ( 19 | id uuid NOT NULL 20 | CONSTRAINT users_pk 21 | PRIMARY KEY, 22 | name varchar(150) NOT NULL 23 | ); 24 | 25 | CREATE TABLE IF NOT EXISTS articles 26 | ( 27 | id uuid NOT NULL 28 | CONSTRAINT articles_pk 29 | PRIMARY KEY, 30 | title varchar(150) NOT NULL, 31 | text text NOT NULL, 32 | user_id uuid 33 | CONSTRAINT articles_users_id_fk 34 | REFERENCES users 35 | ); 36 | 37 | INSERT INTO public.users (id, name) VALUES ('b29f95a2-499a-4079-97f5-ff55c3854fcb', 'usr1'); 38 | INSERT INTO public.users (id, name) VALUES ('b6dede74-ad09-4bb7-a036-997ab3ab3130', 'usr2'); 39 | 40 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e4e12c87-88d8-413c-8ab6-57bfa4e953a8', 'article_11', 'some text', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 41 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('68792339-715c-4823-a4d5-a85cefec8d36', 'article_12', 'hello, world!', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 42 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e095e3a2-5b8e-4bc8-b793-bc3606c4fdd5', 'article_21', 'why so serious?', 'b6dede74-ad09-4bb7-a036-997ab3ab3130'); 43 | ` 44 | 45 | UsersSelect = `SELECT id, name FROM users` 46 | UserByIDSelect = `SELECT id, name FROM users WHERE id = $1` 47 | UserArticlesSelect = `SELECT id, title, text, user_id FROM articles WHERE user_id = $1` 48 | ) 49 | 50 | var ( 51 | ErrNotFound = errors.New("not found") 52 | ErrMultipleFound = errors.New("multiple found") 53 | ) 54 | 55 | type Repository struct { 56 | pool *pgxpool.Pool 57 | } 58 | 59 | func (r *Repository) InitSchema(ctx context.Context) error { 60 | _, err := r.pool.Exec(ctx, DDL) 61 | return err 62 | } 63 | 64 | func (r *Repository) GetUser(ctx context.Context, id uuid.UUID) (*User, error) { 65 | rows, _ := r.pool.Query(ctx, UserByIDSelect, id) 66 | 67 | var ( 68 | user User 69 | found bool 70 | ) 71 | 72 | for rows.Next() { 73 | if found { 74 | return nil, fmt.Errorf("%w: user id %s", ErrMultipleFound, id) 75 | } 76 | 77 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 78 | return nil, err 79 | } 80 | 81 | found = true 82 | } 83 | 84 | if err := rows.Err(); err != nil { 85 | return nil, err 86 | } 87 | 88 | if !found { 89 | return nil, fmt.Errorf("%w: user id %s", ErrNotFound, id) 90 | } 91 | 92 | return &user, nil 93 | } 94 | 95 | func (r *Repository) GetUsers(ctx context.Context) ([]User, error) { 96 | rows, _ := r.pool.Query(ctx, UsersSelect) 97 | 98 | ret := make([]User, 0) 99 | 100 | for rows.Next() { 101 | var user User 102 | 103 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 104 | return nil, err 105 | } 106 | 107 | ret = append(ret, user) 108 | } 109 | 110 | if err := rows.Err(); err != nil { 111 | return nil, err 112 | } 113 | 114 | return ret, nil 115 | } 116 | 117 | func (r *Repository) GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) { 118 | rows, _ := r.pool.Query(ctx, UserArticlesSelect, userID) 119 | 120 | ret := make([]Article, 0) 121 | 122 | for rows.Next() { 123 | var article Article 124 | 125 | if err := rows.Scan(&article.ID, &article.Title, &article.Text, &article.UserID); err != nil { 126 | return nil, err 127 | } 128 | 129 | ret = append(ret, article) 130 | } 131 | 132 | if err := rows.Err(); err != nil { 133 | return nil, err 134 | } 135 | 136 | return ret, nil 137 | } 138 | 139 | func NewRepository(pool *pgxpool.Pool) *Repository { 140 | return &Repository{pool: pool} 141 | } 142 | -------------------------------------------------------------------------------- /examples/logging/zap/zap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SergeyParamoshkin/rebrainme/d6041e4505060bdf2102c40bbdaf7c5357f5bdd3/examples/logging/zap/zap -------------------------------------------------------------------------------- /examples/logging/zerolog/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "net/http" 8 | "runtime/debug" 9 | 10 | "github.com/go-chi/chi/v5" 11 | "github.com/google/uuid" 12 | "github.com/jackc/pgx/v4" 13 | "github.com/jackc/pgx/v4/log/zerologadapter" 14 | "github.com/jackc/pgx/v4/pgxpool" 15 | "github.com/rs/zerolog" 16 | ) 17 | 18 | type app struct { 19 | logger *zerolog.Logger 20 | 21 | pool *pgxpool.Pool 22 | repository *Repository 23 | } 24 | 25 | func (a *app) parseUserID(r *http.Request) (*uuid.UUID, error) { 26 | strUserID := chi.URLParam(r, "id") 27 | 28 | if strUserID == "" { 29 | return nil, nil 30 | } 31 | 32 | userID, err := uuid.Parse(strUserID) 33 | if err != nil { 34 | a.logger.Err(err).Msg( 35 | fmt.Sprintf("failed to parse userID (uuid) from: '%s'", strUserID)) 36 | 37 | return nil, err 38 | } 39 | 40 | a.logger.Debug().Str("msg", fmt.Sprintf("userID parsed: %s", userID)).Send() 41 | 42 | return &userID, nil 43 | } 44 | 45 | func (a *app) usersHandler(w http.ResponseWriter, r *http.Request) { 46 | a.logger.Info().Interface("method", r.Method).Msg("usersHandler called") 47 | 48 | ctx := r.Context() 49 | 50 | users, err := a.repository.GetUsers(ctx) 51 | if err != nil { 52 | msg := fmt.Sprintf(`failed to get users: %s`, err) 53 | 54 | a.logger.Error().Err(err).Send() 55 | writeResponse(w, http.StatusInternalServerError, msg) 56 | return 57 | } 58 | 59 | writeJsonResponse(w, http.StatusOK, users) 60 | } 61 | 62 | func (a *app) userHandler(w http.ResponseWriter, r *http.Request) { 63 | a.logger.Info().Interface("method", r.Method).Msg("usersHandler called") 64 | 65 | ctx := r.Context() 66 | 67 | userID, err := a.parseUserID(r) 68 | if err != nil { 69 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 70 | return 71 | } 72 | 73 | user, err := a.repository.GetUser(ctx, *userID) 74 | if err != nil { 75 | status := http.StatusInternalServerError 76 | 77 | switch { 78 | case errors.Is(err, ErrNotFound): 79 | status = http.StatusNotFound 80 | } 81 | 82 | writeResponse(w, status, fmt.Sprintf(`failed to get user with id %s: %s`, userID, err)) 83 | return 84 | } 85 | 86 | writeJsonResponse(w, http.StatusOK, user) 87 | } 88 | 89 | func (a *app) userArticlesHandler(w http.ResponseWriter, r *http.Request) { 90 | a.logger.Info().Interface("method", r.Method).Msg("userArticlesHandler called") 91 | 92 | userID, err := a.parseUserID(r) 93 | if err != nil { 94 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 95 | return 96 | } 97 | 98 | articles, err := a.repository.GetUserArticles(r.Context(), *userID) 99 | if err != nil { 100 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf(`failed to get user's (id: %s) articles: %s`, userID, err)) 101 | return 102 | } 103 | 104 | writeJsonResponse(w, http.StatusOK, articles) 105 | } 106 | 107 | func (a *app) panicHandler(w http.ResponseWriter, r *http.Request) { 108 | defer func() { 109 | _ = recover() 110 | 111 | writeResponse(w, http.StatusOK, "panic logged, see server log") 112 | }() 113 | 114 | a.logger.Panic().Msg(string(debug.Stack())) 115 | 116 | } 117 | 118 | func (a *app) Init(ctx context.Context, logger *zerolog.Logger) error { 119 | config, err := pgxpool.ParseConfig(DatabaseURL) 120 | if err != nil { 121 | return fmt.Errorf("failed to parse conn string (%s): %w", DatabaseURL, err) 122 | } 123 | 124 | config.ConnConfig.LogLevel = pgx.LogLevelDebug 125 | 126 | config.ConnConfig.Logger = zerologadapter.NewLogger(*logger) // логгер запросов в БД 127 | 128 | pool, err := pgxpool.ConnectConfig(ctx, config) 129 | if err != nil { 130 | return fmt.Errorf("unable to connect to database: %w", err) 131 | } 132 | 133 | a.logger = logger 134 | a.pool = pool 135 | a.repository = NewRepository(a.pool) 136 | 137 | return a.repository.InitSchema(ctx) 138 | } 139 | 140 | func (a *app) Serve() error { 141 | r := chi.NewRouter() 142 | 143 | r.Get("/users", http.HandlerFunc(a.usersHandler)) 144 | r.Get("/users/{id}", http.HandlerFunc(a.userHandler)) 145 | r.Get("/users/{id}/articles", http.HandlerFunc(a.userArticlesHandler)) 146 | r.Get("/panic", http.HandlerFunc(a.panicHandler)) 147 | 148 | return http.ListenAndServe("0.0.0.0:9000", r) 149 | } 150 | -------------------------------------------------------------------------------- /examples/logging/zerolog/http_utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | // writeResponse - вспомогательная функция, которая записывет http статус-код и текстовое сообщение в ответ клиенту. 10 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 11 | func writeResponse(w http.ResponseWriter, status int, message string) { 12 | w.WriteHeader(status) 13 | _, _ = w.Write([]byte(message)) 14 | _, _ = w.Write([]byte("\n")) 15 | } 16 | 17 | // writeJsonResponse - вспомогательная функция, которая запсывает http статус-код и сообщение в формате json в ответ клиенту. 18 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 19 | func writeJsonResponse(w http.ResponseWriter, status int, payload interface{}) { 20 | response, err := json.Marshal(payload) 21 | if err != nil { 22 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf("can't marshal data: %s", err)) 23 | return 24 | } 25 | 26 | w.Header().Set("Content-Type", "application/json") 27 | 28 | writeResponse(w, status, string(response)) 29 | } 30 | -------------------------------------------------------------------------------- /examples/logging/zerolog/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | 6 | "os" 7 | 8 | llog "log" 9 | 10 | "github.com/rs/zerolog" 11 | ) 12 | 13 | const ( 14 | DatabaseURL = "postgres://usr:pwd@localhost:5432/example?sslmode=disable" 15 | ) 16 | 17 | func main() { 18 | 19 | consoleWriter := zerolog.ConsoleWriter{Out: os.Stdout} 20 | 21 | multi := zerolog.MultiLevelWriter(consoleWriter, os.Stdout) 22 | logger := zerolog.New(multi).With().Timestamp().Logger() 23 | 24 | // logger.SetLevel(logrus.DebugLevel) 25 | // logger.SetFormatter(&logrus.JSONFormatter{}) 26 | 27 | a := app{} 28 | 29 | if err := a.Init(context.Background(), &logger); err != nil { 30 | llog.Fatal(err) 31 | } 32 | 33 | if err := a.Serve(); err != nil { 34 | llog.Fatal(err) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/logging/zerolog/models.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/google/uuid" 4 | 5 | type User struct { 6 | ID uuid.UUID `json:"id"` 7 | Name string `json:"name"` 8 | } 9 | 10 | type Article struct { 11 | ID uuid.UUID `json:"id"` 12 | Title string `json:"title"` 13 | Text string `json:"string"` 14 | 15 | UserID uuid.UUID `json:"user_id"` 16 | } 17 | -------------------------------------------------------------------------------- /examples/logging/zerolog/repository.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | 8 | "github.com/google/uuid" 9 | "github.com/jackc/pgx/v4/pgxpool" 10 | ) 11 | 12 | const ( 13 | DDL = ` 14 | DROP TABLE IF EXISTS articles; 15 | DROP TABLE IF EXISTS users; 16 | 17 | CREATE TABLE IF NOT EXISTS users 18 | ( 19 | id uuid NOT NULL 20 | CONSTRAINT users_pk 21 | PRIMARY KEY, 22 | name varchar(150) NOT NULL 23 | ); 24 | 25 | CREATE TABLE IF NOT EXISTS articles 26 | ( 27 | id uuid NOT NULL 28 | CONSTRAINT articles_pk 29 | PRIMARY KEY, 30 | title varchar(150) NOT NULL, 31 | text text NOT NULL, 32 | user_id uuid 33 | CONSTRAINT articles_users_id_fk 34 | REFERENCES users 35 | ); 36 | 37 | INSERT INTO public.users (id, name) VALUES ('b29f95a2-499a-4079-97f5-ff55c3854fcb', 'usr1'); 38 | INSERT INTO public.users (id, name) VALUES ('b6dede74-ad09-4bb7-a036-997ab3ab3130', 'usr2'); 39 | 40 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e4e12c87-88d8-413c-8ab6-57bfa4e953a8', 'article_11', 'some text', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 41 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('68792339-715c-4823-a4d5-a85cefec8d36', 'article_12', 'hello, world!', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 42 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e095e3a2-5b8e-4bc8-b793-bc3606c4fdd5', 'article_21', 'why so serious?', 'b6dede74-ad09-4bb7-a036-997ab3ab3130'); 43 | ` 44 | 45 | UsersSelect = `SELECT id, name FROM users` 46 | UserByIDSelect = `SELECT id, name FROM users WHERE id = $1` 47 | UserArticlesSelect = `SELECT id, title, text, user_id FROM articles WHERE user_id = $1` 48 | ) 49 | 50 | var ( 51 | ErrNotFound = errors.New("not found") 52 | ErrMultipleFound = errors.New("multiple found") 53 | ) 54 | 55 | type Repository struct { 56 | pool *pgxpool.Pool 57 | } 58 | 59 | func (r *Repository) InitSchema(ctx context.Context) error { 60 | _, err := r.pool.Exec(ctx, DDL) 61 | return err 62 | } 63 | 64 | func (r *Repository) GetUser(ctx context.Context, id uuid.UUID) (*User, error) { 65 | rows, _ := r.pool.Query(ctx, UserByIDSelect, id) 66 | 67 | var ( 68 | user User 69 | found bool 70 | ) 71 | 72 | for rows.Next() { 73 | if found { 74 | return nil, fmt.Errorf("%w: user id %s", ErrMultipleFound, id) 75 | } 76 | 77 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 78 | return nil, err 79 | } 80 | 81 | found = true 82 | } 83 | 84 | if err := rows.Err(); err != nil { 85 | return nil, err 86 | } 87 | 88 | if !found { 89 | return nil, fmt.Errorf("%w: user id %s", ErrNotFound, id) 90 | } 91 | 92 | return &user, nil 93 | } 94 | 95 | func (r *Repository) GetUsers(ctx context.Context) ([]User, error) { 96 | rows, _ := r.pool.Query(ctx, UsersSelect) 97 | 98 | ret := make([]User, 0) 99 | 100 | for rows.Next() { 101 | var user User 102 | 103 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 104 | return nil, err 105 | } 106 | 107 | ret = append(ret, user) 108 | } 109 | 110 | if err := rows.Err(); err != nil { 111 | return nil, err 112 | } 113 | 114 | return ret, nil 115 | } 116 | 117 | func (r *Repository) GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) { 118 | rows, _ := r.pool.Query(ctx, UserArticlesSelect, userID) 119 | 120 | ret := make([]Article, 0) 121 | 122 | for rows.Next() { 123 | var article Article 124 | 125 | if err := rows.Scan(&article.ID, &article.Title, &article.Text, &article.UserID); err != nil { 126 | return nil, err 127 | } 128 | 129 | ret = append(ret, article) 130 | } 131 | 132 | if err := rows.Err(); err != nil { 133 | return nil, err 134 | } 135 | 136 | return ret, nil 137 | } 138 | 139 | func NewRepository(pool *pgxpool.Pool) *Repository { 140 | return &Repository{pool: pool} 141 | } 142 | -------------------------------------------------------------------------------- /examples/metrics/opencensus/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "math/rand" 7 | "net/http" 8 | "strings" 9 | "time" 10 | 11 | "contrib.go.opencensus.io/exporter/prometheus" 12 | 13 | "go.opencensus.io/stats" 14 | "go.opencensus.io/stats/view" 15 | "go.opencensus.io/tag" 16 | ) 17 | 18 | var ( 19 | KeyMethod, _ = tag.NewKey("method") 20 | KeyStatus, _ = tag.NewKey("status") 21 | ) 22 | 23 | type app struct { 24 | pe *prometheus.Exporter 25 | 26 | MLatencyMs *stats.Float64Measure 27 | MLineLengths *stats.Int64Measure 28 | 29 | latencyView, 30 | lineCountView, 31 | lineLengthView, 32 | lastLineLengthView *view.View 33 | } 34 | 35 | func (a *app) processHandler(w http.ResponseWriter, r *http.Request) { 36 | startTime := time.Now() 37 | 38 | ctx, err := tag.New( 39 | r.Context(), 40 | tag.Insert(KeyMethod, r.Method), 41 | tag.Insert(KeyStatus, "OK")) 42 | 43 | if err != nil { 44 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf("tag error: %s", err)) 45 | return 46 | } 47 | 48 | line := r.URL.Query().Get("line") 49 | 50 | defer func() { 51 | stats.Record( 52 | ctx, 53 | a.MLatencyMs.M(sinceInMilliseconds(startTime)), 54 | a.MLineLengths.M(int64(len(line)))) 55 | }() 56 | 57 | time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) // имитация работы 58 | 59 | writeResponse(w, http.StatusOK, strings.ToUpper(line)) 60 | } 61 | 62 | func (a *app) Init() error { 63 | // время обработки в мс 64 | a.MLatencyMs = stats.Float64("repl/latency", "The latency in milliseconds per REPL loop", "ms") 65 | 66 | // распределение длин строк 67 | a.MLineLengths = stats.Int64("repl/line_lengths", "The distribution of line lengths", "By") 68 | 69 | // prometheus type: histogram 70 | a.latencyView = &view.View{ 71 | Name: "demo/latency", 72 | Measure: a.MLatencyMs, 73 | Description: "The distribution of the latencies", 74 | // границы гистограммы 75 | // [>=0ms, >=25ms, >=50ms, >=75ms, >=100ms, >=200ms, >=400ms, >=600ms, >=800ms, >=1s, >=2s, >=4s, >=6s] 76 | Aggregation: view.Distribution(0, 25, 50, 75, 100, 200, 400, 600, 800, 1000, 2000, 4000, 6000), 77 | TagKeys: []tag.Key{KeyMethod}} 78 | 79 | // prometheus type: counter 80 | a.lineCountView = &view.View{ 81 | Name: "demo/lines_in", 82 | Measure: a.MLineLengths, 83 | Description: "The number of lines from standard input", 84 | Aggregation: view.Count(), 85 | } 86 | 87 | // prometheus type: histogram 88 | a.lineLengthView = &view.View{ 89 | Name: "demo/line_lengths", 90 | Description: "Groups the lengths of keys in buckets", 91 | Measure: a.MLineLengths, 92 | // длины: [>=0B, >=5B, >=10B, >=15B, >=20B, >=40B, >=60B, >=80, >=100B, >=200B, >=400, >=600, >=800, >=1000] 93 | Aggregation: view.Distribution(0, 5, 10, 15, 20, 40, 60, 80, 100, 200, 400, 600, 800, 1000), 94 | } 95 | 96 | // prometheus type: gauge 97 | a.lastLineLengthView = &view.View{ 98 | Name: "demo/last_line_length", 99 | Measure: a.MLineLengths, 100 | Description: "The length of last line", 101 | Aggregation: view.LastValue(), 102 | } 103 | 104 | err := view.Register(a.latencyView, a.lineCountView, a.lineLengthView, a.lastLineLengthView) 105 | if err != nil { 106 | return err 107 | } 108 | 109 | a.pe, err = prometheus.NewExporter(prometheus.Options{ 110 | Namespace: "ocmetricsexample", 111 | }) 112 | 113 | return err 114 | } 115 | 116 | func (a *app) Serve() error { 117 | mux := http.NewServeMux() 118 | mux.Handle("/process", http.HandlerFunc(a.processHandler)) // /process?line=текст+тут 119 | mux.Handle("/metrics", a.pe) 120 | 121 | return http.ListenAndServe("0.0.0.0:9000", mux) 122 | } 123 | 124 | func main() { 125 | a := app{} 126 | 127 | if err := a.Init(); err != nil { 128 | log.Fatal(err) 129 | } 130 | 131 | if err := a.Serve(); err != nil { 132 | log.Fatal(err) 133 | } 134 | } 135 | 136 | func sinceInMilliseconds(startTime time.Time) float64 { 137 | return float64(time.Since(startTime).Nanoseconds()) / 1e6 138 | } 139 | 140 | func writeResponse(w http.ResponseWriter, status int, message string) { 141 | w.WriteHeader(status) 142 | _, _ = w.Write([]byte(message)) 143 | _, _ = w.Write([]byte("\n")) 144 | } 145 | -------------------------------------------------------------------------------- /examples/metrics/opentelementry/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "log" 7 | "math/rand" 8 | "net/http" 9 | "os" 10 | "os/signal" 11 | "strings" 12 | "time" 13 | 14 | "github.com/prometheus/client_golang/prometheus/promhttp" 15 | "go.opentelemetry.io/otel/attribute" 16 | "go.opentelemetry.io/otel/exporters/prometheus" 17 | "go.opentelemetry.io/otel/metric/instrument" 18 | "go.opentelemetry.io/otel/metric/instrument/syncfloat64" 19 | "go.opentelemetry.io/otel/metric/instrument/syncint64" 20 | "go.opentelemetry.io/otel/sdk/metric" 21 | ) 22 | 23 | var ( 24 | KeyMethod = attribute.Key("method") 25 | KeyStatus = attribute.Key("status") 26 | ) 27 | 28 | type app struct { 29 | attrs []attribute.KeyValue 30 | latencyMsRecorder syncfloat64.Histogram 31 | lineLengthRecorder syncint64.Histogram 32 | lineCounter syncint64.Counter 33 | lastLineLength syncint64.UpDownCounter 34 | } 35 | 36 | func (a *app) processHandler(w http.ResponseWriter, r *http.Request) { 37 | ctx := r.Context() 38 | startTime := time.Now() 39 | commonLabels := []attribute.KeyValue{KeyMethod.String(r.Method), KeyStatus.String("OK")} 40 | a.attrs = append(a.attrs, commonLabels...) 41 | 42 | line := r.URL.Query().Get("line") 43 | lineLength := int64(len(line)) 44 | 45 | defer func(ctx context.Context) { 46 | a.latencyMsRecorder.Record(ctx, sinceInMilliseconds(startTime), a.attrs...) 47 | a.lineLengthRecorder.Record(ctx, lineLength, a.attrs...) 48 | a.lineCounter.Add(ctx, 1, a.attrs...) 49 | a.lastLineLength.Add(ctx, lineLength, a.attrs...) 50 | }(ctx) 51 | 52 | time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) // имитация работы 53 | writeResponse(w, http.StatusOK, strings.ToUpper(line)) 54 | } 55 | 56 | func (a *app) initMeters(provider *metric.MeterProvider) error { 57 | var err error 58 | 59 | a.attrs = []attribute.KeyValue{ 60 | attribute.Key("A").String("B"), 61 | attribute.Key("C").String("D"), 62 | } 63 | 64 | meter := provider.Meter("rebrainmemetrics") 65 | 66 | a.latencyMsRecorder, err = meter.SyncFloat64(). 67 | Histogram("repl/latency", instrument.WithDescription("The distribution of the latencies")) 68 | if err != nil { 69 | return fmt.Errorf("%w", err) 70 | } 71 | 72 | a.lineLengthRecorder, err = meter.SyncInt64(). 73 | Histogram("repl/line_lengths", instrument.WithDescription("Groups the lengths of keys in buckets")) 74 | if err != nil { 75 | return fmt.Errorf("%w", err) 76 | } 77 | 78 | a.lineCounter, err = meter.SyncInt64(). 79 | UpDownCounter("repl/line_count", instrument.WithDescription("Count of lines")) 80 | if err != nil { 81 | return fmt.Errorf("%w", err) 82 | } 83 | 84 | a.lastLineLength, err = meter.SyncInt64(). 85 | UpDownCounter("repl/last_line_length", instrument.WithDescription("Last line length")) 86 | if err != nil { 87 | return fmt.Errorf("%w", err) 88 | } 89 | 90 | return err 91 | } 92 | 93 | func (a *app) Init(ctx context.Context) error { 94 | exporter, err := prometheus.New() 95 | if err != nil { 96 | return err 97 | } 98 | 99 | provider := metric.NewMeterProvider(metric.WithReader(exporter)) 100 | if err := a.initMeters(provider); err != nil { 101 | return err 102 | } 103 | 104 | // Start the prometheus HTTP server and pass the exporter Collector to it 105 | go a.Serve() 106 | 107 | ctx, _ = signal.NotifyContext(ctx, os.Interrupt) 108 | <-ctx.Done() 109 | 110 | return nil 111 | } 112 | 113 | func (a *app) Serve() error { 114 | log.Printf("serving metrics at http://localhost:9000/metrics") 115 | 116 | mux := http.NewServeMux() 117 | mux.Handle("/process", http.HandlerFunc(a.processHandler)) // /process?line=текст+тут 118 | mux.Handle("/metrics", promhttp.Handler()) 119 | 120 | server := &http.Server{ 121 | Handler: mux, 122 | Addr: "0.0.0.0:9000", 123 | ReadHeaderTimeout: 3 * time.Second, 124 | } 125 | 126 | err := server.ListenAndServe() 127 | if err != nil { 128 | return err 129 | } 130 | 131 | return err 132 | } 133 | 134 | func main() { 135 | ctx := context.Background() 136 | a := app{} 137 | 138 | if err := a.Init(ctx); err != nil { 139 | log.Fatal(err) 140 | } 141 | } 142 | 143 | func sinceInMilliseconds(startTime time.Time) float64 { 144 | return float64(time.Since(startTime).Nanoseconds()) / 1e6 145 | } 146 | 147 | func writeResponse(w http.ResponseWriter, status int, message string) { 148 | w.WriteHeader(status) 149 | _, _ = w.Write([]byte(message)) 150 | _, _ = w.Write([]byte("\n")) 151 | } 152 | -------------------------------------------------------------------------------- /examples/metrics/prometheus/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "math/rand" 6 | "net/http" 7 | "strings" 8 | "time" 9 | 10 | "github.com/prometheus/client_golang/prometheus" 11 | "github.com/prometheus/client_golang/prometheus/promhttp" 12 | ) 13 | 14 | const ( 15 | Namespace = "ocmetricsexample" 16 | 17 | LabelMethod = "method" 18 | LabelStatus = "status" 19 | ) 20 | 21 | type app struct { 22 | latencyHistogram, 23 | lineLengthHistogram *prometheus.HistogramVec 24 | 25 | lineCounter prometheus.Counter 26 | 27 | lastLineLengthGauge prometheus.Gauge 28 | } 29 | 30 | func (a *app) processHandler(w http.ResponseWriter, r *http.Request) { 31 | startTime := time.Now() 32 | 33 | line := r.URL.Query().Get("line") 34 | 35 | defer func() { 36 | a.latencyHistogram.With(prometheus.Labels{LabelMethod: r.Method}).Observe(sinceInMilliseconds(startTime)) 37 | 38 | a.lineLengthHistogram.With(prometheus.Labels{LabelStatus: "OK"}).Observe(float64(len(line))) 39 | 40 | a.lineCounter.Inc() 41 | 42 | a.lastLineLengthGauge.Set(float64(len(line))) 43 | }() 44 | 45 | time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) // имитация работы 46 | 47 | writeResponse(w, http.StatusOK, strings.ToUpper(line)) 48 | } 49 | 50 | func (a *app) Init() error { 51 | // prometheus type: histogram 52 | a.latencyHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ 53 | Namespace: Namespace, 54 | Name: "latency", 55 | Help: "The distribution of the latencies", 56 | Buckets: []float64{0, 25, 50, 75, 100, 200, 400, 600, 800, 1000, 2000, 4000, 6000}, 57 | }, []string{LabelMethod}) 58 | 59 | // prometheus type: histogram 60 | a.lineLengthHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ 61 | Namespace: Namespace, 62 | Name: "line_lengths", 63 | Help: "Groups the lengths of keys in buckets", 64 | // длины: [>=0B, >=5B, >=10B, >=15B, >=20B, >=40B, >=60B, >=80, >=100B, >=200B, >=400, >=600, >=800, >=1000] 65 | Buckets: []float64{0, 5, 10, 15, 20, 40, 60, 80, 100, 200, 400, 600, 800, 1000}, 66 | }, []string{LabelStatus}) 67 | 68 | // prometheus type: counter 69 | a.lineCounter = prometheus.NewCounter(prometheus.CounterOpts{ 70 | Namespace: Namespace, 71 | Name: "lines_in", 72 | Help: "The number of lines from standard input", 73 | }) 74 | 75 | // prometheus type: gauge 76 | a.lastLineLengthGauge = prometheus.NewGauge(prometheus.GaugeOpts{ 77 | Namespace: Namespace, 78 | Name: "last_line_length", 79 | Help: "The length of last line", 80 | }) 81 | 82 | prometheus.MustRegister(a.latencyHistogram) 83 | prometheus.MustRegister(a.lineLengthHistogram) 84 | prometheus.MustRegister(a.lineCounter) 85 | prometheus.MustRegister(a.lastLineLengthGauge) 86 | 87 | return nil 88 | } 89 | 90 | func (a *app) Serve() error { 91 | mux := http.NewServeMux() 92 | mux.Handle("/process", http.HandlerFunc(a.processHandler)) // /process?line=текст+тут 93 | mux.Handle("/metrics", promhttp.Handler()) 94 | 95 | return http.ListenAndServe("0.0.0.0:9000", mux) 96 | } 97 | 98 | func main() { 99 | a := app{} 100 | 101 | if err := a.Init(); err != nil { 102 | log.Fatal(err) 103 | } 104 | 105 | if err := a.Serve(); err != nil { 106 | log.Fatal(err) 107 | } 108 | } 109 | 110 | func sinceInMilliseconds(startTime time.Time) float64 { 111 | return float64(time.Since(startTime).Nanoseconds()) / 1e6 112 | } 113 | 114 | func writeResponse(w http.ResponseWriter, status int, message string) { 115 | w.WriteHeader(status) 116 | _, _ = w.Write([]byte(message)) 117 | _, _ = w.Write([]byte("\n")) 118 | } 119 | -------------------------------------------------------------------------------- /examples/tracing/jaeger/app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "net/http" 8 | 9 | "github.com/go-chi/chi/v5" 10 | "github.com/google/uuid" 11 | "github.com/jackc/pgx/v4" 12 | "github.com/jackc/pgx/v4/log/zapadapter" 13 | "github.com/jackc/pgx/v4/pgxpool" 14 | "github.com/opentracing/opentracing-go" 15 | "github.com/opentracing/opentracing-go/log" 16 | 17 | "go.uber.org/zap" 18 | "go.uber.org/zap/zapcore" 19 | 20 | "github.com/opentracing-contrib/go-stdlib/nethttp" 21 | ) 22 | 23 | type app struct { 24 | logger *zap.Logger 25 | tracer opentracing.Tracer 26 | 27 | pool *pgxpool.Pool 28 | repository *Repository 29 | } 30 | 31 | func (a *app) parseUserID(ctx context.Context, r *http.Request) (*uuid.UUID, error) { 32 | span, _ := opentracing.StartSpanFromContextWithTracer(ctx, a.tracer, "parseUserID") 33 | defer span.Finish() 34 | 35 | strUserID := chi.URLParam(r, "id") 36 | 37 | if strUserID == "" { 38 | return nil, nil 39 | } 40 | 41 | userID, err := uuid.Parse(strUserID) 42 | if err != nil { 43 | a.logger.Debug( 44 | fmt.Sprintf("failed to parse userID (uuid) from: '%s'", strUserID), 45 | zap.Field{Key: "error", String: err.Error(), Type: zapcore.StringType}, 46 | ) 47 | 48 | span.LogFields( 49 | log.Error(err), 50 | ) 51 | 52 | return nil, err 53 | } 54 | 55 | a.logger.Debug(fmt.Sprintf("userID parsed: %s", userID)) 56 | 57 | return &userID, nil 58 | } 59 | 60 | func (a *app) usersHandler(w http.ResponseWriter, r *http.Request) { 61 | span, ctx := opentracing.StartSpanFromContextWithTracer(r.Context(), a.tracer, "usersHandler") 62 | defer span.Finish() 63 | 64 | a.logger.Info("usersHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 65 | 66 | users, err := a.repository.GetUsers(ctx) 67 | if err != nil { 68 | msg := fmt.Sprintf(`failed to get users: %s`, err) 69 | 70 | a.logger.Error(msg) 71 | 72 | span.LogFields( 73 | log.Error(err), 74 | ) 75 | 76 | writeResponse(w, http.StatusInternalServerError, msg) 77 | return 78 | } 79 | 80 | writeJsonResponse(w, http.StatusOK, users) 81 | } 82 | 83 | func (a *app) userHandler(w http.ResponseWriter, r *http.Request) { 84 | span, ctx := opentracing.StartSpanFromContextWithTracer(r.Context(), a.tracer, "userHandler") 85 | defer span.Finish() 86 | 87 | a.logger.Info("userHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 88 | 89 | userID, err := a.parseUserID(ctx, r) 90 | if err != nil { 91 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 92 | return 93 | } 94 | 95 | user, err := a.repository.GetUser(ctx, *userID) 96 | if err != nil { 97 | status := http.StatusInternalServerError 98 | 99 | switch { 100 | case errors.Is(err, ErrNotFound): 101 | status = http.StatusNotFound 102 | default: 103 | span.LogFields( 104 | log.Error(err), 105 | ) 106 | } 107 | 108 | writeResponse(w, status, fmt.Sprintf(`failed to get user with id %s: %s`, userID, err)) 109 | return 110 | } 111 | 112 | writeJsonResponse(w, http.StatusOK, user) 113 | } 114 | 115 | func (a *app) userArticlesHandler(w http.ResponseWriter, r *http.Request) { 116 | span, ctx := opentracing.StartSpanFromContextWithTracer(r.Context(), a.tracer, "userArticlesHandler") 117 | defer span.Finish() 118 | 119 | a.logger.Info("userArticlesHandler called", zap.Field{Key: "method", String: r.Method, Type: zapcore.StringType}) 120 | 121 | userID, err := a.parseUserID(ctx, r) 122 | if err != nil { 123 | span.LogFields( 124 | log.Error(err), 125 | ) 126 | 127 | writeResponse(w, http.StatusBadRequest, fmt.Sprintf(`failed to parse user's id: %s`, err)) 128 | return 129 | } 130 | 131 | articles, err := a.repository.GetUserArticles(ctx, *userID) 132 | if err != nil { 133 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf(`failed to get user's (id: %s) articles: %s`, userID, err)) 134 | return 135 | } 136 | 137 | writeJsonResponse(w, http.StatusOK, articles) 138 | } 139 | 140 | func (a *app) panicHandler(w http.ResponseWriter, r *http.Request) { 141 | defer func() { 142 | _ = recover() 143 | 144 | writeResponse(w, http.StatusOK, "panic logged, see server log") 145 | }() 146 | 147 | a.logger.Panic("panic!!!") 148 | } 149 | 150 | func (a *app) Init(ctx context.Context, logger *zap.Logger, tracer opentracing.Tracer) error { 151 | config, err := pgxpool.ParseConfig(DatabaseURL) 152 | if err != nil { 153 | return fmt.Errorf("failed to parse conn string (%s): %w", DatabaseURL, err) 154 | } 155 | 156 | config.ConnConfig.LogLevel = pgx.LogLevelDebug 157 | config.ConnConfig.Logger = zapadapter.NewLogger(logger) // логгер запросов в БД 158 | 159 | pool, err := pgxpool.ConnectConfig(ctx, config) 160 | if err != nil { 161 | return fmt.Errorf("unable to connect to database: %w", err) 162 | } 163 | 164 | a.logger = logger 165 | a.tracer = tracer 166 | a.pool = pool 167 | a.repository = NewRepository(a.pool, a.tracer) 168 | 169 | return a.repository.InitSchema(ctx) 170 | } 171 | 172 | func (a *app) Serve() error { 173 | r := chi.NewRouter() 174 | 175 | r.Get("/users", http.HandlerFunc(a.usersHandler)) 176 | r.Get("/users/{id}", http.HandlerFunc(a.userHandler)) 177 | r.Get("/users/{id}/articles", http.HandlerFunc(a.userArticlesHandler)) 178 | r.Get("/panic", http.HandlerFunc(a.panicHandler)) 179 | 180 | return http.ListenAndServe("0.0.0.0:9000", nethttp.Middleware(a.tracer, r)) 181 | } 182 | -------------------------------------------------------------------------------- /examples/tracing/jaeger/http_utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | // writeResponse - вспомогательная функция, которая записывет http статус-код и текстовое сообщение в ответ клиенту. 10 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 11 | func writeResponse(w http.ResponseWriter, status int, message string) { 12 | w.WriteHeader(status) 13 | _, _ = w.Write([]byte(message)) 14 | _, _ = w.Write([]byte("\n")) 15 | } 16 | 17 | // writeJsonResponse - вспомогательная функция, которая запсывает http статус-код и сообщение в формате json в ответ клиенту. 18 | // Нужна для уменьшения дублирования кода и улучшения читаемости кода вызывающей функции. 19 | func writeJsonResponse(w http.ResponseWriter, status int, payload interface{}) { 20 | response, err := json.Marshal(payload) 21 | if err != nil { 22 | writeResponse(w, http.StatusInternalServerError, fmt.Sprintf("can't marshal data: %s", err)) 23 | return 24 | } 25 | 26 | w.Header().Set("Content-Type", "application/json") 27 | 28 | writeResponse(w, status, string(response)) 29 | } 30 | -------------------------------------------------------------------------------- /examples/tracing/jaeger/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "io" 7 | "log" 8 | 9 | "github.com/opentracing/opentracing-go" 10 | "github.com/uber/jaeger-client-go/config" 11 | "go.uber.org/zap" 12 | ) 13 | 14 | const ( 15 | DatabaseURL = "postgres://usr:pwd@localhost:5432/example?sslmode=disable" 16 | ) 17 | 18 | type zapWrapper struct { 19 | logger *zap.Logger 20 | } 21 | 22 | // Error logs a message at error priority 23 | func (w *zapWrapper) Error(msg string) { 24 | w.logger.Error(msg) 25 | } 26 | 27 | // Infof logs a message at info priority 28 | func (w *zapWrapper) Infof(msg string, args ...interface{}) { 29 | w.logger.Sugar().Infof(msg, args...) 30 | } 31 | 32 | func initJaeger(service string, logger *zap.Logger) (opentracing.Tracer, io.Closer) { 33 | cfg := &config.Configuration{ 34 | ServiceName: service, 35 | Sampler: &config.SamplerConfig{ 36 | Type: "const", 37 | Param: 1, 38 | }, 39 | Reporter: &config.ReporterConfig{ 40 | LogSpans: true, 41 | }, 42 | } 43 | 44 | tracer, closer, err := cfg.NewTracer(config.Logger(&zapWrapper{logger: logger})) 45 | if err != nil { 46 | panic(fmt.Sprintf("ERROR: cannot init Jaeger: %v\n", err)) 47 | } 48 | 49 | return tracer, closer 50 | } 51 | 52 | func main() { 53 | // Предустановленный конфиг. Можно выбрать NewProduction/NewDevelopment/NewExample или создать свой 54 | // Production - уровень логгирования InfoLevel, формат вывода: json 55 | // Development - уровень логгирования DebugLevel, формат вывода: console 56 | logger, err := zap.NewDevelopment() 57 | if err != nil { 58 | log.Fatal(err) 59 | } 60 | 61 | defer func() { _ = logger.Sync() }() 62 | 63 | // Трейсер 64 | tracer, closer := initJaeger("example", logger) 65 | defer closer.Close() 66 | 67 | // можно установить глобальный логгер (но лучше не надо: используйте внедрение зависимостей где это возможно) 68 | // undo := zap.ReplaceGlobals(logger) 69 | // defer undo() 70 | 71 | // zap.L().Info("replaced zap's global loggers") 72 | 73 | a := app{} 74 | 75 | if err := a.Init(context.Background(), logger, tracer); err != nil { 76 | log.Fatal(err) 77 | } 78 | 79 | if err := a.Serve(); err != nil { 80 | log.Fatal(err) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /examples/tracing/jaeger/models.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/google/uuid" 4 | 5 | type User struct { 6 | ID uuid.UUID `json:"id"` 7 | Name string `json:"name"` 8 | } 9 | 10 | type Article struct { 11 | ID uuid.UUID `json:"id"` 12 | Title string `json:"title"` 13 | Text string `json:"string"` 14 | 15 | UserID uuid.UUID `json:"user_id"` 16 | } 17 | -------------------------------------------------------------------------------- /examples/tracing/jaeger/repository.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | 8 | "github.com/google/uuid" 9 | "github.com/jackc/pgx/v4/pgxpool" 10 | "github.com/opentracing/opentracing-go" 11 | "github.com/opentracing/opentracing-go/log" 12 | ) 13 | 14 | const ( 15 | DDL = ` 16 | DROP TABLE IF EXISTS articles; 17 | DROP TABLE IF EXISTS users; 18 | 19 | CREATE TABLE IF NOT EXISTS users 20 | ( 21 | id uuid NOT NULL 22 | CONSTRAINT users_pk 23 | PRIMARY KEY, 24 | name varchar(150) NOT NULL 25 | ); 26 | 27 | CREATE TABLE IF NOT EXISTS articles 28 | ( 29 | id uuid NOT NULL 30 | CONSTRAINT articles_pk 31 | PRIMARY KEY, 32 | title varchar(150) NOT NULL, 33 | text text NOT NULL, 34 | user_id uuid 35 | CONSTRAINT articles_users_id_fk 36 | REFERENCES users 37 | ); 38 | 39 | INSERT INTO public.users (id, name) VALUES ('b29f95a2-499a-4079-97f5-ff55c3854fcb', 'usr1'); 40 | INSERT INTO public.users (id, name) VALUES ('b6dede74-ad09-4bb7-a036-997ab3ab3130', 'usr2'); 41 | 42 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e4e12c87-88d8-413c-8ab6-57bfa4e953a8', 'article_11', 'some text', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 43 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('68792339-715c-4823-a4d5-a85cefec8d36', 'article_12', 'hello, world!', 'b29f95a2-499a-4079-97f5-ff55c3854fcb'); 44 | INSERT INTO public.articles (id, title, text, user_id) VALUES ('e095e3a2-5b8e-4bc8-b793-bc3606c4fdd5', 'article_21', 'why so serious?', 'b6dede74-ad09-4bb7-a036-997ab3ab3130'); 45 | ` 46 | 47 | UsersSelect = `SELECT id, name FROM users` 48 | UserByIDSelect = `SELECT id, name FROM users WHERE id = $1` 49 | UserArticlesSelect = `SELECT id, title, text, user_id FROM articles WHERE user_id = $1` 50 | ) 51 | 52 | var ( 53 | ErrNotFound = errors.New("not found") 54 | ErrMultipleFound = errors.New("multiple found") 55 | ) 56 | 57 | type Repository struct { 58 | pool *pgxpool.Pool 59 | tracer opentracing.Tracer 60 | } 61 | 62 | func (r *Repository) InitSchema(ctx context.Context) error { 63 | span, ctx := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, "Repository.InitSchema") 64 | defer span.Finish() 65 | 66 | _, err := r.pool.Exec(ctx, DDL) 67 | return err 68 | } 69 | 70 | func (r *Repository) GetUser(ctx context.Context, id uuid.UUID) (*User, error) { 71 | span, ctx := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, "Repository.GetUser") 72 | defer span.Finish() 73 | 74 | span.LogFields( 75 | log.String("query", UsersSelect), 76 | log.String("arg0", id.String()), 77 | ) 78 | 79 | rows, _ := r.pool.Query(ctx, UserByIDSelect, id) 80 | 81 | var ( 82 | user User 83 | found bool 84 | ) 85 | 86 | for rows.Next() { 87 | if found { 88 | return nil, fmt.Errorf("%w: user id %s", ErrMultipleFound, id) 89 | } 90 | 91 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 92 | return nil, err 93 | } 94 | 95 | found = true 96 | } 97 | 98 | if err := rows.Err(); err != nil { 99 | return nil, err 100 | } 101 | 102 | if !found { 103 | return nil, fmt.Errorf("%w: user id %s", ErrNotFound, id) 104 | } 105 | 106 | return &user, nil 107 | } 108 | 109 | func (r *Repository) GetUsers(ctx context.Context) ([]User, error) { 110 | span, ctx := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, "Repository.GetUsers") 111 | defer span.Finish() 112 | 113 | span.LogFields( 114 | log.String("query", UsersSelect), 115 | ) 116 | 117 | rows, _ := r.pool.Query(ctx, UsersSelect) 118 | 119 | ret := make([]User, 0) 120 | 121 | for rows.Next() { 122 | var user User 123 | 124 | if err := rows.Scan(&user.ID, &user.Name); err != nil { 125 | return nil, err 126 | } 127 | 128 | ret = append(ret, user) 129 | } 130 | 131 | if err := rows.Err(); err != nil { 132 | return nil, err 133 | } 134 | 135 | return ret, nil 136 | } 137 | 138 | func (r *Repository) GetUserArticles(ctx context.Context, userID uuid.UUID) ([]Article, error) { 139 | span, ctx := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, "Repository.GetUserArticles") 140 | defer span.Finish() 141 | 142 | span.LogFields( 143 | log.String("query", UsersSelect), 144 | log.String("arg0", userID.String()), 145 | ) 146 | 147 | rows, _ := r.pool.Query(ctx, UserArticlesSelect, userID) 148 | 149 | ret := make([]Article, 0) 150 | 151 | for rows.Next() { 152 | var article Article 153 | 154 | if err := rows.Scan(&article.ID, &article.Title, &article.Text, &article.UserID); err != nil { 155 | return nil, err 156 | } 157 | 158 | ret = append(ret, article) 159 | } 160 | 161 | if err := rows.Err(); err != nil { 162 | return nil, err 163 | } 164 | 165 | return ret, nil 166 | } 167 | 168 | func NewRepository(pool *pgxpool.Pool, tracer opentracing.Tracer) *Repository { 169 | return &Repository{pool: pool, tracer: tracer} 170 | } 171 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/SergeyParamoshkin/rebrainme 2 | 3 | go 1.19 4 | 5 | require ( 6 | contrib.go.opencensus.io/exporter/prometheus v0.4.2 7 | github.com/go-chi/chi/v5 v5.0.8 8 | github.com/go-redis/cache/v8 v8.4.4 9 | github.com/go-redis/redis/v8 v8.11.5 10 | github.com/google/uuid v1.3.0 11 | github.com/jackc/pgx/v4 v4.17.2 12 | github.com/opentracing-contrib/go-stdlib v1.0.0 13 | github.com/opentracing/opentracing-go v1.2.0 14 | github.com/prometheus/client_golang v1.14.0 15 | github.com/rs/zerolog v1.15.0 16 | github.com/sirupsen/logrus v1.9.0 17 | github.com/uber/jaeger-client-go v2.30.0+incompatible 18 | go.opencensus.io v0.24.0 19 | go.opentelemetry.io/otel v1.11.2 20 | go.opentelemetry.io/otel/exporters/prometheus v0.34.0 21 | go.opentelemetry.io/otel/metric v0.34.0 22 | go.opentelemetry.io/otel/sdk/metric v0.34.0 23 | go.uber.org/zap v1.24.0 24 | google.golang.org/grpc v1.52.0 25 | google.golang.org/protobuf v1.28.1 26 | ) 27 | 28 | require ( 29 | github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect 30 | github.com/benbjohnson/clock v1.3.0 // indirect 31 | github.com/beorn7/perks v1.0.1 // indirect 32 | github.com/cespare/xxhash/v2 v2.2.0 // indirect 33 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect 34 | github.com/go-kit/log v0.2.1 // indirect 35 | github.com/go-logfmt/logfmt v0.5.1 // indirect 36 | github.com/go-logr/logr v1.2.3 // indirect 37 | github.com/go-logr/stdr v1.2.2 // indirect 38 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 39 | github.com/golang/protobuf v1.5.2 // indirect 40 | github.com/jackc/chunkreader/v2 v2.0.1 // indirect 41 | github.com/jackc/pgconn v1.13.0 // indirect 42 | github.com/jackc/pgio v1.0.0 // indirect 43 | github.com/jackc/pgpassfile v1.0.0 // indirect 44 | github.com/jackc/pgproto3/v2 v2.3.1 // indirect 45 | github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect 46 | github.com/jackc/pgtype v1.13.0 // indirect 47 | github.com/jackc/puddle v1.3.0 // indirect 48 | github.com/klauspost/compress v1.15.15 // indirect 49 | github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect 50 | github.com/pkg/errors v0.9.1 // indirect 51 | github.com/prometheus/client_model v0.3.0 // indirect 52 | github.com/prometheus/common v0.39.0 // indirect 53 | github.com/prometheus/procfs v0.9.0 // indirect 54 | github.com/prometheus/statsd_exporter v0.23.0 // indirect 55 | github.com/uber/jaeger-lib v2.4.1+incompatible // indirect 56 | github.com/vmihailenco/go-tinylfu v0.2.2 // indirect 57 | github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect 58 | github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect 59 | go.opentelemetry.io/otel/sdk v1.11.2 // indirect 60 | go.opentelemetry.io/otel/trace v1.11.2 // indirect 61 | go.uber.org/atomic v1.10.0 // indirect 62 | go.uber.org/multierr v1.9.0 // indirect 63 | golang.org/x/crypto v0.5.0 // indirect 64 | golang.org/x/net v0.5.0 // indirect 65 | golang.org/x/sync v0.1.0 // indirect 66 | golang.org/x/sys v0.4.0 // indirect 67 | golang.org/x/text v0.6.0 // indirect 68 | google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect 69 | gopkg.in/yaml.v2 v2.4.0 // indirect 70 | ) 71 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 7 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 8 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 9 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 10 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 11 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 12 | cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= 13 | cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= 14 | cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= 15 | cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= 16 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 17 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 18 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 19 | cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= 20 | cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= 21 | cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= 22 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 23 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 24 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 25 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 26 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 27 | cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= 28 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 29 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 30 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 31 | cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= 32 | cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= 33 | contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= 34 | contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= 35 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 36 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 37 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 38 | github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= 39 | github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= 40 | github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= 41 | github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= 42 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 43 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 44 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 45 | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 46 | github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= 47 | github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= 48 | github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 49 | github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 50 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 51 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 52 | github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 53 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 54 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 55 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 56 | github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 57 | github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 58 | github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 59 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 60 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 61 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 62 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 63 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 64 | github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= 65 | github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= 66 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 67 | github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 68 | github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 69 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 70 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 71 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 72 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 73 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= 74 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= 75 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 76 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 77 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 78 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 79 | github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= 80 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 81 | github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= 82 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 83 | github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= 84 | github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= 85 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 86 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 87 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 88 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 89 | github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 90 | github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= 91 | github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= 92 | github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= 93 | github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= 94 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 95 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 96 | github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= 97 | github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= 98 | github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= 99 | github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 100 | github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= 101 | github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 102 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 103 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 104 | github.com/go-redis/cache/v8 v8.4.4 h1:Rm0wZ55X22BA2JMqVtRQNHYyzDd0I5f+Ec/C9Xx3mXY= 105 | github.com/go-redis/cache/v8 v8.4.4/go.mod h1:JM6CkupsPvAu/LYEVGQy6UB4WDAzQSXkR0lUCbeIcKc= 106 | github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= 107 | github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= 108 | github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= 109 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 110 | github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= 111 | github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= 112 | github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= 113 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 114 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= 115 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 116 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 117 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 118 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 119 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= 120 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 121 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 122 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 123 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 124 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 125 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 126 | github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 127 | github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 128 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 129 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 130 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 131 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 132 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 133 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 134 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 135 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 136 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 137 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 138 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 139 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 140 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 141 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 142 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 143 | github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= 144 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 145 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 146 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 147 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 148 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 149 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 150 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 151 | github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 152 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 153 | github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 154 | github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 155 | github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 156 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 157 | github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 158 | github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 159 | github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= 160 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 161 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 162 | github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 163 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 164 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 165 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 166 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 167 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 168 | github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 169 | github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 170 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 171 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 172 | github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= 173 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 174 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 175 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 176 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 177 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 178 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 179 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 180 | github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= 181 | github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= 182 | github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= 183 | github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= 184 | github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= 185 | github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= 186 | github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= 187 | github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= 188 | github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= 189 | github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= 190 | github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= 191 | github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= 192 | github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= 193 | github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= 194 | github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= 195 | github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= 196 | github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= 197 | github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= 198 | github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= 199 | github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= 200 | github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= 201 | github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= 202 | github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= 203 | github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= 204 | github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= 205 | github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= 206 | github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= 207 | github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= 208 | github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= 209 | github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= 210 | github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= 211 | github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= 212 | github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= 213 | github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= 214 | github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= 215 | github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= 216 | github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= 217 | github.com/jackc/pgtype v1.13.0 h1:XkIc7A+1BmZD19bB2NxrtjJweHxQ9agqvM+9URc68Cg= 218 | github.com/jackc/pgtype v1.13.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= 219 | github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= 220 | github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= 221 | github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= 222 | github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= 223 | github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E= 224 | github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= 225 | github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 226 | github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 227 | github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 228 | github.com/jackc/puddle v1.3.0 h1:eHK/5clGOatcjX3oWGBO/MpxpbHzSwud5EWTSCI+MX0= 229 | github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 230 | github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 231 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 232 | github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 233 | github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 234 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 235 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 236 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 237 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 238 | github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 239 | github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= 240 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 241 | github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= 242 | github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= 243 | github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= 244 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 245 | github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 246 | github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 247 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 248 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 249 | github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= 250 | github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= 251 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 252 | github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= 253 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 254 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 255 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 256 | github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 257 | github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 258 | github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 259 | github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= 260 | github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 261 | github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= 262 | github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 263 | github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 264 | github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 265 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 266 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 267 | github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= 268 | github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= 269 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 270 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 271 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 272 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 273 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 274 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 275 | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 276 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 277 | github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= 278 | github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= 279 | github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= 280 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 281 | github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= 282 | github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= 283 | github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= 284 | github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= 285 | github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= 286 | github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= 287 | github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= 288 | github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= 289 | github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= 290 | github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 291 | github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= 292 | github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= 293 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 294 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 295 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 296 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 297 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 298 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 299 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 300 | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= 301 | github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= 302 | github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= 303 | github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= 304 | github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= 305 | github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= 306 | github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= 307 | github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= 308 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 309 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 310 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 311 | github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 312 | github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= 313 | github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= 314 | github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 315 | github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= 316 | github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= 317 | github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= 318 | github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= 319 | github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= 320 | github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= 321 | github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= 322 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 323 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 324 | github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 325 | github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 326 | github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 327 | github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= 328 | github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= 329 | github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= 330 | github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= 331 | github.com/prometheus/statsd_exporter v0.23.0 h1:GEkriUCmARYh1gSA0gzpvmTg/oHMc5MfDFNlS/che4E= 332 | github.com/prometheus/statsd_exporter v0.23.0/go.mod h1:1itCY9XMa2p5pjO5HseGjs5cnaIA5qxLCYmn3OUna58= 333 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 334 | github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= 335 | github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= 336 | github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= 337 | github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= 338 | github.com/rs/zerolog v1.15.0 h1:uPRuwkWF4J6fGsJ2R0Gn2jB1EQiav9k3S6CSdygQJXY= 339 | github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= 340 | github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= 341 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= 342 | github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= 343 | github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 344 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 345 | github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= 346 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 347 | github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 348 | github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= 349 | github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 350 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 351 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 352 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 353 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 354 | github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= 355 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 356 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 357 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 358 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 359 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 360 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 361 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 362 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 363 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 364 | github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= 365 | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 366 | github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= 367 | github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= 368 | github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= 369 | github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= 370 | github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= 371 | github.com/vmihailenco/go-tinylfu v0.2.2 h1:H1eiG6HM36iniK6+21n9LLpzx1G9R3DJa2UjUjbynsI= 372 | github.com/vmihailenco/go-tinylfu v0.2.2/go.mod h1:CutYi2Q9puTxfcolkliPq4npPuofg9N9t8JVrjzwa3Q= 373 | github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= 374 | github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= 375 | github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= 376 | github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= 377 | github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= 378 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 379 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 380 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 381 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 382 | github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= 383 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 384 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 385 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 386 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 387 | go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 388 | go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= 389 | go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= 390 | go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= 391 | go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= 392 | go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= 393 | go.opentelemetry.io/otel/exporters/prometheus v0.34.0 h1:L5D+HxdaC/ORB47ribbTBbkXRZs9JzPjq0EoIOMWncM= 394 | go.opentelemetry.io/otel/exporters/prometheus v0.34.0/go.mod h1:6gUoJyfhoWqF0tOLaY0ZmKgkQRcvEQx6p5rVlKHp3s4= 395 | go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= 396 | go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= 397 | go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= 398 | go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= 399 | go.opentelemetry.io/otel/sdk/metric v0.34.0 h1:7ElxfQpXCFZlRTvVRTkcUvK8Gt5DC8QzmzsLsO2gdzo= 400 | go.opentelemetry.io/otel/sdk/metric v0.34.0/go.mod h1:l4r16BIqiqPy5rd14kkxllPy/fOI4tWo1jkpD9Z3ffQ= 401 | go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= 402 | go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= 403 | go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 404 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 405 | go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 406 | go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 407 | go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= 408 | go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= 409 | go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= 410 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 411 | go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= 412 | go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= 413 | go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= 414 | go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= 415 | go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 416 | go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 417 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 418 | go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= 419 | go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= 420 | go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= 421 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 422 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 423 | golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 424 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 425 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 426 | golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 427 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 428 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 429 | golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= 430 | golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 431 | golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 432 | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 433 | golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= 434 | golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= 435 | golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 436 | golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 437 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 438 | golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 439 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 440 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 441 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 442 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 443 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 444 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 445 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 446 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 447 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 448 | golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= 449 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 450 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 451 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 452 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 453 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 454 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 455 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 456 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 457 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 458 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 459 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 460 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 461 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 462 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 463 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 464 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 465 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 466 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 467 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 468 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 469 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 470 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 471 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 472 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 473 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 474 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 475 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 476 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 477 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 478 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 479 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 480 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 481 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 482 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 483 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 484 | golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 485 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 486 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 487 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 488 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 489 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 490 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 491 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 492 | golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 493 | golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 494 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 495 | golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 496 | golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 497 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 498 | golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 499 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 500 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 501 | golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 502 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 503 | golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= 504 | golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 505 | golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 506 | golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 507 | golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 508 | golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= 509 | golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= 510 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 511 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 512 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 513 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 514 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 515 | golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 516 | golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 517 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 518 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 519 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 520 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 521 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 522 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 523 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 524 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 525 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 526 | golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 527 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 528 | golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 529 | golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= 530 | golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 531 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 532 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 533 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 534 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 535 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 536 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 537 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 538 | golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 539 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 540 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 541 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 542 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 543 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 544 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 545 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 546 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 547 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 548 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 549 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 550 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 551 | golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 552 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 553 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 554 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 555 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 556 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 557 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 558 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 559 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 560 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 561 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 562 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 563 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 564 | golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 565 | golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 566 | golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 567 | golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 568 | golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 569 | golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 570 | golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 571 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 572 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 573 | golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 574 | golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 575 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 576 | golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 577 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 578 | golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 579 | golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 580 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 581 | golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 582 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 583 | golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= 584 | golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 585 | golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 586 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 587 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 588 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 589 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 590 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 591 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 592 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 593 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 594 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 595 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 596 | golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= 597 | golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 598 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 599 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 600 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 601 | golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 602 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 603 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 604 | golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 605 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 606 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 607 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 608 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 609 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 610 | golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 611 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 612 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 613 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 614 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 615 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 616 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 617 | golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 618 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 619 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 620 | golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 621 | golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 622 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 623 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 624 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 625 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 626 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 627 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 628 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 629 | golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 630 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 631 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 632 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 633 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 634 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 635 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 636 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 637 | golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 638 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 639 | golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 640 | golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= 641 | golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 642 | golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 643 | golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 644 | golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 645 | golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 646 | golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 647 | golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 648 | golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 649 | golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 650 | golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 651 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 652 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 653 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 654 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 655 | gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= 656 | gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= 657 | gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= 658 | gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= 659 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 660 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 661 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 662 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 663 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 664 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 665 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 666 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 667 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 668 | google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 669 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 670 | google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 671 | google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 672 | google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 673 | google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= 674 | google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 675 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 676 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 677 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 678 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 679 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 680 | google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 681 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 682 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 683 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 684 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 685 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 686 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 687 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 688 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 689 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 690 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 691 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 692 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 693 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 694 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 695 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 696 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 697 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 698 | google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 699 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 700 | google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 701 | google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 702 | google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 703 | google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 704 | google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= 705 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 706 | google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= 707 | google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 708 | google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 709 | google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 710 | google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= 711 | google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= 712 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 713 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 714 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 715 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 716 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 717 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 718 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 719 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 720 | google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= 721 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= 722 | google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 723 | google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 724 | google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= 725 | google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= 726 | google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= 727 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 728 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 729 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 730 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 731 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 732 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 733 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 734 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 735 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 736 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 737 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 738 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 739 | google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 740 | google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= 741 | google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 742 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 743 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 744 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 745 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 746 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 747 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 748 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 749 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 750 | gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= 751 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 752 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 753 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 754 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 755 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 756 | gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 757 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 758 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 759 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 760 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 761 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 762 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 763 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 764 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 765 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 766 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 767 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 768 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 769 | honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 770 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 771 | rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 772 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 773 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 774 | -------------------------------------------------------------------------------- /process.http: -------------------------------------------------------------------------------- 1 | GET http://localhost:9000/process?line=текст+тweqweqweqweqwт 2 | content-type: application/json 3 | 4 | ### 5 | GET http://localhost:9000/process?line=текст+там 6 | content-type: application/json 7 | 8 | ### 9 | GET http://localhost:9000/users 10 | 11 | ### 12 | GET http://localhost:9000/panic 13 | 14 | ### 15 | GET http://localhost:9000/metrics 16 | content-type: application/json --------------------------------------------------------------------------------