-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
30 lines (25 loc) · 804 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package subnet
import (
"context"
"github.com/araskachoi/go-libp2p-pubsub-benchmark-tools/pkg/cerr"
"github.com/araskachoi/go-libp2p-pubsub-benchmark-tools/pkg/host"
"github.com/araskachoi/go-libp2p-pubsub-benchmark-tools/pkg/subnet/config"
)
const (
// ErrIPOutOfCIDRRange is returned when an IP is incremented but out of CIDR range
ErrIPOutOfCIDRRange = cerr.Error("ip out of CIDR range")
// ErrNilIPNet is thrown when an IPNet pointer is nil
ErrNilIPNet = cerr.Error("ip net is nil")
// ErrNilPort is thrown when a port pointer is nil
ErrNilPort = cerr.Error("port is nil")
)
// Props is passed to new to build a new subnet
type Props struct {
CTX context.Context
Conf config.Config
}
// Subnet implements the subment methods
type Subnet struct {
props *Props
hosts []*host.Host
}