types

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conduit

type Conduit interface {
	Prefix
	GetNode(ctx context.Context, name string) (Node, error)
	RemoveNode(ctx context.Context, name string) error
}

type Node

type Node interface {
	Prefix
	Allocate(ctx context.Context, name string) (Prefix, error)
	Release(ctx context.Context, name string) error
}

type Prefix

type Prefix interface {
	GetName() string
	GetCidr() string
	GetParent() Prefix
	Equals(Prefix) bool
}

type PrefixLengths

type PrefixLengths struct {
	ConduitLength int
	NodeLength    int
	ChildLength   int
}

func NewPrefixLengths

func NewPrefixLengths(conduitLength int, nodeLength int, childLength int) *PrefixLengths

type Storage

type Storage interface {
	Add(ctx context.Context, prefix Prefix) error
	Update(ctx context.Context, prefix Prefix) error
	Delete(ctx context.Context, prefix Prefix) error
	Get(ctx context.Context, name string, parent Prefix) (Prefix, error)
	GetChilds(ctx context.Context, prefix Prefix) ([]Prefix, error)
}

type Trench

type Trench interface {
	Prefix
	GetConduit(ctx context.Context, name string) (Conduit, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL