Documentation
¶
Overview ¶
Package vnet provides an in-memory mock implementation of Azure Virtual Network.
Index ¶
- Constants
- type Mock
- func (m *Mock) AcceptPeeringConnection(_ context.Context, peeringID string) error
- func (m *Mock) AddEgressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) AddIngressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) AddNetworkACLRule(_ context.Context, aclID string, rule *driver.NetworkACLRule) error
- func (m *Mock) CreateFlowLog(_ context.Context, cfg driver.FlowLogConfig) (*driver.FlowLog, error)
- func (m *Mock) CreateNATGateway(_ context.Context, cfg driver.NATGatewayConfig) (*driver.NATGateway, error)
- func (m *Mock) CreateNetworkACL(_ context.Context, vpcID string, tags map[string]string) (*driver.NetworkACL, error)
- func (m *Mock) CreatePeeringConnection(_ context.Context, cfg driver.PeeringConfig) (*driver.PeeringConnection, error)
- func (m *Mock) CreateRoute(_ context.Context, routeTableID, destinationCIDR, targetID, targetType string) error
- func (m *Mock) CreateRouteTable(_ context.Context, cfg driver.RouteTableConfig) (*driver.RouteTable, error)
- func (m *Mock) CreateSecurityGroup(_ context.Context, cfg driver.SecurityGroupConfig) (*driver.SecurityGroupInfo, error)
- func (m *Mock) CreateSubnet(_ context.Context, cfg driver.SubnetConfig) (*driver.SubnetInfo, error)
- func (m *Mock) CreateVPC(_ context.Context, cfg driver.VPCConfig) (*driver.VPCInfo, error)
- func (m *Mock) DeleteFlowLog(_ context.Context, id string) error
- func (m *Mock) DeleteNATGateway(_ context.Context, id string) error
- func (m *Mock) DeleteNetworkACL(_ context.Context, id string) error
- func (m *Mock) DeletePeeringConnection(_ context.Context, peeringID string) error
- func (m *Mock) DeleteRoute(_ context.Context, routeTableID, destinationCIDR string) error
- func (m *Mock) DeleteRouteTable(_ context.Context, id string) error
- func (m *Mock) DeleteSecurityGroup(_ context.Context, id string) error
- func (m *Mock) DeleteSubnet(_ context.Context, id string) error
- func (m *Mock) DeleteVPC(_ context.Context, id string) error
- func (m *Mock) DescribeFlowLogs(_ context.Context, ids []string) ([]driver.FlowLog, error)
- func (m *Mock) DescribeNATGateways(_ context.Context, ids []string) ([]driver.NATGateway, error)
- func (m *Mock) DescribeNetworkACLs(_ context.Context, ids []string) ([]driver.NetworkACL, error)
- func (m *Mock) DescribePeeringConnections(_ context.Context, ids []string) ([]driver.PeeringConnection, error)
- func (m *Mock) DescribeRouteTables(_ context.Context, ids []string) ([]driver.RouteTable, error)
- func (m *Mock) DescribeSecurityGroups(_ context.Context, ids []string) ([]driver.SecurityGroupInfo, error)
- func (m *Mock) DescribeSubnets(_ context.Context, ids []string) ([]driver.SubnetInfo, error)
- func (m *Mock) DescribeVPCs(_ context.Context, ids []string) ([]driver.VPCInfo, error)
- func (m *Mock) GetFlowLogRecords(_ context.Context, flowLogID string, limit int) ([]driver.FlowLogRecord, error)
- func (m *Mock) RejectPeeringConnection(_ context.Context, peeringID string) error
- func (m *Mock) RemoveEgressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) RemoveIngressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) RemoveNetworkACLRule(_ context.Context, aclID string, ruleNumber int, egress bool) error
Constants ¶
const ( TrafficTypeAll = "ALL" TrafficTypeAccept = "ACCEPT" TrafficTypeReject = "REJECT" )
Flow log traffic type constants.
const ( PeeringStatusPending = "pending-acceptance" PeeringStatusActive = "active" PeeringStatusRejected = "rejected" PeeringStatusDeleted = "deleted" )
Peering status constants.
const (
FlowLogStatusActive = "ACTIVE"
)
Flow log status constants.
const (
NATStateAvailable = "available"
)
NAT gateway state constants.
const (
RouteTargetLocal = "local"
)
Route target type constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of the Azure Virtual Network service.
func (*Mock) AcceptPeeringConnection ¶ added in v1.2.0
AcceptPeeringConnection accepts a pending VNet peering.
func (*Mock) AddEgressRule ¶
AddEgressRule adds an outbound security rule to the specified network security group.
func (*Mock) AddIngressRule ¶
AddIngressRule adds an inbound security rule to the specified network security group.
func (*Mock) AddNetworkACLRule ¶ added in v1.2.0
func (m *Mock) AddNetworkACLRule(_ context.Context, aclID string, rule *driver.NetworkACLRule) error
AddNetworkACLRule adds a rule to the specified network ACL, keeping rules sorted.
func (*Mock) CreateFlowLog ¶ added in v1.2.0
CreateFlowLog creates a flow log for a VNet or subnet resource.
func (*Mock) CreateNATGateway ¶ added in v1.2.0
func (m *Mock) CreateNATGateway(_ context.Context, cfg driver.NATGatewayConfig) (*driver.NATGateway, error)
CreateNATGateway creates a NAT gateway in the specified subnet.
func (*Mock) CreateNetworkACL ¶ added in v1.2.0
func (m *Mock) CreateNetworkACL( _ context.Context, vpcID string, tags map[string]string, ) (*driver.NetworkACL, error)
CreateNetworkACL creates a network ACL for the specified VNet.
func (*Mock) CreatePeeringConnection ¶ added in v1.2.0
func (m *Mock) CreatePeeringConnection( _ context.Context, cfg driver.PeeringConfig, ) (*driver.PeeringConnection, error)
CreatePeeringConnection creates a VNet peering between two virtual networks.
func (*Mock) CreateRoute ¶ added in v1.2.0
func (m *Mock) CreateRoute( _ context.Context, routeTableID, destinationCIDR, targetID, targetType string, ) error
CreateRoute adds a route to the specified route table.
func (*Mock) CreateRouteTable ¶ added in v1.2.0
func (m *Mock) CreateRouteTable(_ context.Context, cfg driver.RouteTableConfig) (*driver.RouteTable, error)
CreateRouteTable creates a route table for the specified VNet.
func (*Mock) CreateSecurityGroup ¶
func (m *Mock) CreateSecurityGroup(_ context.Context, cfg driver.SecurityGroupConfig) (*driver.SecurityGroupInfo, error)
CreateSecurityGroup creates a new network security group.
func (*Mock) CreateSubnet ¶
func (m *Mock) CreateSubnet(_ context.Context, cfg driver.SubnetConfig) (*driver.SubnetInfo, error)
CreateSubnet creates a new subnet within a virtual network.
func (*Mock) DeleteFlowLog ¶ added in v1.2.0
DeleteFlowLog deletes the flow log with the given ID.
func (*Mock) DeleteNATGateway ¶ added in v1.2.0
DeleteNATGateway deletes the NAT gateway with the given ID.
func (*Mock) DeleteNetworkACL ¶ added in v1.2.0
DeleteNetworkACL deletes the network ACL with the given ID.
func (*Mock) DeletePeeringConnection ¶ added in v1.2.0
DeletePeeringConnection deletes a VNet peering.
func (*Mock) DeleteRoute ¶ added in v1.2.0
DeleteRoute removes a route from the specified route table.
func (*Mock) DeleteRouteTable ¶ added in v1.2.0
DeleteRouteTable deletes the route table with the given ID.
func (*Mock) DeleteSecurityGroup ¶
DeleteSecurityGroup deletes the network security group with the given ID.
func (*Mock) DeleteSubnet ¶
DeleteSubnet deletes the subnet with the given ID.
func (*Mock) DescribeFlowLogs ¶ added in v1.2.0
DescribeFlowLogs returns flow logs matching the given IDs, or all if empty.
func (*Mock) DescribeNATGateways ¶ added in v1.2.0
DescribeNATGateways returns NAT gateways matching the given IDs, or all if empty.
func (*Mock) DescribeNetworkACLs ¶ added in v1.2.0
DescribeNetworkACLs returns network ACLs matching the given IDs, or all if empty.
func (*Mock) DescribePeeringConnections ¶ added in v1.2.0
func (m *Mock) DescribePeeringConnections( _ context.Context, ids []string, ) ([]driver.PeeringConnection, error)
DescribePeeringConnections returns VNet peerings matching the given IDs.
func (*Mock) DescribeRouteTables ¶ added in v1.2.0
DescribeRouteTables returns route tables matching the given IDs, or all if empty.
func (*Mock) DescribeSecurityGroups ¶
func (m *Mock) DescribeSecurityGroups(_ context.Context, ids []string) ([]driver.SecurityGroupInfo, error)
DescribeSecurityGroups returns security groups matching the given IDs, or all if ids is empty.
func (*Mock) DescribeSubnets ¶
DescribeSubnets returns subnets matching the given IDs, or all if ids is empty.
func (*Mock) DescribeVPCs ¶
DescribeVPCs returns virtual networks matching the given IDs, or all if ids is empty.
func (*Mock) GetFlowLogRecords ¶ added in v1.2.0
func (m *Mock) GetFlowLogRecords( _ context.Context, flowLogID string, limit int, ) ([]driver.FlowLogRecord, error)
GetFlowLogRecords generates mock flow log records for the given flow log.
func (*Mock) RejectPeeringConnection ¶ added in v1.2.0
RejectPeeringConnection rejects a pending VNet peering.
func (*Mock) RemoveEgressRule ¶
RemoveEgressRule removes a matching outbound rule from the specified network security group.
func (*Mock) RemoveIngressRule ¶
RemoveIngressRule removes a matching inbound rule from the specified network security group.