fixtures

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestAreaInfo

func NewTestAreaInfo(name, nodeName, iface string) *config.AreaInfo

NewTestAreaInfo 创建测试用的区域信息

func NewTestIPv4NetworkList

func NewTestIPv4NetworkList(addresses ...string) *network.NetworkList

NewTestIPv4NetworkList 创建测试用的 IPv4 网络列表

func NewTestIPv6NetworkList

func NewTestIPv6NetworkList(addresses ...string) *network.NetworkList

NewTestIPv6NetworkList 创建测试用的 IPv6 网络列表

func NewTestIntent

func NewTestIntent(src, dst string) *policy.Intent

NewTestIntent 创建测试用的策略意图

func NewTestIntentWithService

func NewTestIntentWithService(src, dst, protocol, port string) *policy.Intent

NewTestIntentWithService 创建带服务的测试策略意图

func NewTestNetworkGroup

func NewTestNetworkGroup(addresses ...string) *network.NetworkGroup

NewTestNetworkGroup 创建测试用的网络组

func NewTestNetworkList

func NewTestNetworkList(addresses ...string) *network.NetworkList

NewTestNetworkList 创建测试用的网络列表(IPv4)

func NewTestNode

func NewTestNode(name string, nodeType api.NodeType) api.Node

NewTestNode 创建测试用的节点

func NewTestNodeMap

func NewTestNodeMap(opts ...NodeMapOption) *nodemap.NodeMap

NewTestNodeMap 创建测试用的 NodeMap

func NewTestPolicyContext

func NewTestPolicyContext() *firewall.PolicyContext

NewTestPolicyContext 创建测试用的策略上下文

func NewTestPort

func NewTestPort(name, vrf string, ipList map[network.IPFamily][]string) api.Port

NewTestPort 创建测试用的端口

Types

type NodeMapBuilder

type NodeMapBuilder struct {
	// contains filtered or unexported fields
}

NodeMapBuilder NodeMap 构建器

type NodeMapOption

type NodeMapOption func(*NodeMapBuilder)

NodeMapOption 用于配置 NodeMap 的选项函数

func WithArea

func WithArea(area *config.AreaInfo, ipv4 bool) NodeMapOption

WithArea 添加区域信息

func WithName

func WithName(name string) NodeMapOption

WithName 设置 NodeMap 名称

func WithNode

func WithNode(n api.Node) NodeMapOption

WithNode 添加节点

func WithPort

func WithPort(p api.Port) NodeMapOption

WithPort 添加端口

Jump to

Keyboard shortcuts

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