repository

package
v0.0.0-...-6d513be Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkRepository

type NetworkRepository interface {
	Create(ctx context.Context, network *entity.Network) (*entity.Network, error)
	Get(ctx context.Context, id string) (*entity.Network, error)
	Find(ctx context.Context, query *entity.QueryNetwork) ([]*entity.Network, error)
	Update(ctx context.Context, network *entity.Network) (*entity.Network, error)
	Delete(ctx context.Context, id string) error

	// UsedIPs 获取指定网络的已使用的地址
	UsedIPs(ctx context.Context, id string) ([]string, error)
	// AvailableIPs 获取指定网络的可用地址
	AvailableIPs(ctx context.Context, id string) ([]string, error)
	// AllocateIP 分配地址给指定网络
	AllocateIP(ctx context.Context, id string, ip string) error
	// ReleaseIP 释放指定网络的地址
	ReleaseIP(ctx context.Context, id string, ip string) error

	// AutoAllocateIP 自动分配一个地址给指定网络
	AutoAllocateIP(ctx context.Context, id string) (string, error)
}

Jump to

Keyboard shortcuts

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