Skip to content

gebv/go-skeleton

Repository files navigation

go-skeleton

Skeleton of the golang project.

NOTE: this is not a universal skeleton - one option, among others.

Feature

  • config from Consul
    • reloader
    • vault
  • config zap logger for dev and prod
    • (option) integration to Sentry
  • metrics collection (prometheus)
  • e2e tests
    • go
    • (experiments) java
    • (experiments) python
    • (experiments) nodejs
  • right main.go
    • step-by-step application start
    • handle termination os signals
    • graceful shutdown

Tools:

  • Code generation

Examples

app1

Follow an example of an API (gRPC + gRPC-web + REST) + e2e tests

Simple setup Consul, Promethes and Alertmanager

Configure prometheus via Consul service discovery.

global:
  scrape_interval:     15s
  evaluation_interval: 15s

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
       - 127.0.0.1:9093

rule_files:
   - "/etc/prometheus/rules/*.rules"

scrape_configs:
    - job_name: 'consul_sd'
    consul_sd_configs:
        - server: 'localhost:8500'
        services: []
    relabel_configs:
        - source_labels: ['__meta_consul_service']
        regex: '(.*)consul(.*)'
        action: drop
        - source_labels: ['__meta_consul_node']
        target_label: instance
        - source_labels: ['__meta_consul_service']
        target_label: service
        - source_labels: ['__meta_consul_tags']
        target_label: tags

TODO: Example config Alertmanager for gRPC

About

Skeleton of the golang project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors