Versions in this module Expand all Collapse all v0 v0.4.0 Nov 14, 2019 Changes in this version + const DefaultBestSetSize + const DefaultCandidateSetSize + const DefaultMaxExpTime + const DefaultMaxHopsLength + const ErrParse + const ErrReadingRows + func FilterLoop(beacon Beacon, next addr.IA, allowIsdLoop bool) error + type Beacon struct + InIfId common.IFIDType + Segment *seg.PathSegment + func (b Beacon) Diversity(other Beacon) int + type BeaconOrErr struct + Beacon Beacon + Err error + type CorePolicies struct + CoreReg Policy + Prop Policy + func (p *CorePolicies) Filter(beacon Beacon) error + func (p *CorePolicies) InitDefaults() + func (p *CorePolicies) Usage(beacon Beacon) Usage + func (p *CorePolicies) Validate() error + type CoreStore struct + func NewCoreBeaconStore(policies CorePolicies, db DB) (*CoreStore, error) + func (s *CoreStore) BeaconsToPropagate(ctx context.Context) (<-chan BeaconOrErr, error) + func (s *CoreStore) Close() error + func (s *CoreStore) DeleteExpiredBeacons(ctx context.Context) (int, error) + func (s *CoreStore) DeleteExpiredRevocations(ctx context.Context) (int, error) + func (s *CoreStore) DeleteRevocation(ctx context.Context, ia addr.IA, ifid common.IFIDType) error + func (s *CoreStore) InsertBeacon(ctx context.Context, beacon Beacon) (InsertStats, error) + func (s *CoreStore) InsertRevocations(ctx context.Context, revocations ...*path_mgmt.SignedRevInfo) error + func (s *CoreStore) MaxExpTime(policyType PolicyType) spath.ExpTimeType + func (s *CoreStore) PreFilter(beacon Beacon) error + func (s *CoreStore) SegmentsToRegister(ctx context.Context, segType proto.PathSegType) (<-chan BeaconOrErr, error) + func (s *CoreStore) UpdatePolicy(ctx context.Context, policy Policy) error + type DB interface + BeginTransaction func(ctx context.Context, opts *sql.TxOptions) (Transaction, error) + type DBRead interface + AllRevocations func(ctx context.Context) (<-chan RevocationOrErr, error) + BeaconSources func(ctx context.Context) ([]addr.IA, error) + CandidateBeacons func(ctx context.Context, setSize int, usage Usage, src addr.IA) (<-chan BeaconOrErr, error) + type DBReadWrite interface + type DBWrite interface + DeleteExpiredBeacons func(ctx context.Context, now time.Time) (int, error) + DeleteExpiredRevocations func(ctx context.Context, now time.Time) (int, error) + DeleteRevocation func(ctx context.Context, ia addr.IA, ifid common.IFIDType) error + DeleteRevokedBeacons func(ctx context.Context, now time.Time) (int, error) + InsertBeacon func(ctx context.Context, beacon Beacon, usage Usage) (InsertStats, error) + InsertRevocation func(ctx context.Context, revocation *path_mgmt.SignedRevInfo) error + type Filter struct + AllowIsdLoop *bool + AsBlackList []addr.AS + IsdBlackList []addr.ISD + MaxHopsLength int + func (f *Filter) InitDefaults() + func (f Filter) Apply(beacon Beacon) error + type HPGroup struct + Group hiddenpath.Group + GroupCfgPath string + type HPPolicies struct + DefaultAction string + HiddenAndPublic bool + Policies map[common.IFIDType]HPPolicy + type HPPolicy struct + Hidden map[hiddenpath.GroupId]RegPolicy + Public RegPolicy + type HPRegistration struct + HPGroups map[hiddenpath.GroupId]*HPGroup + HPPolicies HPPolicies + func LoadHPRegFromYaml(path string) (*HPRegistration, error) + func ParseHPRegYaml(b common.RawBytes) (*HPRegistration, error) + func (hp *HPRegistration) Validate() error + type InsertStats struct + Filtered int + Inserted int + Updated int + type MetricsDB struct + func DBWithMetrics(dbName string, db DB) *MetricsDB + func (db *MetricsDB) BeginTransaction(ctx context.Context, opts *sql.TxOptions) (Transaction, error) + func (db *MetricsDB) Close() error + func (db *MetricsDB) SetMaxIdleConns(maxIdleConns int) + func (db *MetricsDB) SetMaxOpenConns(maxOpenConns int) + func (e MetricsDB) AllRevocations(ctx context.Context) (<-chan RevocationOrErr, error) + func (e MetricsDB) BeaconSources(ctx context.Context) ([]addr.IA, error) + func (e MetricsDB) CandidateBeacons(ctx context.Context, setSize int, usage Usage, src addr.IA) (<-chan BeaconOrErr, error) + func (e MetricsDB) DeleteExpiredBeacons(ctx context.Context, now time.Time) (int, error) + func (e MetricsDB) DeleteExpiredRevocations(ctx context.Context, now time.Time) (int, error) + func (e MetricsDB) DeleteRevocation(ctx context.Context, ia addr.IA, ifid common.IFIDType) error + func (e MetricsDB) DeleteRevokedBeacons(ctx context.Context, now time.Time) (int, error) + func (e MetricsDB) InsertBeacon(ctx context.Context, beacon Beacon, usage Usage) (InsertStats, error) + func (e MetricsDB) InsertRevocation(ctx context.Context, revocation *path_mgmt.SignedRevInfo) error + type MetricsTransaction struct + func (e MetricsTransaction) AllRevocations(ctx context.Context) (<-chan RevocationOrErr, error) + func (e MetricsTransaction) BeaconSources(ctx context.Context) ([]addr.IA, error) + func (e MetricsTransaction) CandidateBeacons(ctx context.Context, setSize int, usage Usage, src addr.IA) (<-chan BeaconOrErr, error) + func (e MetricsTransaction) DeleteExpiredBeacons(ctx context.Context, now time.Time) (int, error) + func (e MetricsTransaction) DeleteExpiredRevocations(ctx context.Context, now time.Time) (int, error) + func (e MetricsTransaction) DeleteRevocation(ctx context.Context, ia addr.IA, ifid common.IFIDType) error + func (e MetricsTransaction) DeleteRevokedBeacons(ctx context.Context, now time.Time) (int, error) + func (e MetricsTransaction) InsertBeacon(ctx context.Context, beacon Beacon, usage Usage) (InsertStats, error) + func (e MetricsTransaction) InsertRevocation(ctx context.Context, revocation *path_mgmt.SignedRevInfo) error + func (tx *MetricsTransaction) Commit() error + func (tx *MetricsTransaction) Rollback() error + type Policies struct + DownReg Policy + Prop Policy + UpReg Policy + func (p *Policies) Filter(beacon Beacon) error + func (p *Policies) InitDefaults() + func (p *Policies) Usage(beacon Beacon) Usage + func (p *Policies) Validate() error + type Policy struct + BestSetSize int + CandidateSetSize int + Filter Filter + MaxExpTime *spath.ExpTimeType + Type PolicyType + func LoadPolicyFromYaml(path string, t PolicyType) (*Policy, error) + func ParsePolicyYaml(b common.RawBytes, t PolicyType) (*Policy, error) + func (p *Policy) InitDefaults() + type PolicyType string + const CoreRegPolicy + const DownRegPolicy + const PropPolicy + const UpRegPolicy + type RegPolicy struct + MaxExpiration util.DurWrap + RegDown bool + RegUp bool + type RevocationOrErr struct + Err error + Rev *path_mgmt.SignedRevInfo + type Store struct + func NewBeaconStore(policies Policies, db DB) (*Store, error) + func (s *Store) BeaconsToPropagate(ctx context.Context) (<-chan BeaconOrErr, error) + func (s *Store) Close() error + func (s *Store) DeleteExpiredBeacons(ctx context.Context) (int, error) + func (s *Store) DeleteExpiredRevocations(ctx context.Context) (int, error) + func (s *Store) DeleteRevocation(ctx context.Context, ia addr.IA, ifid common.IFIDType) error + func (s *Store) InsertBeacon(ctx context.Context, beacon Beacon) (InsertStats, error) + func (s *Store) InsertRevocations(ctx context.Context, revocations ...*path_mgmt.SignedRevInfo) error + func (s *Store) MaxExpTime(policyType PolicyType) spath.ExpTimeType + func (s *Store) PreFilter(beacon Beacon) error + func (s *Store) SegmentsToRegister(ctx context.Context, segType proto.PathSegType) (<-chan BeaconOrErr, error) + func (s *Store) UpdatePolicy(ctx context.Context, policy Policy) error + type Transaction interface + Commit func() error + Rollback func() error + type Usage int + const UsageCoreReg + const UsageDownReg + const UsageProp + const UsageUpReg + func UsageFromPolicyType(policyType PolicyType) Usage + func (u Usage) None() bool + func (u Usage) String() string