pg

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSGroupsTypesOntoPGX

func RegisterSGroupsTypesOntoPGX(ctx context.Context, c *pgx.Conn) (err error)

RegisterSGroupsTypesOntoPGX -

Types

type ChainDefaultAction

type ChainDefaultAction string

ChainDefaultAction -

type CidrSgRule

type CidrSgRule struct {
	Proto   Proto            `db:"proto"`
	CIDR    net.IPNet        `db:"cidr"`
	SG      string           `db:"sg"`
	Traffic Traffic          `db:"traffic"`
	Ports   SgRulePortsArray `db:"ports"`
	Logs    bool             `db:"logs"`
	Trace   bool             `db:"trace"`
}

CidrSgRule -

func (*CidrSgRule) FromModel

func (o *CidrSgRule) FromModel(m sgm.CidrSgRule) error

FromModel -

func (CidrSgRule) ToModel

func (o CidrSgRule) ToModel() (ret sgm.CidrSgRule, err error)

ToModel -

type FQDN

type FQDN string

FQDN -

type ICMP

type ICMP struct {
	IPv   IpFamily  `db:"ip_v"`
	Tytes IcmpTypes `db:"types"`
}

func (*ICMP) FromModel

func (o *ICMP) FromModel(m sgm.ICMP) error

FromModel -

func (ICMP) ToModel

func (o ICMP) ToModel() (ret sgm.ICMP, err error)

ToModel -

type IcmpTypes

type IcmpTypes []int16

IcmpTypes -

type IpFamily

type IpFamily string

IpFamily -

type Network

type Network struct {
	Name    string    `db:"name"`
	Network net.IPNet `db:"network"`
}

Network -

type PortMultirange

type PortMultirange struct {
	pgtype.Multirange[PortRange]
}

PortMultirange -

func (*PortMultirange) FromModel

func (o *PortMultirange) FromModel(m sgm.PortRanges) error

FromModel -

func (PortMultirange) ToModel

func (o PortMultirange) ToModel() (sgm.PortRanges, error)

ToModel -

type PortMultirangeArray

type PortMultirangeArray []PortMultirange

PortMultirangeArray -

type PortMumber

type PortMumber = int32

PortMumber -

type PortRange

type PortRange struct {
	pgtype.Range[PortMumber]
}

PortRange -

func (*PortRange) FromModel

func (o *PortRange) FromModel(m sgm.PortRange, allowNull bool) error

FromModel -

func (PortRange) ToModel

func (o PortRange) ToModel(allowNull bool) (sgm.PortRange, error)

ToModel -

type Proto

type Proto string

Proto -

func (*Proto) FromModel

func (o *Proto) FromModel(m sgm.NetworkTransport) error

FromModel -

func (Proto) ToModel

func (o Proto) ToModel() (sgm.NetworkTransport, error)

ToModel -

type RawRowsData

type RawRowsData [][]any

RawRowsData -

func (RawRowsData) Len

func (dat RawRowsData) Len() int64

Len -

func (RawRowsData) ToPgxCopySource

func (dat RawRowsData) ToPgxCopySource(offs int64) pgx.CopyFromSource

ToPgxCopySource -

type SG

type SG struct {
	Name          string             `db:"name"`
	Networks      []string           `db:"networks"`
	Logs          bool               `db:"logs"`
	Trace         bool               `db:"trace"`
	DefaultAction ChainDefaultAction `db:"default_action"`
}

SG -

func (*SG) FromModel

func (o *SG) FromModel(m sgm.SecurityGroup)

FromModel -

func (SG) ToModel

func (o SG) ToModel() (sgm.SecurityGroup, error)

ToModel -

type SG2FQDNRule

type SG2FQDNRule struct {
	SgFrom        string           `db:"sg_from"`
	FqndTo        FQDN             `db:"fqdn_to"`
	Proto         Proto            `db:"proto"`
	Ports         SgRulePortsArray `db:"ports"`
	Logs          bool             `db:"logs"`
	NdpiProtocols []string         `db:"ndpi_protocols"`
}

SG2FQDNRule -

func (*SG2FQDNRule) FromModel

func (o *SG2FQDNRule) FromModel(m sgm.FQDNRule) error

FromModel -

func (SG2FQDNRule) ToModel

func (o SG2FQDNRule) ToModel() (sgm.FQDNRule, error)

ToModel -

type SGRule

