Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
faaaa229
Commit
faaaa229
authored
Oct 04, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ipns' of github.com:jbenet/go-ipfs into ipns
parents
25b36d10
ee1d1ac0
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
33 deletions
+35
-33
blockservice/blockservice.go
blockservice/blockservice.go
+1
-2
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+1
-2
core/commands/add.go
core/commands/add.go
+8
-7
core/commands/commands.go
core/commands/commands.go
+2
-3
core/core.go
core/core.go
+1
-2
daemon/daemon.go
daemon/daemon.go
+1
-2
fuse/ipns/ipns_unix.go
fuse/ipns/ipns_unix.go
+1
-2
fuse/readonly/readonly_unix.go
fuse/readonly/readonly_unix.go
+1
-2
merkledag/merkledag.go
merkledag/merkledag.go
+1
-2
namesys/routing.go
namesys/routing.go
+2
-3
path/path.go
path/path.go
+1
-2
routing/dht/dht.go
routing/dht/dht.go
+1
-2
util/util.go
util/util.go
+14
-2
No files found.
blockservice/blockservice.go
View file @
faaaa229
...
...
@@ -7,14 +7,13 @@ import (
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
blocks
"github.com/jbenet/go-ipfs/blocks"
exchange
"github.com/jbenet/go-ipfs/exchange"
u
"github.com/jbenet/go-ipfs/util"
)
var
log
=
logging
.
MustGet
Logger
(
"blockservice"
)
var
log
=
u
.
Logger
(
"blockservice"
)
// BlockService is a block datastore.
// It uses an internal `datastore.Datastore` instance to store values.
...
...
cmd/ipfs/ipfs.go
View file @
faaaa229
...
...
@@ -9,7 +9,6 @@ import (
flag
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
commander
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
config
"github.com/jbenet/go-ipfs/config"
core
"github.com/jbenet/go-ipfs/core"
...
...
@@ -62,7 +61,7 @@ Use "ipfs help <command>" for more information about a command.
}
// log is the command logger
var
log
=
logging
.
MustGet
Logger
(
"cmd/ipfs"
)
var
log
=
u
.
Logger
(
"cmd/ipfs"
)
func
init
()
{
config
,
err
:=
config
.
PathRoot
()
...
...
core/commands/add.go
View file @
faaaa229
...
...
@@ -36,7 +36,7 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
}
// Add the file
nd
,
err
:
=
AddPath
(
n
,
path
,
depth
)
_
,
err
=
AddPath
(
n
,
path
,
depth
)
if
err
!=
nil
{
if
err
==
ErrDepthLimitExceeded
&&
depth
==
1
{
err
=
errors
.
New
(
"use -r to recursively add directories"
)
...
...
@@ -45,12 +45,13 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
}
// get the key to print it
k
,
err
:=
nd
.
Key
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"addFile error: %v"
,
err
)
}
fmt
.
Fprintf
(
out
,
"added %s %s
\n
"
,
k
.
Pretty
(),
path
)
// k, err := nd.Key()
// if err != nil {
// return fmt.Errorf("addFile error: %v", err)
// }
//
// Commenting out of here, because it's already in addNode below.
// fmt.Fprintf(out, "added %s %s\n", k.Pretty(), path)
}
return
nil
}
...
...
core/commands/commands.go
View file @
faaaa229
...
...
@@ -4,10 +4,9 @@ import (
"io"
"github.com/jbenet/go-ipfs/core"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
u
"github.com/jbenet/go-ipfs/util"
)
var
log
=
logging
.
MustGet
Logger
(
"commands"
)
var
log
=
u
.
Logger
(
"commands"
)
type
CmdFunc
func
(
*
core
.
IpfsNode
,
[]
string
,
map
[
string
]
interface
{},
io
.
Writer
)
error
core/core.go
View file @
faaaa229
...
...
@@ -9,7 +9,6 @@ import (
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
b58
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58"
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
bserv
"github.com/jbenet/go-ipfs/blockservice"
config
"github.com/jbenet/go-ipfs/config"
...
...
@@ -28,7 +27,7 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
var
log
=
logging
.
MustGet
Logger
(
"core"
)
var
log
=
u
.
Logger
(
"core"
)
// IpfsNode is IPFS Core module. It represents an IPFS instance.
type
IpfsNode
struct
{
...
...
daemon/daemon.go
View file @
faaaa229
...
...
@@ -9,7 +9,6 @@ import (
"path"
"sync"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
core
"github.com/jbenet/go-ipfs/core"
"github.com/jbenet/go-ipfs/core/commands"
u
"github.com/jbenet/go-ipfs/util"
...
...
@@ -18,7 +17,7 @@ import (
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
)
var
log
=
logging
.
MustGet
Logger
(
"daemon"
)
var
log
=
u
.
Logger
(
"daemon"
)
// LockFile is the filename of the daemon lock, relative to config dir
const
LockFile
=
"daemon.lock"
...
...
fuse/ipns/ipns_unix.go
View file @
faaaa229
...
...
@@ -10,7 +10,6 @@ import (
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
"github.com/jbenet/go-ipfs/core"
ci
"github.com/jbenet/go-ipfs/crypto"
...
...
@@ -19,7 +18,7 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
var
log
=
logging
.
MustGet
Logger
(
"ipns"
)
var
log
=
u
.
Logger
(
"ipns"
)
// FileSystem is the readwrite IPNS Fuse Filesystem.
type
FileSystem
struct
{
...
...
fuse/readonly/readonly_unix.go
View file @
faaaa229
...
...
@@ -21,10 +21,9 @@ import (
core
"github.com/jbenet/go-ipfs/core"
mdag
"github.com/jbenet/go-ipfs/merkledag"
u
"github.com/jbenet/go-ipfs/util"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
)
var
log
=
logging
.
MustGet
Logger
(
"ipfs"
)
var
log
=
u
.
Logger
(
"ipfs"
)
// FileSystem is the readonly Ipfs Fuse Filesystem.
type
FileSystem
struct
{
...
...
merkledag/merkledag.go
View file @
faaaa229
...
...
@@ -4,7 +4,6 @@ import (
"fmt"
proto
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
blocks
"github.com/jbenet/go-ipfs/blocks"
...
...
@@ -12,7 +11,7 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
var
log
=
logging
.
MustGet
Logger
(
"merkledag"
)
var
log
=
u
.
Logger
(
"merkledag"
)
// NodeMap maps u.Keys to Nodes.
// We cannot use []byte/Multihash for keys :(
...
...
namesys/routing.go
View file @
faaaa229
...
...
@@ -6,15 +6,14 @@ import (
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
ci
"github.com/jbenet/go-ipfs/crypto"
mdag
"github.com/jbenet/go-ipfs/merkledag"
"github.com/jbenet/go-ipfs/routing"
u
"github.com/jbenet/go-ipfs/util"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
)
var
log
=
logging
.
MustGet
Logger
(
"namesys"
)
var
log
=
u
.
Logger
(
"namesys"
)
// RoutingResolver implements NSResolver for the main IPFS SFS-like naming
type
RoutingResolver
struct
{
...
...
path/path.go
View file @
faaaa229
...
...
@@ -8,10 +8,9 @@ import (
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
merkledag
"github.com/jbenet/go-ipfs/merkledag"
u
"github.com/jbenet/go-ipfs/util"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
)
var
log
=
logging
.
MustGet
Logger
(
"path"
)
var
log
=
u
.
Logger
(
"path"
)
// Resolver provides path resolution to IPFS
// It has a pointer to a DAGService, which is uses to resolve nodes.
...
...
routing/dht/dht.go
View file @
faaaa229
...
...
@@ -17,12 +17,11 @@ import (
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
logging
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/op/go-logging"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
)
var
log
=
logging
.
MustGet
Logger
(
"dht"
)
var
log
=
u
.
Logger
(
"dht"
)
// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js
...
...
util/util.go
View file @
faaaa229
...
...
@@ -107,6 +107,8 @@ func DOut(format string, a ...interface{}) {
}
}
var
loggers
=
[]
string
{}
// SetupLogging will initialize the logger backend and set the flags.
func
SetupLogging
()
{
backend
:=
logging
.
NewLogBackend
(
os
.
Stderr
,
""
,
0
)
...
...
@@ -118,9 +120,19 @@ func SetupLogging() {
logging.SetLevel(logging.ERROR, "")
}
*/
logging
.
SetLevel
(
logging
.
ERROR
,
"merkledag"
)
logging
.
SetLevel
(
logging
.
ERROR
,
"blockservice"
)
logging
.
SetFormatter
(
logging
.
MustStringFormatter
(
LogFormat
))
for
_
,
n
:=
range
loggers
{
logging
.
SetLevel
(
logging
.
ERROR
,
n
)
}
}
// Logger retrieves a particular logger + initializes it at a particular level
func
Logger
(
name
string
)
*
logging
.
Logger
{
log
:=
logging
.
MustGetLogger
(
name
)
// logging.SetLevel(lvl, name) // can't set level here.
loggers
=
append
(
loggers
,
name
)
return
log
}
// ExpandPathnames takes a set of paths and turns them into absolute paths
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment