Documentation ¶
Index ¶
- Constants
- Variables
- type Destination
- type DestinationRepo
- type DestinationTable
- func (d *DestinationTable) CountWhereGroupID(tx Transaction, group_id int) (int, error)
- func (d *DestinationTable) Create(tx Transaction, destination_group_id, port, startPort, endPort int, ...) (int, error)
- func (d *DestinationTable) Delete(tx Transaction, id int) error
- func (d *DestinationTable) GetID(tx Transaction, destination_group_id, port, startPort, endPort int, ...) (int, error)
- type GroupRepo
- type GroupTable
- type MetricsWrapper
- func (mw *MetricsWrapper) All() ([]Policy, error)
- func (mw *MetricsWrapper) ByGuids(srcGuids, dstGuids []string, inSourceAndDest bool) ([]Policy, error)
- func (mw *MetricsWrapper) CheckDatabase() error
- func (mw *MetricsWrapper) Create(policies []Policy) error
- func (mw *MetricsWrapper) Delete(policies []Policy) error
- func (mw *MetricsWrapper) Tags() ([]Tag, error)
- type Migrator
- type Policy
- type PolicyRepo
- type PolicyTable
- func (p *PolicyTable) CountWhereDestinationID(tx Transaction, destination_id int) (int, error)
- func (p *PolicyTable) CountWhereGroupID(tx Transaction, source_group_id int) (int, error)
- func (p *PolicyTable) Create(tx Transaction, source_group_id int, destination_id int) error
- func (p *PolicyTable) Delete(tx Transaction, source_group_id int, destination_id int) error
- type Ports
- type Source
- type Store
- type Tag
- type Transaction
Constants ¶
View Source
const MAX_TAG_LENGTH = 3
View Source
const MIN_TAG_LENGTH = 1
Variables ¶
View Source
var RecordNotFoundError = errors.New("record not found")
Functions ¶
This section is empty.
Types ¶
type Destination ¶
type DestinationRepo ¶
type DestinationTable ¶ added in v1.4.0
type DestinationTable struct { }
func (*DestinationTable) CountWhereGroupID ¶ added in v1.4.0
func (d *DestinationTable) CountWhereGroupID(tx Transaction, group_id int) (int, error)
func (*DestinationTable) Create ¶ added in v1.4.0
func (d *DestinationTable) Create(tx Transaction, destination_group_id, port, startPort, endPort int, protocol string) (int, error)
func (*DestinationTable) Delete ¶ added in v1.4.0
func (d *DestinationTable) Delete(tx Transaction, id int) error
func (*DestinationTable) GetID ¶ added in v1.4.0
func (d *DestinationTable) GetID(tx Transaction, destination_group_id, port, startPort, endPort int, protocol string) (int, error)
type GroupRepo ¶
type GroupRepo interface { Create(Transaction, string) (int, error) Delete(Transaction, int) error GetID(Transaction, string) (int, error) }
type GroupTable ¶ added in v1.4.0
type GroupTable struct { }
func (*GroupTable) Create ¶ added in v1.4.0
func (g *GroupTable) Create(tx Transaction, guid string) (int, error)
func (*GroupTable) Delete ¶ added in v1.4.0
func (g *GroupTable) Delete(tx Transaction, id int) error
func (*GroupTable) GetID ¶ added in v1.4.0
func (g *GroupTable) GetID(tx Transaction, guid string) (int, error)
type MetricsWrapper ¶ added in v0.17.0
type MetricsWrapper struct { Store Store MetricsSender metricsSender }
func (*MetricsWrapper) All ¶ added in v0.17.0
func (mw *MetricsWrapper) All() ([]Policy, error)
func (*MetricsWrapper) ByGuids ¶ added in v0.17.0
func (mw *MetricsWrapper) ByGuids(srcGuids, dstGuids []string, inSourceAndDest bool) ([]Policy, error)
func (*MetricsWrapper) CheckDatabase ¶ added in v1.0.0
func (mw *MetricsWrapper) CheckDatabase() error
func (*MetricsWrapper) Create ¶ added in v0.17.0
func (mw *MetricsWrapper) Create(policies []Policy) error
func (*MetricsWrapper) Delete ¶ added in v0.17.0
func (mw *MetricsWrapper) Delete(policies []Policy) error
func (*MetricsWrapper) Tags ¶ added in v0.17.0
func (mw *MetricsWrapper) Tags() ([]Tag, error)
type Migrator ¶ added in v1.4.0
type Migrator interface {
PerformMigrations(driverName string, migrationDb migrations.MigrationDb, maxNumMigrations int) (int, error)
}
type Policy ¶
type Policy struct { Source Source Destination Destination }
type PolicyRepo ¶
type PolicyRepo interface { Create(Transaction, int, int) error Delete(Transaction, int, int) error CountWhereGroupID(Transaction, int) (int, error) CountWhereDestinationID(Transaction, int) (int, error) }
type PolicyTable ¶ added in v1.4.0
type PolicyTable struct { }
func (*PolicyTable) CountWhereDestinationID ¶ added in v1.4.0
func (p *PolicyTable) CountWhereDestinationID(tx Transaction, destination_id int) (int, error)
func (*PolicyTable) CountWhereGroupID ¶ added in v1.4.0
func (p *PolicyTable) CountWhereGroupID(tx Transaction, source_group_id int) (int, error)
func (*PolicyTable) Create ¶ added in v1.4.0
func (p *PolicyTable) Create(tx Transaction, source_group_id int, destination_id int) error
func (*PolicyTable) Delete ¶ added in v1.4.0
func (p *PolicyTable) Delete(tx Transaction, source_group_id int, destination_id int) error
type Store ¶
type Store interface { Create([]Policy) error All() ([]Policy, error) Delete([]Policy) error Tags() ([]Tag, error) ByGuids([]string, []string, bool) ([]Policy, error) CheckDatabase() error }
func New ¶
func New(dbConnectionPool db, migrationDbConnectionPool db, g GroupRepo, d DestinationRepo, p PolicyRepo, tl int, migrator Migrator) (Store, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.