Documentation
¶
Index ¶
- Constants
- Variables
- func CreatePublicNS(iface *types.PubIface, nodeID pkg.Identifier) error
- func NewNetworker(identity pkg.IdentityManager, tnodb TNoDB, storageDir string) (pkg.Networker, error)
- func NodeIDv1() (string, error)
- func ResourceByNodeID(nodeID string, resources []pkg.NetResource) (*pkg.NetResource, error)
- type Farm
- type TNoDB
Constants ¶
View Source
const (
// ZDBIface is the name of the interface used in the 0-db network namespace
ZDBIface = "zdb0"
)
Variables ¶
View Source
var ErrNoPubIface = errors.New("no public interface configured for this node")
ErrNoPubIface is the error returns by ReadPubIface when no public interface is configured
Functions ¶
func CreatePublicNS ¶
func CreatePublicNS(iface *types.PubIface, nodeID pkg.Identifier) error
CreatePublicNS creates a public namespace in a node
func NewNetworker ¶
func NewNetworker(identity pkg.IdentityManager, tnodb TNoDB, storageDir string) (pkg.Networker, error)
NewNetworker create a new pkg.Networker that can be used over zbus
func ResourceByNodeID ¶
func ResourceByNodeID(nodeID string, resources []pkg.NetResource) (*pkg.NetResource, error)
ResourceByNodeID return the net resource associated with a nodeID
Types ¶
type Farm ¶
type Farm struct {
ID string `json:"farm_id"`
Name string `json:"name"`
ExitNodes []string `json:"exit_nodes"`
}
Farm hold the ID, name and list of possible exit node of a farm
type TNoDB ¶
type TNoDB interface {
GetFarm(farm pkg.Identifier) (*Farm, error)
PublishInterfaces(node pkg.Identifier, ifaces []types.IfaceInfo) error
GetNode(pkg.Identifier) (*types.Node, error)
PublishWGPort(node pkg.Identifier, ports []uint) error
SetPublicIface(node pkg.Identifier, pub *types.PubIface) error
GetPubIface(node pkg.Identifier) (*types.PubIface, error)
}
TNoDB define the interface to implement to talk to a Tenant Network object database
Directories
¶
| Path | Synopsis |
|---|---|
|
Package tnodb expose the interface required to talk to a Tenant network object database (TNODB)
|
Package tnodb expose the interface required to talk to a Tenant network object database (TNODB) |
Click to show internal directories.
Click to hide internal directories.