Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { BeginTransaction(ctx context.Context, opts *sql.TxOptions) (Transaction, error) ReserverOnly TransitOnly ReserverAndTransit db.LimitSetter io.Closer }
DB is the interface for any reservation backend.
type ReserverAndTransit ¶
type ReserverAndTransit interface { // GetSegmentRsvFromID will return the reservation with that ID. // Used by setup/renew req/resp. and any request. GetSegmentRsvFromID(ctx context.Context, ID *reservation.SegmentID) ( *segment.Reservation, error) // PersistSegmentRsv ensures the DB contains the reservation as represented in rsv. PersistSegmentRsv(ctx context.Context, rsv *segment.Reservation) error // DeleteSegmentRsv removes the segment reservation. Used in teardown. DeleteSegmentRsv(ctx context.Context, ID *reservation.SegmentID) error // DeleteExpiredIndices will remove expired indices from the DB. If a reservation is left // without any index after removing the expired ones, it will also be removed. This applies to // both segment and e2e reservations. // Used on schedule. DeleteExpiredIndices(ctx context.Context, now time.Time) (int, error) // GetE2ERsvFromID finds the end to end resevation given its ID. GetE2ERsvFromID(ctx context.Context, ID *reservation.E2EID) (*e2e.Reservation, error) // GetE2ERsvsOnSegRsv returns the e2e reservations running on top of a given segment one. GetE2ERsvsOnSegRsv(ctx context.Context, ID *reservation.SegmentID) ([]*e2e.Reservation, error) // PersistE2ERsv makes the DB reflect the same contents as the rsv parameter. PersistE2ERsv(ctx context.Context, rsv *e2e.Reservation) error }
ReserverAndTransit contains the functionality for any AS that has a COLIBRI service.
type ReserverOnly ¶
type ReserverOnly interface { // GetSegmentRsvsFromSrcDstIA returns all reservations that start at src AS and end in dst AS. GetSegmentRsvsFromSrcDstIA(ctx context.Context, srcIA, dstIA addr.IA) ( []*segment.Reservation, error) // GetSegmentRsvFromPath searches for a segment reservation with the specified path. GetSegmentRsvFromPath(ctx context.Context, path segment.ReservationTransparentPath) ( *segment.Reservation, error) // NewSegmentRsv creates a new segment reservation in the DB, with an unused reservation ID. // The created ID is set in the reservation pointer argument. Used by setup req. NewSegmentRsv(ctx context.Context, rsv *segment.Reservation) error }
ReserverOnly has the methods available to the AS that starts the reservation.
type Transaction ¶
type Transaction interface { ReserverOnly TransitOnly ReserverAndTransit Commit() error Rollback() error }
type TransitOnly ¶
type TransitOnly interface { // GetAllSegmentRsvs returns all segment reservations. Used by setup req. GetAllSegmentRsvs(ctx context.Context) ([]*segment.Reservation, error) // GetSegmentRsvsFromIFPair returns all segment reservations that enter this AS at // the specified ingress and exit at that egress. Used by setup req. GetSegmentRsvsFromIFPair(ctx context.Context, ingress, egress *uint16) ( []*segment.Reservation, error) }
TransitOnly represents an AS in-path of a reservation, not the one originating it.
Directories ¶
Path | Synopsis |
---|---|
Package mock_backend is a generated GoMock package.
|
Package mock_backend is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.