Skip to content

Commit

Permalink
Merge pull request #826 from vasco-santos/docs/uniform
Browse files Browse the repository at this point in the history
docs: uniform comment sentences
  • Loading branch information
Stebalien committed Mar 3, 2020
2 parents 7ba3222 + fe2c13c commit 5a6c36d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/muxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
msmux "github.com/libp2p/go-stream-muxer-multistream"
)

// MuxC is a stream multiplex transport constructor
// MuxC is a stream multiplex transport constructor.
type MuxC func(h host.Host) (mux.Multiplexer, error)

// MsMuxC is a tuple containing a multiplex transport constructor and a protocol
Expand Down
2 changes: 1 addition & 1 deletion config/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
csms "github.com/libp2p/go-conn-security-multistream"
)

// SecC is a security transport constructor
// SecC is a security transport constructor.
type SecC func(h host.Host) (sec.SecureTransport, error)

// MsSecC is a tuple containing a security transport constructor and a protocol
Expand Down
6 changes: 3 additions & 3 deletions defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var DefaultPeerstore Option = func(cfg *Config) error {
return cfg.Apply(Peerstore(pstoremem.NewPeerstore()))
}

// RandomIdentity generates a random identity (default behaviour)
// RandomIdentity generates a random identity. (default behaviour)
var RandomIdentity = func(cfg *Config) error {
priv, _, err := crypto.GenerateKeyPairWithReader(crypto.RSA, 2048, rand.Reader)
if err != nil {
Expand All @@ -53,7 +53,7 @@ var RandomIdentity = func(cfg *Config) error {
return cfg.Apply(Identity(priv))
}

// DefaultListenAddrs configures libp2p to use default listen address
// DefaultListenAddrs configures libp2p to use default listen address.
var DefaultListenAddrs = func(cfg *Config) error {
defaultIP4ListenAddr, err := multiaddr.NewMultiaddr("/ip4/0.0.0.0/tcp/0")
if err != nil {
Expand All @@ -70,7 +70,7 @@ var DefaultListenAddrs = func(cfg *Config) error {
))
}

// DefaultEnableRelay enables relay dialing and listening by default
// DefaultEnableRelay enables relay dialing and listening by default.
var DefaultEnableRelay = func(cfg *Config) error {
return cfg.Apply(EnableRelay())
}
Expand Down
2 changes: 1 addition & 1 deletion libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/libp2p/go-libp2p-core/host"
)

// Config describes a set of settings for a libp2p node
// Config describes a set of settings for a libp2p node.
type Config = config.Config

// Option is a libp2p config option that can be given to the libp2p constructor
Expand Down
8 changes: 4 additions & 4 deletions options.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package libp2p

// This file contains all libp2p configuration options (except the defaults,
// those are in defaults.go)
// those are in defaults.go).

import (
"fmt"
Expand Down Expand Up @@ -249,15 +249,15 @@ func EnableAutoRelay() Option {

// StaticRelays configures known relays for autorelay; when this option is enabled
// then the system will use the configured relays instead of querying the DHT to
// discover relays
// discover relays.
func StaticRelays(relays []peer.AddrInfo) Option {
return func(cfg *Config) error {
cfg.StaticRelays = append(cfg.StaticRelays, relays...)
return nil
}
}

// DefaultStaticRelays configures the static relays to use the known PL-operated relays
// DefaultStaticRelays configures the static relays to use the known PL-operated relays.
func DefaultStaticRelays() Option {
return func(cfg *Config) error {
for _, addr := range autorelay.DefaultRelays {
Expand Down Expand Up @@ -292,7 +292,7 @@ func FilterAddresses(addrs ...*net.IPNet) Option {
}

// Filters configures libp2p to use the given filters for accepting/denying
// certain addresses. Filters offers more control and should be use when the
// certain addresses. Filters offers more control and should be used when the
// addresses you want to accept/deny are not known ahead of time and can
// dynamically change.
func Filters(filters *filter.Filters) Option {
Expand Down

0 comments on commit 5a6c36d

Please sign in to comment.