sgnetwork

package
v0.0.0-...-2572d14 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSgMiss = errors.New("sg cache miss")

Functions

This section is empty.

Types

type Cache

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

func (*Cache) Clear

func (cache *Cache) Clear()

func (*Cache) Find

func (cache *Cache) Find(ip net.IP) *SgNet

func (*Cache) Init

func (cache *Cache) Init(sgs []*SgNet)

Init -

type ErrSgNw

type ErrSgNw struct {
	Err error
}

ErrSgNw -

func (ErrSgNw) Cause

func (e ErrSgNw) Cause() error

Cause -

func (ErrSgNw) Error

func (e ErrSgNw) Error() string

Error -

type Network

type Network struct {
	Net  net.IPNet
	Name NetworkName
}

Network is IP network

func Proto2ModelNetwork

func Proto2ModelNetwork(protoNw *sg.Network) (Network, error)

Proto2ModelNetwork converts Network (proto --> model)

func (Network) IsEq

func (nw Network) IsEq(other Network) bool

IsEq -

func (Network) String

func (nw Network) String() string

String impl Stringer

type NetworkName

type NetworkName = string

NetworkName net name

type SGClient

type SGClient = sgAPI.ClosableClient

SGClient is an alias to 'sgAPI.ClosableClient'

type SGCollector

type SGCollector interface {
	Run(ctx context.Context) (err error)
	GetSGByIP(ip net.IP) (SgNet, error)
	Close() error
}

func NewSgCollector

func NewSgCollector(ctx context.Context, c SGClient, d time.Duration, usePush bool) (SGCollector, error)

type SGName

type SGName = string

SGName sg name

type SecGroup

type SecGroup struct {
	// name of security group
	Name string
	// related to security gpoup network(s)
	Networks []string
}

SecGroup: represents a security group

type SgNameCache

type SgNameCache = map[NetworkName]SGName

type SgNet

type SgNet struct {
	Network
	SgName string
}

type SyncStatus

type SyncStatus struct {
	UpdatedAt time.Time
}

SyncStatus succeeded sync-op status

Jump to

Keyboard shortcuts

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