options.go 268 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package network

import "github.com/libp2p/go-libp2p-core/protocol"

type NetOpt func(*Settings)

type Settings struct {
	ProtocolPrefix protocol.ID
}

func Prefix(prefix protocol.ID) NetOpt {
	return func(settings *Settings) {
		settings.ProtocolPrefix = prefix
	}
}