Documentation
¶
Index ¶
- Variables
- func CommandsCmd(root *cmds.Command) *cmds.Command
- func KeyListTextMarshaler(res cmds.Response) ([]byte, error)
- func MessageTextMarshaler(res cmds.Response) ([]byte, error)
- func Mount(node *core.IpfsNode, fsdir, nsdir string) error
- type AddOutput
- type Block
- type BootstrapOutput
- type Command
- type ConfigField
- type DiagnosticConnection
- type DiagnosticOutput
- type DiagnosticPeer
- type IdOutput
- type IpnsEntry
- type KeyList
- type Link
- type LsOutput
- type MessageOutput
- type Node
- type Object
- type TestOutput
- type UpdateOutput
- type VersionOutput
Constants ¶
This section is empty.
Variables ¶
View Source
var CommandsDaemonCmd = CommandsCmd(Root)
commandsDaemonCmd is the "ipfs commands" command for daemon
View Source
var DiagCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Generates diagnostic reports", }, Subcommands: map[string]*cmds.Command{ "net": diagNetCmd, }, }
View Source
var ErrDepthLimitExceeded = fmt.Errorf("depth limit exceeded")
Error indicating the max depth has been exceded.
View Source
var ErrObjectTooLarge = errors.New("input object was too large. limit is 512kbytes")
ErrObjectTooLarge is returned when too much data was read from stdin. current limit 512k
View Source
var ErrUnknownObjectEnc = errors.New("unknown object encoding")
ErrUnknownObjectEnc is returned if a invalid encoding is supplied
View Source
var LogCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Change the logging level", ShortDescription: ` 'ipfs log' is a utility command used to change the logging output of a running daemon. `, }, Arguments: []cmds.Argument{ cmds.StringArg("subsystem", true, false, fmt.Sprintf("the subsystem logging identifier. Use '%s' for all subsystems.", logAllKeyword)), cmds.StringArg("level", true, false, "one of: debug, info, notice, warning, error, critical"), }, Run: func(req cmds.Request) (interface{}, error) { args := req.Arguments() subsystem, level := args[0], args[1] if subsystem == logAllKeyword { subsystem = "*" } if err := u.SetLogLevel(subsystem, level); err != nil { return nil, err } s := fmt.Sprintf("Changed log level of '%s' to '%s'", subsystem, level) log.Info(s) return &MessageOutput{s}, nil }, Marshalers: cmds.MarshalerMap{ cmds.Text: MessageTextMarshaler, }, Type: &MessageOutput{}, }
View Source
var Root = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "global p2p merkle-dag filesystem", Synopsis: ` ipfs [<flags>] <command> [<arg>] ... `, ShortDescription: ` Basic commands: init Initialize ipfs local configurationx add <path> Add an object to ipfs cat <ref> Show ipfs object data ls <ref> List links from an object Tool commands: config Manage configuration update Download and apply go-ipfs updates version Show ipfs version information commands List all available commands id Show info about ipfs peers Advanced Commands: daemon Start a long-running daemon process mount Mount an ipfs read-only mountpoint serve Serve an interface to ipfs diag Print diagnostics Plumbing commands: block Interact with raw blocks in the datastore object Interact with raw dag nodes Use 'ipfs <command> --help' to learn more about each command. `, }, Options: []cmds.Option{ cmds.StringOption("config", "c", "Path to the configuration file to use"), cmds.BoolOption("debug", "D", "Operate in debug mode"), cmds.BoolOption("help", "Show the full command help text"), cmds.BoolOption("h", "Show a short version of the command help text"), cmds.BoolOption("local", "L", "Run the command locally, instead of using the daemon"), }, }
View Source
var UpdateCheckCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Checks if updates are available", ShortDescription: "'ipfs update check' checks if any updates are available for IPFS.\nNothing will be downloaded or installed.", }, Run: func(req cmds.Request) (interface{}, error) { n, err := req.Context().GetNode() if err != nil { return nil, err } return updateCheck(n) }, Type: &UpdateOutput{}, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) ([]byte, error) { v := res.Output().(*UpdateOutput) s := "" if v.NewVersion != v.OldVersion { s = fmt.Sprintf("A new version of IPFS is available ('%s', currently running '%s')\n", v.NewVersion, v.OldVersion) } else { s = fmt.Sprintf("Already updated to latest version ('%s')\n", v.NewVersion) } return []byte(s), nil }, }, }
View Source
var UpdateCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Downloads and installs updates for IPFS", ShortDescription: "ipfs update is a utility command used to check for updates and apply them.", }, Run: func(req cmds.Request) (interface{}, error) { n, err := req.Context().GetNode() if err != nil { return nil, err } return updateApply(n) }, Type: &UpdateOutput{}, Subcommands: map[string]*cmds.Command{ "check": UpdateCheckCmd, "log": UpdateLogCmd, }, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) ([]byte, error) { v := res.Output().(*UpdateOutput) s := "" if v.NewVersion != v.OldVersion { s = fmt.Sprintf("Successfully updated to IPFS version '%s' (from '%s')\n", v.NewVersion, v.OldVersion) } else { s = fmt.Sprintf("Already updated to latest version ('%s')\n", v.NewVersion) } return []byte(s), nil }, }, }
View Source
var UpdateLogCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "List the changelog for the latest versions of IPFS", ShortDescription: "This command is not yet implemented.", }, Run: func(req cmds.Request) (interface{}, error) { n, err := req.Context().GetNode() if err != nil { return nil, err } return updateLog(n) }, }
View Source
var VersionCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Shows ipfs version information", ShortDescription: "Returns the current version of ipfs and exits.", }, Options: []cmds.Option{ cmds.BoolOption("number", "n", "Only show the version number"), }, Run: func(req cmds.Request) (interface{}, error) { return &VersionOutput{ Version: config.CurrentVersionNumber, }, nil }, Marshalers: cmds.MarshalerMap{ cmds.Text: func(res cmds.Response) ([]byte, error) { v := res.Output().(*VersionOutput) number, found, err := res.Request().Option("number").Bool() if err != nil { return nil, err } if found && number { return []byte(fmt.Sprintln(v.Version)), nil } return []byte(fmt.Sprintf("ipfs version %s\n", v.Version)), nil }, }, Type: &VersionOutput{}, }
Functions ¶
func CommandsCmd ¶
CommandsCmd takes in a root command, and returns a command that lists the subcommands in that root
func KeyListTextMarshaler ¶
KeyListTextMarshaler outputs a KeyList as plaintext, one key per line
Types ¶
type BootstrapOutput ¶
type BootstrapOutput struct {
Peers []*config.BootstrapPeer
}
type ConfigField ¶
type ConfigField struct { Key string Value interface{} }
type DiagnosticConnection ¶
type DiagnosticOutput ¶
type DiagnosticOutput struct {
Peers []DiagnosticPeer
}
type DiagnosticPeer ¶
type DiagnosticPeer struct { ID string UptimeSeconds uint64 BandwidthBytesIn uint64 BandwidthBytesOut uint64 Connections []DiagnosticConnection }
type MessageOutput ¶
type MessageOutput struct {
Message string
}
type TestOutput ¶
type UpdateOutput ¶
type VersionOutput ¶
type VersionOutput struct {
Version string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.