Giter Club home page Giter Club logo

go's Introduction

MyToken Go SDK

Log

log based on logrus, support sync to mytoken log server, default write log to /data/logs/

go get github.com/mytokenio/go/log
import (
    "github.com/mytokenio/go/log"
)

log.Info("xxx log")
log.WithField("kkk", "vvv", "custom_type").Info("log with type & kv data")

more detail

Config

go get github.com/mytokenio/go/config
import (
    "github.com/mytokenio/go/config"
)

mc := &MyConfig{}
c := config.GetConfig()

// bind to struct
c.BindTOML(mc)

// or, watch change
c.Watch(func() error {
    err := c.BindTOML(mc)
    // TODO
    return nil
})

more detail

Metrics

// import metrics backend service
import "github.com/mytokenio/go/metrics"

// defer to close metrics
defer metrics.Close()

// count/gauge usage
metrics.Count("key", 1)
metrics.Gauge("key", 1)
metrics.Gauge("key", "string_value")

more detail

TODO

service registry/broker/health

rpc server/client/protocol

rate limiter, circuit breaker, hytrix

tracing, zipkin or jaeger

cli

queue

demo project

...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.