sky

package module
v0.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2022 License: BSD-3-Clause Imports: 17 Imported by: 2

README

go-sky

go-sky is a Golang micro service framework integrating several very popular packages and tools. As follows:

  • github.com/go-kit/kit
  • github.com/uber-go/zap
  • gopkg.in/natefinch/lumberjack.v2
  • github.com/opentracing/opentracing-go
  • github.com/go-redis/redis/v8
  • github.com/elastic/go-elasticsearch/v7
  • github.com/Shopify/sarama
  • github.com/prometheus

Includes this subpackages as follows:

  • github.com/WiFeng/go-sky/config
  • github.com/WiFeng/go-sky/database
  • github.com/WiFeng/go-sky/elasticsearch
  • github.com/WiFeng/go-sky/helper
  • github.com/WiFeng/go-sky/http
  • github.com/WiFeng/go-sky/kafka
  • github.com/WiFeng/go-sky/log
  • github.com/WiFeng/go-sky/metrics
  • github.com/WiFeng/go-sky/redis
  • github.com/WiFeng/go-sky/trace
  1. github.com/WiFeng/go-sky-example
  2. github.com/WiFeng/go-sky-helloworld

Features

  1. Support config.toml, and load separated config file by different runtime enviroment (config_development.toml/config_production.toml)
  2. Support many popular componets including sql/redis/kafka/elasticsearch.
  3. Support tracing (include http server and http client / redis / sql / kafka / elasticsearch)
  4. Support log rotating and include trace_id in all log items.
  5. Support promethues metric (include http server by now)

image

image

Usage

  1. There is a demo project in sky-example.

TODO

  1. Support redis/sql operation metric
  2. Support more custom config to make some function disabled.

Contribution

We need more cute members to make this project more robust. Believe you can!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAppConfig

func LoadAppConfig(conf interface{}) error

LoadAppConfig ...

func LoadConfig

func LoadConfig(name string, conf interface{}) (err error)

LoadConfig ...

func RegisterTask added in v0.2.3

func RegisterTask(f func(), df func(), sync bool)

RegisterTask ...

func Run

func Run(handler http.Handler)

Run ...

func RunHTTPServer

func RunHTTPServer(handler http.Handler)

RunHTTPServer ...

func SafelyDo added in v0.2.12

func SafelyDo(ctx context.Context, f func()) (err error)

Types

This section is empty.

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL