pg

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 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 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 IECidrSgIcmpRule added in v1.13.0

type IECidrSgIcmpRule struct {
	ICMP
	Traffic  Traffic      `db:"traffic"`
	CIDR     net.IPNet    `db:"cidr"`
	SG       string       `db:"sg"`
	Logs     bool         `db:"logs"`
	Trace    bool         `db:"trace"`
	Action   RuleAction   `db:"action"`
	Priority RulePriority `db:"priority"`
}

IECidrSgIcmpRule -

func (*IECidrSgIcmpRule) FromModel added in v1.13.0

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

FromModel -

func (IECidrSgIcmpRule) ToModel added in v1.13.0

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

ToModel -

type IECidrSgRule added in v1.13.0

type IECidrSgRule 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"`
	Action   RuleAction       `db:"action"`
	Priority RulePriority     `db:"priority"`
}

IECidrSgRule -

func (*IECidrSgRule) FromModel added in v1.13.0

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

FromModel -

func (IECidrSgRule) ToModel added in v1.13.0

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

ToModel -

type IESgSgIcmpRule added in v1.11.0

type IESgSgIcmpRule struct {
	ICMP
	SgLocal  string       `db:"sg_local"`
	Sg       string       `db:"sg"`
	Traffic  Traffic      `db:"traffic"`
	Logs     bool         `db:"logs"`
	Trace    bool         `db:"trace"`
	Action   RuleAction   `db:"action"`
	Priority RulePriority `db:"priority"`
}

IESgSgIcmpRule -

func (*IESgSgIcmpRule) FromModel added in v1.11.0

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

FromModel -

func (IESgSgIcmpRule) ToModel added in v1.11.0

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

ToModel -

type IESgSgRule added in v1.13.0

type IESgSgRule struct {
	Proto    Proto            `db:"proto"`
	SgLocal  string           `db:"sg_local"`
	Sg       string           `db:"sg"`
	Traffic  Traffic          `db:"traffic"`
	Ports    SgRulePortsArray `db:"ports"`
	Logs     bool             `db:"logs"`
	Trace    bool             `db:"trace"`
	Action   RuleAction       `db:"action"`
	Priority RulePriority     `db:"priority"`
}

IESgSgRule -

func (*IESgSgRule) FromModel added in v1.13.0

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

FromModel -

func (IESgSgRule) ToModel added in v1.13.0

func (o IESgSgRule) ToModel() (ret sgm.IESgSgRule, 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 RuleAction added in v1.14.0

type RuleAction string

RuleAction -

func (*RuleAction) FromModel added in v1.14.0

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

FromModel -

func (RuleAction) ToModel added in v1.14.0

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

ToModel -

type RulePriority added in v1.14.0

type RulePriority struct {
	pgtype.Int2 `db:"-"`
}

RulePriority -

func (*RulePriority) FromModel added in v1.14.0

func (o *RulePriority) FromModel(m sgm.RulePriority)

FromModel -

func (RulePriority) ToModel added in v1.14.0

func (o RulePriority) ToModel() (ret sgm.RulePriority)

ToModel -

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"`
	Action        RuleAction       `db:"action"`
	Priority      RulePriority     `db:"priority"`
}

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"`
	Action   RuleAction       `db:"action"`
	Priority RulePriority     `db:"priority"`
}

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"`
	Action RuleAction `db:"action"`
}

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"`
	Action   RuleAction   `db:"action"`
	Priority RulePriority `db:"priority"`
}

SgSgIcmpRule -

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 SyncerOfCidrSgIcmpRules added in v1.13.0

type SyncerOfCidrSgIcmpRules = syncObj[sgm.IECidrSgIcmpRule, sgm.IECidrSgIcmpRuleID]

SyncerOfCidrSgIcmpRules -

type SyncerOfCidrSgRules

type SyncerOfCidrSgRules = syncObj[sgm.IECidrSgRule, sgm.IECidrSgRuleIdenity]

SyncerOfCidrSgRules -

type SyncerOfIESgSgIcmpRules added in v1.11.0

type SyncerOfIESgSgIcmpRules = syncObj[sgm.IESgSgIcmpRule, sgm.IESgSgIcmpRuleID]

SyncerOfIESgSgIcmpRules -

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]

SyncerOfSgSgIcmpRules -

type SyncerOfSgSgRules added in v1.10.0

type SyncerOfSgSgRules = syncObj[sgm.IESgSgRule, sgm.IESgSgRuleIdentity]

SyncerOfSgSgRules -

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