grpc

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Descriptor

type Descriptor struct {
	// contains filtered or unexported fields
}

Descriptor loads descriptor from a service/project

func NewDescriptor

func NewDescriptor() *Descriptor

func (*Descriptor) GetAllMessages

func (s *Descriptor) GetAllMessages() []string

GetAllMessages returns all available messages

func (*Descriptor) GetAllMethods

func (s *Descriptor) GetAllMethods() []string

GetAllMethods returns all available methods

func (*Descriptor) GetMessage

func (s *Descriptor) GetMessage(ctx context.Context, name string) (*desc.MessageDescriptor, error)

GetMessage gets message descriptor

func (*Descriptor) GetMethod

func (s *Descriptor) GetMethod(ctx context.Context, methodPath string) (*desc.MethodDescriptor, error)

GetMethod gets method descriptor methodPath: full path of method, format must be /<service-name>/<method-name> for example: /offers.v1.OfferService/ValidateOffer

type HealthService

type HealthService struct{}

HealthService defines health check service

func (*HealthService) Check

Check checks server status

func (*HealthService) Watch

Watch performs a streaming health-check

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves grpc incoming requests

func NewServer

func NewServer(stubStore rio.StubStore, fileStorage fs.FileStorage, descriptor *ServiceDescriptor) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context, addr string) error

Start starts the grpc server

func (*Server) StartAsync

func (s *Server) StartAsync(ctx context.Context, addr string) error

StartAsync starts server in a different goroutine

type ServiceDescriptor

type ServiceDescriptor struct {
	// contains filtered or unexported fields
}

ServiceDescriptor manages descriptor for all services/projects Each grpc service has a different proto definitions and dependencies These proto files must be compressed into a zip file and uploaded to server

func NewServiceDescriptor

func NewServiceDescriptor(fileStorage fs.FileStorage) *ServiceDescriptor

func (*ServiceDescriptor) ClearCache

func (p *ServiceDescriptor) ClearCache(ctx context.Context) error

ClearCache clear cached files

func (*ServiceDescriptor) GetDescriptor

func (p *ServiceDescriptor) GetDescriptor(ctx context.Context, protoFileID string) (*Descriptor, error)

GetDescriptor loads service descriptors from a file storage

Jump to

Keyboard shortcuts

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