forked from hswaw/hscloud
67 lines
1.5 KiB
Go
67 lines
1.5 KiB
Go
package model
|
|
|
|
import "database/sql"
|
|
|
|
type sqlPeer struct {
|
|
ID string `db:"id"`
|
|
ASN string `db:"asn"`
|
|
Name string `db:"name"`
|
|
Source string `db:"source"`
|
|
}
|
|
|
|
type sqlPeerRouter struct {
|
|
ID string `db:"id"`
|
|
PeerID string `db:"peer_id"`
|
|
V6 sql.NullString `db:"v6"`
|
|
V4 sql.NullString `db:"v4"`
|
|
Source string `db:"source"`
|
|
|
|
// Fake, used by app logic.
|
|
ASN string `db:"asn"`
|
|
}
|
|
|
|
type sqlPeerCheck struct {
|
|
ID string `db:"id"`
|
|
PeerID string `db:"peer_id"`
|
|
CheckName string `db:"check_name"`
|
|
CheckTime int64 `db:"check_time"`
|
|
CheckStatus string `db:"check_status"`
|
|
CheckMessage string `db:"check_message"`
|
|
Delete bool `db:"delete"`
|
|
|
|
// Fake, used by app logic.
|
|
ASN string `db:"asn"`
|
|
}
|
|
|
|
type sqlPeerPGPKey struct {
|
|
ID string `db:"id"`
|
|
PeerID string `db:"peer_id"`
|
|
Fingerprint string `db:"fingerprint"`
|
|
TimeCreated int64 `db:"time_created"`
|
|
State string `db:"state"`
|
|
|
|
// Fake, used by app logic.
|
|
ASN string `db:"asn"`
|
|
}
|
|
|
|
type sqlSessionConfig struct {
|
|
ID string `db:"id"`
|
|
PeerID string `db:"peer_id"`
|
|
PeerRouterID string `db:"peer_router_id"`
|
|
|
|
BGPSecret string `db:"bgp_secret"`
|
|
}
|
|
|
|
type sqlAllowedPrefix struct {
|
|
ID string `db:"id"`
|
|
PeerID string `db:"peer_id"`
|
|
Timestamp int64 `db:"timestamp"`
|
|
|
|
Prefix string `db:"prefix"`
|
|
MaxLength int64 `db:"max_length"`
|
|
TA string `db:"ta"`
|
|
|
|
// Fake, used by app logic.
|
|
ASN string `db:"asn"`
|
|
}
|