Documentation ¶
Index ¶
- type MemoryRepository
- func (mr *MemoryRepository) GetFeature(_ context.Context, req *routeguidepb.GetFeatureRequest) (*routeguidepb.GetFeatureResponse, error)
- func (mr *MemoryRepository) ListFeatures(req *routeguidepb.ListFeaturesRequest, ...) error
- func (mr *MemoryRepository) RecordRoute(stream routeguidepb.RouteGuideService_RecordRouteServer) error
- func (mr *MemoryRepository) RouteChat(stream routeguidepb.RouteGuideService_RouteChatServer) error
- type Option
- type Repository
- type ServiceServer
- func (srv *ServiceServer) GetFeature(ctx context.Context, req *routeguidepb.GetFeatureRequest) (*routeguidepb.GetFeatureResponse, error)
- func (srv *ServiceServer) ListFeatures(req *routeguidepb.ListFeaturesRequest, ...) error
- func (srv *ServiceServer) RecordRoute(req routeguidepb.RouteGuideService_RecordRouteServer) error
- func (srv *ServiceServer) RegisterGRPC(s *grpc.Server)
- func (srv *ServiceServer) RouteChat(req routeguidepb.RouteGuideService_RouteChatServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryRepository ¶
type MemoryRepository struct { routeguidepb.UnimplementedRouteGuideServiceServer // contains filtered or unexported fields }
MemoryRepository fulfills the Repository interface
func NewMemoryRepository ¶
func NewMemoryRepository(filePath string) (*MemoryRepository, error)
NewMemoryRepository is a factory function to generate a new repository
func (*MemoryRepository) GetFeature ¶
func (mr *MemoryRepository) GetFeature(_ context.Context, req *routeguidepb.GetFeatureRequest) (*routeguidepb.GetFeatureResponse, error)
GetFeature returns the feature at the given point.
func (*MemoryRepository) ListFeatures ¶
func (mr *MemoryRepository) ListFeatures(req *routeguidepb.ListFeaturesRequest, stream routeguidepb.RouteGuideService_ListFeaturesServer) error
func (*MemoryRepository) RecordRoute ¶
func (mr *MemoryRepository) RecordRoute(stream routeguidepb.RouteGuideService_RecordRouteServer) error
func (*MemoryRepository) RouteChat ¶
func (mr *MemoryRepository) RouteChat(stream routeguidepb.RouteGuideService_RouteChatServer) error
type Option ¶
type Option func(*ServiceServer) error
func WithMemoryRepository ¶
func WithMemoryRepository() Option
WithMemoryRepository applies a memory repository to the ServiceServer
func WithRepository ¶
func WithRepository(repo Repository) Option
WithRepository applies a given repository to the ServiceServer
type Repository ¶
type Repository interface { routeguidepb.RouteGuideServiceServer }
type ServiceServer ¶
type ServiceServer struct { routeguidepb.UnimplementedRouteGuideServiceServer // contains filtered or unexported fields }
ServiceServer ServiceServer
func NewServiceServer ¶
func NewServiceServer(logger log.Logger, opts ...Option) (*ServiceServer, error)
func (*ServiceServer) GetFeature ¶
func (srv *ServiceServer) GetFeature(ctx context.Context, req *routeguidepb.GetFeatureRequest) (*routeguidepb.GetFeatureResponse, error)
GetFeature returns the feature at the given point.
func (*ServiceServer) ListFeatures ¶
func (srv *ServiceServer) ListFeatures(req *routeguidepb.ListFeaturesRequest, stream routeguidepb.RouteGuideService_ListFeaturesServer) error
func (*ServiceServer) RecordRoute ¶
func (srv *ServiceServer) RecordRoute(req routeguidepb.RouteGuideService_RecordRouteServer) error
func (*ServiceServer) RegisterGRPC ¶
func (srv *ServiceServer) RegisterGRPC(s *grpc.Server)
func (*ServiceServer) RouteChat ¶
func (srv *ServiceServer) RouteChat(req routeguidepb.RouteGuideService_RouteChatServer) error
Click to show internal directories.
Click to hide internal directories.