Giter Club home page Giter Club logo

xxl-job-go-client's Introduction

xxl-job-go-client

xxl-job 对应的golang客户端

提供Elasticsearch 日志组件,把job执行过程写入elasticsearch方便跟踪查询

 func main() {
    exec := xxl.NewExecutor(
    xxl.ServerAddr("http://192.168.1.50:8080/xxl-job-admin"),
    xxl.AccessToken(""), //请求令牌(默认为空)
    //xxl.ExecutorIp("xxl-job-executor-test"),    //可自动获取
    xxl.ExecutorPort("9999"),                     //默认9999(非必填)
    xxl.RegistryKey("golang-jobs"),               //执行器名称
    xxl.SetLogger(xxl.NewLogEs().InitEs([]string{"192.168.1.50:9200"}, "100058", "dev")), //自定义日志
    )
    exec.Init()
    //设置日志查看handler
    exec.LogHandler(xxl.EsLogHandler)
    //注册任务handler
    exec.RegTask("task.test", task.Test)
    exec.RegTask("task.test2", task.Test2)
    exec.RegTask("task.panic", task.Panic)
    log.Fatal(exec.Run())
}

xxl-job-go-client's People

Contributors

dk-kroos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

savico-swee mvpyb

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.