model

package
v0.0.0-...-8887655 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedPrefix

type AllowedPrefix struct {
	Prefix    net.IPNet
	MaxLength int64
	TA        string
}

func (*AllowedPrefix) String

func (p *AllowedPrefix) String() string

type Model

type Model interface {
	MigrateUp() error

	RecordPeeringDBPeers(ctx context.Context, members []*pb.PeeringDBMember) error
	RecordPeeringDBPeerRouters(ctx context.Context, members []*pb.PeeringDBMember) error
	GetPeeringDBPeer(ctx context.Context, asn int64) (*pb.PeeringDBMember, error)

	GetCheckablePeers(ctx context.Context) ([]*Peer, error)
	SubmitPeerCheckResults(ctx context.Context, checkName string, res []*PeerCheckResult) error
	GetPeerCheckResults(ctx context.Context, asn []int64) ([]*PeerCheckResult, error)

	UpdatePGPKey(ctx context.Context, key *PeerPGPKey) error
	GetPGPKeysRequiringAttention(ctx context.Context) ([]*PeerPGPKey, error)
	ValidatePGPKeys(ctx context.Context, positive, negative []string) error
	GetPeerPGPKey(ctx context.Context, asn int64) (*PeerPGPKey, error)

	ConfigureMissingSessions(ctx context.Context, gen func() SessionConfig) error

	GetPeerConfiguration(ctx context.Context) ([]*PeerConfiguration, error)

	UpdateAllowedPrefixes(ctx context.Context, asn int64, prefixes []*AllowedPrefix) error
	GetAllowedPrefixes(ctx context.Context, asn int64) ([]*AllowedPrefix, error)
}

func Connect

func Connect(ctx context.Context, driver, dsn string) (Model, error)

type Peer

type Peer struct {
	ASN     int64
	Name    string
	Routers []*Router
}

func (*Peer) String

func (p *Peer) String() string

type PeerCheckResult

type PeerCheckResult struct {
	PeerASN   int64
	CheckName string
	Time      time.Time
	Status    PeerCheckStatus
	Message   string
}

func (*PeerCheckResult) String

func (p *PeerCheckResult) String() string

type PeerCheckStatus

type PeerCheckStatus int
const (
	PeerCheckStatus_Invalid PeerCheckStatus = iota
	PeerCheckStatus_Okay
	PeerCheckStatus_Failed
	PeerCheckStatus_SoftFailed
)

type PeerConfiguration

type PeerConfiguration struct {
	Peer Peer
	Key  PeerPGPKey
}

func (*PeerConfiguration) String

func (p *PeerConfiguration) String() string

type PeerPGPKey

type PeerPGPKey struct {
	PeerASN     int64
	Fingerprint string
	State       string
}

func (*PeerPGPKey) String

func (p *PeerPGPKey) String() string

type Router

type Router struct {
	V6     net.IP
	V4     net.IP
	Config *SessionConfig
}

func (*Router) String

func (p *Router) String() string

type SessionConfig

type SessionConfig struct {
	BGPSecret string
}

func (*SessionConfig) String

func (p *SessionConfig) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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