grpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 12

Documentation

Overview

Package grpc implements the MeshServiceServer which is the server API for MeshService service.

A specific adapter creates an instance of the struct Service (see below) and populates it with parameters, the adapter handler, etc. The adapter handler extends the default adapter handler (see package adapter). The struct Service is used as parameter in the func Start (see below) that starts and runs the MeshServiceServer. This is usually implemented in the package main of an adapter.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestInvalidCode = "1000"
	ErrPanicCode          = "1001"
	ErrGrpcListenerCode   = "1002"
	ErrGrpcServerCode     = "1003"

	ErrRequestInvalid = errors.New(ErrRequestInvalidCode, errors.Alert, []string{"Apply Request invalid"}, []string{}, []string{}, []string{})
)

Functions

func ErrGrpcListener

func ErrGrpcListener(err error) error

func ErrGrpcServer

func ErrGrpcServer(err error) error

func ErrPanic

func ErrPanic(r interface{}) error

func Start

func Start(s *Service) error

Start starts grpc server.

Types

type Service

type Service struct {
	Name      string    `json:"name"`
	Type      string    `json:"type"`
	Port      string    `json:"port"`
	Version   string    `json:"version"`
	GitSHA    string    `json:"gitsha"`
	StartedAt time.Time `json:"startedat"`
	TraceURL  string    `json:"traceurl"`

	Handler       adapter.Handler
	EventStreamer *events.EventStreamer

	meshes.UnimplementedMeshServiceServer
}

Service object holds all the information about the server parameters.

func (*Service) ApplyOperation

func (s *Service) ApplyOperation(ctx context.Context, req *meshes.ApplyRuleRequest) (*meshes.ApplyRuleResponse, error)

ApplyOperation is the handler function for the method ApplyOperation.

func (*Service) ComponentInfo added in v0.1.14

func (*Service) MeshName

MeshName is the handler function for the method MeshName.

func (*Service) MeshVersions added in v0.1.14

func (*Service) StreamEvents

StreamEvents is the handler function for the method StreamEvents.

func (*Service) SupportedOperations

SupportedOperations is the handler function for the method SupportedOperations.

Jump to

Keyboard shortcuts

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