Back to godoc.org

Package corn

v0.0.25
Latest Go to latest

The latest major version is .

Published: Nov 27, 2019 | Licenses: Apache-2.0 , Apache-2.0 | Module: cloudtui.com/key/xiao

Overview

定时任务模块,目前已interface的形式挂载,统一处理定时任务的执行操作

Index

Constants

const (
	USERNAME = "sa"
	PASSWORD = "sqlserver_7F"
	NETWORK  = "tcp"
	SERVER   = "10.62.24.23"
	PORT     = 1433
	DATABASE = "plemis2.0_test"
	DRIVER   = "sqlserver"
)

Variables

var CornFUncMap cornFuncMap = cornFuncMap{}
var Cron *cron.Cron = cron.New()

func AddFunc

func AddFunc(c CornJob)

func AddFuncMap

func AddFuncMap(k string, i CornFunc)

func GetNoB2BOrderID

func GetNoB2BOrderID(db *sql.DB) (*[]Result, error)

func Register

func Register()

type CornFunc

type CornFunc interface {
	// Spec() string
	Before() error
	Run() error
	After() error
}

type CornJob

type CornJob struct {
	JobName string
	JobSpec string
}

type NoB2BOrderID

type NoB2BOrderID struct {
}

func (NoB2BOrderID) Run

func (NoB2BOrderID) Run() (key string, value []byte, err error)

type Result

type Result struct {
	ProductName  string         `json:"productName"`
	BrandName    string         `json:"brandName"`
	OrgName      string         `json:"orgName"`
	TradeOrderId string         `json:"tradeOrderId"`
	OrderDate    string         `json:"orderDate"`
	Remark       string         `json:"remark"`
	B2bOrderId   sql.NullString `json:"b2bOrderId"`
	PurchaseQty  float32        `json:"purchaseQty"`
}

Package Files

  • corn.go
  • func_job.go
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier