Documentation
¶
Overview ¶
Package server defines the basic elements of a gRIBI server that uses an in-memory data store for the AFT contents.
Index ¶
- Constants
- func DisableRIBCheckFn() *disableCheckFn
- func WithNoRIBForwardReferences() *disableRIBForwardRefs
- func WithPostChangeRIBHook(fn rib.RIBHookFn) *postChangeRibHook
- func WithRIBResolvedEntryHook(fn rib.ResolvedEntryFn) *resolvedEntryHook
- func WithVRFs(names []string) *withVRFs
- type FakeServer
- type Server
- type ServerOpt
Constants ¶
const (
// DefaultNetworkInstanceName specifies the name of the default network instance on the system.
DefaultNetworkInstanceName = "DEFAULT"
)
Variables ¶
This section is empty.
Functions ¶
func DisableRIBCheckFn ¶
func DisableRIBCheckFn() *disableCheckFn
DisableRIBCheckFn specifies that the consistency checking functions should be disabled for the RIB. It is useful for a testing RIB that does not need to have working references.
func WithNoRIBForwardReferences ¶
func WithNoRIBForwardReferences() *disableRIBForwardRefs
WithNoRIBForwardReferences specifies that the server should not accept forward references in the RIB. This means that next-hop-groups should not be able to reference next-hops that do not exist, and entries cannot reference missing next-hop-groups.
func WithPostChangeRIBHook ¶
WithPostChangeRIBHook specifies that the given function that is of type rib.RIBHook function should be executed after each change in the RIB.
func WithRIBResolvedEntryHook ¶
func WithRIBResolvedEntryHook(fn rib.ResolvedEntryFn) *resolvedEntryHook
WithResolvedEntryHook is a Server option that allows a function to be run for each entry that can be fully resolved within the RIB (e.g., IPv4Entry).
Types ¶
type FakeServer ¶
type FakeServer struct {
*Server
}
FakeServer is a wrapper around the server with functions to enable testing to be performed more easily, for example, injecting specific state.
func NewFake ¶
func NewFake(opt ...ServerOpt) (*FakeServer, error)
NewFake returns a new version of the fake server. This implementation wraps the Server implementation with functions to insert specific state into the server without a need to use the public APIs.
func (*FakeServer) InjectElectionID ¶
func (f *FakeServer) InjectElectionID(id *spb.Uint128)
InjectElectionID allows a client to set an initial election ID on the server as though it was received from the client.
func (*FakeServer) InjectRIB ¶
func (f *FakeServer) InjectRIB(r *rib.RIB)
InjectRIB allows a client to inject a RIB into the server as though it was received from the master client.
type Server ¶
type Server struct { *spb.UnimplementedGRIBIServer // contains filtered or unexported fields }
Server implements the gRIBI service.
func (*Server) Flush ¶
func (s *Server) Flush(ctx context.Context, req *spb.FlushRequest) (*spb.FlushResponse, error)
Flush implements the gRIBI Flush RPC - used for removing entries from the server.
func (*Server) Get ¶
func (s *Server) Get(req *spb.GetRequest, stream spb.GRIBI_GetServer) error
Get implements the gRIBI Get RPC.