Categorygithub.com/pefish/go-task-driver
modulepackage
0.2.4
Repository: https://github.com/pefish/go-task-driver.git
Documentation: pkg.go.dev

# README

Go-task-driver

view examples

task driver for golang

Quick start

package task_driver

import (
	"fmt"
	"time"
)

func ExampleDriverType_Register() {
	driver := NewTaskDriver()

	driver.Register(&Test{})

	driver.RunWait()

	// Output:
	// a
	// [INFO] [test]: stopping...
	// haha
	// xixi
	// [INFO] [test]: stopped
}

type Test struct {

}

func (s *Test) GetName() string {
	return "test"
}

func (t *Test) Stop() error {
	fmt.Println("haha")
	time.Sleep(2 * time.Second)
	fmt.Println("xixi")
	return nil
}

func (t *Test) Run() error {
	fmt.Println(`a`)
	return nil
}


Document

Doc

Security Vulnerabilities

If you discover a security vulnerability, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

License

This project is licensed under the Apache License.

# Functions

No description provided by the author

# Structs

No description provided by the author

# Interfaces

No description provided by the author