commands

package
v0.0.0-...-9ab2669 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Online     bool
	ConfigRoot string
	ReqLog     *ReqLog

	Plugins *loader.PluginLoader

	LoadConfig func(path string) (*config.Config, error)

	Gateway bool

	ConstructNode func() (*core.IpfsNode, error)
	// contains filtered or unexported fields
}

上下文表示请求上下文

func (*Context) Close

func (c *Context) Close()

关闭将清除应用程序状态。

func (*Context) Context

func (c *Context) Context() context.Context

Context返回节点的上下文。

func (*Context) GetAPI

func (c *Context) GetAPI() (coreiface.CoreAPI, error)

getapi返回由ipfs节点支持的coreapi实例。 它可以用提供的函数构造节点

func (*Context) GetConfig

func (c *Context) GetConfig() (*config.Config, error)

getconfig返回当前命令执行的配置 语境。它可以使用提供的功能加载它。

func (*Context) GetNode

func (c *Context) GetNode() (*core.IpfsNode, error)

getnode返回当前命令执行的节点 语境。它可以用提供的函数构造它。

func (*Context) LogRequest

func (c *Context) LogRequest(req *cmds.Request) func()

log request将传递的请求添加到请求日志中,然后 返回请求时应调用的函数 一生都结束了。

type ReqLog

type ReqLog struct {
	Requests []*ReqLogEntry
	// contains filtered or unexported fields
}

reqlog是请求的日志

func (*ReqLog) AddEntry

func (rl *ReqLog) AddEntry(rle *ReqLogEntry)

附录将一个条目添加到日志中

func (*ReqLog) ClearInactive

func (rl *ReqLog) ClearInactive()

ClearInactive删除过时的条目

func (*ReqLog) Finish

func (rl *ReqLog) Finish(rle *ReqLogEntry)

finish将日志中的条目标记为finished

func (*ReqLog) Report

func (rl *ReqLog) Report() []*ReqLogEntry

报告生成请求日志中所有条目的副本

func (*ReqLog) SetKeepTime

func (rl *ReqLog) SetKeepTime(t time.Duration)

setkeeptime设置一个持续时间,在此时间之后,一个条目将被视为不活动。

type ReqLogEntry

type ReqLogEntry struct {
	StartTime time.Time
	EndTime   time.Time
	Active    bool
	Command   string
	Options   map[string]interface{}
	Args      []string
	ID        int
	// contains filtered or unexported fields
}

reqlogentry是请求日志中的一个条目

func (*ReqLogEntry) Copy

func (r *ReqLogEntry) Copy() *ReqLogEntry

copy返回reqlogentry的副本

Jump to

Keyboard shortcuts

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