Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ozonva/ova-joke-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ozonva/ova-joke-api

  • v0.0.0-20210908093751-470b14225d68
  • Source
  • Go
  • Socket score

Version published
Created
Source

ova-joke-api

codecov example workflow gomod version

Ozon Golang school project

This application provides API for Joke entity management system. All data stored in OLTP database PostgreSQL. Service provides:

  • creating new jokes,
  • multiple creating,
  • updating them,
  • removing,
  • reading specific joke,
  • reading joke ranges specified by offset and limit.

Used components and ports

ComponentDescriptionPort
dbPostgreSQL OLTP database, used as persistent storage5432
zookeeperZooKeeper- configuration management system for kafka2181
kafkaApache Kafka- message broker9092
kafkauiKowl- web ui for kafka, allow observe broker state8087
jaegerJaeger- tracing system16686
prometheusPrometheus- metric management system9091
grafanaProject metrics visualization3000
godocDocumentation pages about project components and deps9099
gRPC APIApplication API endpoint9090
metrics APIApplication metrics endpoint for Prometheus9093

Configuration:

FlagConfig pathEnvDefault valueDescription
--grpc.addrgrpc.addrOVA_GRPC_ADDR0.0.0.0.9090addr:port of gRPC server endpoint
--flusher.chunksizeflusher.chunksizeOVA_FLUSHER_CHUNKSIZE3insert database batch size
--db.hostdb.hostOVA_DB_HOSTlocalhosthost for database
--db.portdb.portOVA_DB_PORT5432database port
--db.namedb.nameOVA_DB_NAMEpostgresdatabase name
--db.userdb.userOVA_DB_USERpostgresdatabase user name
--db.passdb.passOVA_DB_PASSpostgresdatabase user's password
--metrics.addrmetrics.addrOVA_METRICS_ADDR0.0.0.0:9093addr of metrics exporter api
--broker.addrsbroker.addrsOVA_BROKER_ADDRS[0.0.0.0:9092]addr of metrics exporter api

Settings appied in priority:

  • flag

  • env

  • config

    Passing several values for broker.addrs, see viper and pflags for more information:

# using options:
ova-joke-api --broker.addrs=127.0.0.1:9092 --broker.addrs=127.0.0.1:9093
# using envs:
OVA_BROKER_ADDRS=127.0.0.1:9092,127.0.0.1:9093 ova-joke-api

Run service:

  1. launch docker env:
docker-compose up

2.1 run api server using golang:

make run
# or call directly:
# go run cmd/ova-joke-api/main.go

2.2. or using binary:

# compile binary
make build
# run binary
./bin/ova-joke-api

Development:

  1. Linters- used golangci-lint. For more information about linter configuration see .golangci.yml.
# run using make:
make lint
# or directly:
golangci-lint run ./...
  1. Tests
# run using make:
make test
# or directly:
go test -tags=test_unit -v -count=1 -race -timeout=1m ./...
  1. Code coverage level and change you can see at https://codecov.io
  2. Regenerate protobuf dependencies use
make generate

FAQs

Package last updated on 08 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc