Documentation ¶
Index ¶
- Variables
- func NewBadgerStorage(db *badger.DB) goipam.Storage
- type BadgerStorage
- func (b *BadgerStorage) Close() error
- func (b *BadgerStorage) CreateNamespace(ctx context.Context, namespace string) error
- func (b *BadgerStorage) CreatePrefix(ctx context.Context, prefix goipam.Prefix, namespace string) (goipam.Prefix, error)
- func (b *BadgerStorage) DeleteAllPrefixes(ctx context.Context, namespace string) error
- func (b *BadgerStorage) DeleteNamespace(ctx context.Context, namespace string) error
- func (b *BadgerStorage) DeletePrefix(ctx context.Context, prefix goipam.Prefix, namespace string) (goipam.Prefix, error)
- func (b *BadgerStorage) ListNamespaces(ctx context.Context) ([]string, error)
- func (b *BadgerStorage) Name() string
- func (b *BadgerStorage) ReadAllPrefixCidrs(ctx context.Context, namespace string) ([]string, error)
- func (b *BadgerStorage) ReadAllPrefixes(ctx context.Context, namespace string) (goipam.Prefixes, error)
- func (b *BadgerStorage) ReadPrefix(ctx context.Context, prefix string, namespace string) (goipam.Prefix, error)
- func (b *BadgerStorage) UpdatePrefix(ctx context.Context, prefix goipam.Prefix, namespace string) (goipam.Prefix, error)
- type Network
- type Option
- type SandboxInfo
- type SandboxRoute
Constants ¶
This section is empty.
Variables ¶
var (
ErrSandboxNotFound = errors.New("sandbox not found")
)
Functions ¶
func NewBadgerStorage ¶
NewBadgerStorage creates a new goipam.Storage instance backed by BadgerDB.
Types ¶
type BadgerStorage ¶
type BadgerStorage struct {
// contains filtered or unexported fields
}
BadgerStorage implements the goipam.Storage interface using BadgerDB as the backend.
func (*BadgerStorage) Close ¶
func (b *BadgerStorage) Close() error
Close closes the underlying BadgerDB instance.
func (*BadgerStorage) CreateNamespace ¶
func (b *BadgerStorage) CreateNamespace(ctx context.Context, namespace string) error
CreateNamespace creates a new namespace. Returns error if namespace already exists.
func (*BadgerStorage) CreatePrefix ¶
func (b *BadgerStorage) CreatePrefix(ctx context.Context, prefix goipam.Prefix, namespace string) (goipam.Prefix, error)
CreatePrefix creates a new prefix in the given namespace. Returns error if prefix already exists.
func (*BadgerStorage) DeleteAllPrefixes ¶
func (b *BadgerStorage) DeleteAllPrefixes(ctx context.Context, namespace string) error
DeleteAllPrefixes removes all prefixes from the given namespace.
func (*BadgerStorage) DeleteNamespace ¶
func (b *BadgerStorage) DeleteNamespace(ctx context.Context, namespace string) error
DeleteNamespace removes a namespace and all its prefixes.
func (*BadgerStorage) DeletePrefix ¶
func (b *BadgerStorage) DeletePrefix(ctx context.Context, prefix goipam.Prefix, namespace string) (goipam.Prefix, error)
DeletePrefix removes a prefix from the given namespace.
func (*BadgerStorage) ListNamespaces ¶
func (b *BadgerStorage) ListNamespaces(ctx context.Context) ([]string, error)
ListNamespaces returns all existing namespaces.
func (*BadgerStorage) Name ¶
func (b *BadgerStorage) Name() string
Name returns the storage backend name.
func (*BadgerStorage) ReadAllPrefixCidrs ¶
ReadAllPrefixCidrs returns all prefix CIDRs from the given namespace.
func (*BadgerStorage) ReadAllPrefixes ¶
func (b *BadgerStorage) ReadAllPrefixes(ctx context.Context, namespace string) (goipam.Prefixes, error)
ReadAllPrefixes returns all prefixes from the given namespace.
func (*BadgerStorage) ReadPrefix ¶
func (b *BadgerStorage) ReadPrefix(ctx context.Context, prefix string, namespace string) (goipam.Prefix, error)
ReadPrefix retrieves a prefix from the given namespace.
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network represents an execution container network.
func (*Network) Init ¶
Init performs the network initialization. Must be called before any other method
type Option ¶
type Option func(*Network)
func WithIpamDBPath ¶
func WithSubnetPrefixSize ¶
WithSubnetPrefixSize sets the prefix size of the network.
type SandboxInfo ¶
type SandboxInfo struct { ID string `json:"id"` Veth string `json:"veth"` Cidr netip.Prefix `json:"cidr"` GW netip.Addr `json:"gw"` IP netip.Addr `json:"ip"` Routes []SandboxRoute `json:"routes"` }
SandboxInfo contains information about a network sandbox.
type SandboxRoute ¶
SandboxRoute represents a route in a network sandbox.