sgtest

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sgtest provides an in-memory sgfilter.Source for service tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loopback

func Loopback() net.Addr

Loopback is a client address on 127.0.0.1.

func OpenTo

func OpenTo(id string, port int, cidr string) sgfilter.Group

OpenTo is group id admitting TCP port from cidr.

Types

type Source

type Source struct {

	// DefaultID is returned for every VPC; empty means no default group.
	DefaultID string
	// contains filtered or unexported fields
}

Source serves security groups that tests replace at will, so rule edits can be applied between connections.

func New

func New(groups ...sgfilter.Group) *Source

New returns a Source holding groups.

func (*Source) DefaultGroupID

func (s *Source) DefaultGroupID(string) string

DefaultGroupID implements sgfilter.DefaultGroupSource.

func (*Source) Enforcer

func (s *Source) Enforcer() *sgfilter.Enforcer

Enforcer returns an enforcer reading from s.

func (*Source) GroupsOfAddr

func (s *Source) GroupsOfAddr(a netip.Addr) []string

GroupsOfAddr implements sgfilter.Source.

func (*Source) SecurityGroups

func (s *Source) SecurityGroups(ids []string) []sgfilter.Group

SecurityGroups implements sgfilter.Source.

func (*Source) Set

func (s *Source) Set(groups ...sgfilter.Group)

Set replaces every group.

func (*Source) SetMembers

func (s *Source) SetMembers(m map[netip.Addr][]string)

SetMembers declares which groups the interface owning each address belongs to.

Jump to

Keyboard shortcuts

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