rpc

package
v0.0.0-...-4092974 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const KeyPath = "key"

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	pb.UnimplementedRPCServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(repository i.Repository, logger i.Logger) *Server

NewServer creates new gRPC server with repository and logger

func (*Server) Create

func (s *Server) Create(ctx context.Context, in *pb.Entity) (*pb.CommandResponse, error)

Create creates new document in db

func (*Server) Delete

func (s *Server) Delete(ctx context.Context, in *pb.KeyRequest) (*pb.CommandResponse, error)

Delete deletes entity found by key (id)

func (*Server) Get

func (s *Server) Get(ctx context.Context, in *pb.KeyRequest) (*pb.Entity, error)

Get returns single entity found by key (id)

func (*Server) Import

func (s *Server) Import(stream pb.RPC_ImportServer) error

Import implements RPC_ImportServer

func (*Server) Index

func (s *Server) Index(ctx context.Context, in *pb.IndexRequest) (*pb.IndexResponse, error)

Index returns batch of Entities

func (*Server) Patch

Patch updates values of existing document with the same id

func (*Server) Put

Put replaces document with the new one with the same id

Jump to

Keyboard shortcuts

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