rpc

package
v0.0.0-...-280633d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port     int
	CertFile string
	KeyFile  string
}

Config is the configuration for creating a Server instance.

type Server

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

Server is a normal server that processes the logic requested by the client.

func NewServer

func NewServer(conf *Config, yorkieConf *yorkie.Config, db database.Database) (*Server, error)

NewServer creates a new instance of Server.

func (*Server) CreateProject

func (s *Server) CreateProject(
	ctx context.Context,
	req *pb.CreateProjectRequest,
) (*pb.CreateProjectResponse, error)

CreateProject creates a new project of the given name.

func (*Server) DeleteProject

func (s *Server) DeleteProject(
	ctx context.Context,
	req *pb.DeleteProjectRequest,
) (*pb.DeleteProjectResponse, error)

DeleteProject deletes the given project.

func (*Server) GracefulStop

func (s *Server) GracefulStop()

GracefulStop stops the gRPC server gracefully.

func (*Server) ListProjects

func (s *Server) ListProjects(
	ctx context.Context,
	req *pb.ListProjectsRequest,
) (*pb.ListProjectsResponse, error)

ListProjects returns the list of projects.

func (*Server) Start

func (s *Server) Start() error

Start starts to handle requests on incoming connections.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the gRPC server. It immediately closes all open connections and listeners.

func (*Server) UpdateProject

func (s *Server) UpdateProject(
	ctx context.Context,
	req *pb.UpdateProjectRequest,
) (*pb.UpdateProjectResponse, error)

UpdateProject updates the given project.

Jump to

Keyboard shortcuts

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