commands

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package commands is a set of libraries for cassini commands.

help: show help for cassini

$ cassini help [commands] [flags]
$ cassini -h
$ cassini --hrlp

start: start the relay serivce

$ cassini start

version: show version info

$ cassini version

dev mock: start mocking relay service

$ cassini dev mock -h

dev events: subscribe and show the events

$ cassini dev events -h

dev tx: query tx

$ cassini dev tx -h

!!!WARN It's DANGER!!!

dev reset: reset(cleaning up) data for cssini

$ cassini dev reset -h

Index

Constants

View Source
const (
	CmdCassini = "cassini"
	CmdVersion = "version"
	CmdStart   = "start"
	CmdMock    = "mock"
	CmdEvents  = "events"
	CmdTx      = "tx"
	CmdReset   = "reset"
	CmdHelp    = "help"

	ShortDescription = "The relay of cross-chain"
)

nolint

View Source
const (
	FlagHome   = "home"
	FlagConfig = "config"
	FlagLog    = "log"
	FlagQueue  = "queue"
)

nolint

View Source
const (

	// DefaultEventSubscribe events 默认订阅条件
	DefaultEventSubscribe string = "tm.event='Tx' AND qcp.to='qos'"
)

Variables

This section is empty.

Functions

func NewEventsCommand

func NewEventsCommand(run Runner, isKeepRunning bool) *cobra.Command

NewEventsCommand 创建 events 命令

func NewMockCommand

func NewMockCommand(run Runner, isKeepRunning bool) *cobra.Command

NewMockCommand 创建 mock/模拟服务 命令

func NewResetCommand added in v0.1.0

func NewResetCommand(run Runner, isKeepRunning bool) *cobra.Command

NewResetCommand 创建 reset/重置(清理) 命令

func NewRootCommand

func NewRootCommand(versioner Runner) *cobra.Command

NewRootCommand 创建 root/默认 命令

实现默认功能,显示帮助信息,预处理配置初始化,日志配置初始化。

func NewStartCommand

func NewStartCommand(run Runner, isKeepRunning bool) *cobra.Command

NewStartCommand 创建 start/服务启动 命令

func NewTxCommand

func NewTxCommand(run Runner, isKeepRunning bool) *cobra.Command

NewTxCommand 创建 tx 命令

func NewVersionCommand

func NewVersionCommand(run Runner, isKeepRunning bool) *cobra.Command

NewVersionCommand create version command

Types

type Runner

type Runner func() (context.CancelFunc, error)

Runner 通过配置数据执行方法,返回运行过程中出现的错误,如果返回空则代表运行成功。

Jump to

Keyboard shortcuts

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