command

package module
v0.0.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 8 Imported by: 1

README

command

介绍

{以下是 Gitee 平台说明,您可以替换此简介 Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 https://gitee.com/enterprises}

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandContainer = &container{
	Instances: make(map[string]interface{}),
	Labels:    []string{},
}

Functions

func Exit added in v0.0.18

func Exit()

Exit 发出退出信号

func Inject added in v0.0.5

func Inject(instance interface{})

Inject 注入command

func IsCommand added in v0.0.15

func IsCommand(o interface{}) bool

IsCommand 判断是否command

func Load added in v0.0.15

func Load()

Load 初始化加载

func Run

func Run(label string, options ...string)

Run 执行command

func SetSysExitChannel added in v0.0.17

func SetSysExitChannel(c chan bool)

SetSysExitChannel 设置系统退出信号通道

func StartCron added in v0.0.22

func StartCron()

func StartResident added in v0.0.25

func StartResident()

func StopCron added in v0.0.22

func StopCron()

Types

type CommandArgvs added in v0.0.15

type CommandArgvs struct {
	Command CommandInterface
	Method  reflect.Value
	Options []*Option
	Name    string
}

CommandArgvs command命令行输入内容

type CommandDesc added in v0.0.5

type CommandDesc struct {
	Name string
	Desc string
}

CommandDesc command描述

type CommandHelpDoc added in v0.0.15

type CommandHelpDoc struct {
	AutoExit    bool
	CommandDesc CommandDesc
	MethodDesc  []MethodDesc
	OptionDesc  []OptionDesc
}

CommandHelpDoc command帮助文档

type CommandInterface

type CommandInterface interface {
	Help() *CommandHelpDoc
}

CommandInterface command父接口

type CommandState added in v0.0.17

type CommandState struct {
	Enable         bool
	Cron           *cron.Cron
	ExitChannel    chan bool
	AppExitChannel chan bool
	Running        map[string]string // 进行中任务
	Lock           *sync.Mutex       // map 并发控制
}

CommandState command状态

type MethodDesc added in v0.0.9

type MethodDesc struct {
	Name    string
	Desc    string
	Options []string
}

MethodDesc command方法描述

type Option

type Option struct {
	Name  string
	Value string
}

Option command方法参数

type OptionDesc added in v0.0.15

type OptionDesc struct {
	Name string
	Desc string
}

OptionDesc command方法参数描述

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL