grpc

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 14 Imported by: 13

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, tr tracing.Handler) 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
	Channel chan interface{}

	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

ProcessOAM is the handler function for the method ProcessOAM

func (*Service) CreateMeshInstance

CreateMeshInstance is the handler function for the method CreateMeshInstance.

func (*Service) MeshName

MeshName is the handler function for the method MeshName.

func (*Service) MeshVersions added in v0.1.14

ProcessOAM is the handler function for the method ProcessOAM

func (*Service) ProcessOAM added in v0.1.13

ProcessOAM is the handler function for the method ProcessOAM

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