Socket
Book a DemoInstallSign in
Socket

github.com/maplecms/quartz

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/maplecms/quartz

v0.0.0-20160524035313-f6b2ef884f97
Source
Go
Version published
Created
Source

quartz for golang

quick start:

  • cd $GOPATH
  • go get github.com/shotdog/quartz
  • code
  package main
  
  import (
  	"quartz"
  	"log"
  )
  
  var ch chan  int = make(chan int)
  
  func main() {
  
  	qz := quartz.New()
  	job:= quartz.Job{Id:1,
  		Name:"测试Job",
  		Group:"测试",
  		Url:"http://localhost:8080/jobs/**",
  		Params:"参数",
  		Expression:"0 0/10 * * * ?",
  	}
  	err := qz.AddJob(job)
  	if err != nil {
  		log.Panicln(err)
  	}
  
  	job.Name = "修改后job"
  	job.Expression = "0 0/2 * * * ?"
  	err = qz.ModifyJob(job)
  	if err != nil {
  		log.Panicln(err)
  	}
  
  	err = qz.RemoveJob(job.Id)
  	if err != nil {
  		log.Panicln(err)
  	}
  	qz.BootStrap()
  	
  	<-ch
  
  
  }
  // invoke the job 
  func InvokeJob(jobId int ,targetUrl ,params string,nextTime time.Time)  {
  
  	log.Println("jobId=",jobId," targetUrl=",targetUrl," params=",params ," nextTime=",nextTime)
  }

  • 466862016@qq.com

FAQs

Package last updated on 24 May 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.