type SGRule struct {
	SgFrom string           `db:"sg_from"`
	SgTo   string           `db:"sg_to"`
	Proto  Proto            `db:"proto"`
	Ports  SgRulePortsArray `db:"ports"`
	Logs   bool             `db:"logs"`
}

SGRule -

func (*SGRule) FromModel

func (o *SGRule) FromModel(m sgm.SGRule) error

FromModel -

func (SGRule) ToModel

func (o SGRule) ToModel() (sgm.SGRule, error)

ToModel -

type SgIcmpRule

type SgIcmpRule struct {
	ICMP
	Sg    string `db:"sg"`
	Logs  bool   `db:"logs"`
	Trace bool   `db:"trace"`
}

SgIcmpRule -

func (*SgIcmpRule) FromModel

func (o *SgIcmpRule) FromModel(m sgm.SgIcmpRule) error

FromModel -

func (SgIcmpRule) ToModel

func (o SgIcmpRule) ToModel() (ret sgm.SgIcmpRule, err error)

ToModel -

type SgRulePorts

type SgRulePorts struct {
	S PortMultirange
	D PortMultirange
}

SgRulePorts -

func (*SgRulePorts) FromModel

func (o *SgRulePorts) FromModel(m sgm.SGRulePorts) error

FromModel -

func (SgRulePorts) ToModel

func (o SgRulePorts) ToModel() (sgm.SGRulePorts, error)

ToModel -

type SgRulePortsArray

type SgRulePortsArray []SgRulePorts

SgRulePortsArray -

func (*SgRulePortsArray) FromModel

func (o *SgRulePortsArray) FromModel(m []sgm.SGRulePorts) error

FromModel -

func (SgRulePortsArray) ToModel

func (o SgRulePortsArray) ToModel() ([]sgm.SGRulePorts, error)

ToModel -

type SgSgIcmpRule

type SgSgIcmpRule struct {
	ICMP
	SgFrom string `db:"sg_from"`
	SgTo   string `db:"sg_to"`
	Logs   bool   `db:"logs"`
	Trace  bool   `db:"trace"`
}

SgSgImpRule -

func (*SgSgIcmpRule) FromModel

func (o *SgSgIcmpRule) FromModel(m sgm.SgSgIcmpRule) error

FromModel -

func (SgSgIcmpRule) ToModel

func (o SgSgIcmpRule) ToModel() (ret sgm.SgSgIcmpRule, err error)

ToModel -

type SyncStatus

type SyncStatus struct {
	Updtated          time.Time `db:"updated_at"`
	TotalAffectedRows int64     `db:"total_affected_rows"`
}

SyncStatus -

func (*SyncStatus) Load

func (s *SyncStatus) Load(ctx context.Context, c *pgx.Conn) error

Load -

func (SyncStatus) Store

func (s SyncStatus) Store(ctx context.Context, c *pgx.Conn) error

Store -

type SyncerOfCidrSgRules

type SyncerOfCidrSgRules = syncObj[sgm.CidrSgRule, sgm.CidrSgRuleIdenity]

type SyncerOfNetworks

type SyncerOfNetworks = syncObj[sgm.Network, string]

SyncerOfNetworks -

type SyncerOfSecGroups

type SyncerOfSecGroups = syncObj[sgm.SecurityGroup, string]

SyncerOfSecGroups -

type SyncerOfSg2FqdnRules

type SyncerOfSg2FqdnRules = syncObj[sgm.FQDNRule, sgm.FQDNRuleIdentity]

SyncerOfSg2FqdnRules -

type SyncerOfSgIcmpRules

type SyncerOfSgIcmpRules = syncObj[sgm.SgIcmpRule, sgm.SgIcmpRuleID]

SyncerOfSgIcmpRules -

type SyncerOfSgRules

type SyncerOfSgRules = syncObj[sgm.SGRule, sgm.SGRuleIdentity]

SyncerOfSgRules -

type SyncerOfSgSgIcmpRules

type SyncerOfSgSgIcmpRules = syncObj[sgm.SgSgIcmpRule, sgm.SgSgIcmpRuleID]

SyncerOfSgIcmpRules -

type Traffic

type Traffic string

Traffic -

func (*Traffic) FromModel

func (o *Traffic) FromModel(m sgm.Traffic) error

FromModel -

func (Traffic) ToModel

func (o Traffic) ToModel() (ret sgm.Traffic, err error)

ToModel -

Jump to

Keyboard shortcuts

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