api

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// JsonPbMarshaller is the marshaller used for serializing protobuf messages.
	JsonPbMarshaller = &jsonpb.Marshaler{}
)

Functions

func LogProtoMessage

func LogProtoMessage(msg interface{}) (attrs logger.Attrs)

LogProtoMessage serializes proto.Message into loggable attributes.

func NewService

func NewService(backend service.Backend) (service.Service, error)

func UnaryServerLogger

func UnaryServerLogger() grpc.UnaryServerInterceptor

Types

type API

type API interface {
	AttachToAPI(api *Service)
}

type Constructor

type Constructor func(backend service.Backend) (API, error)

type Service

type Service struct {
	GrpcServer *grpc.Server
	HttpServer *gin.Engine
	// contains filtered or unexported fields
}

func (*Service) Attach

func (service *Service) Attach(name string, api API)

func (*Service) Start

func (service *Service) Start() error

Start serves gRPC server and HTTP REST API Server on given TCP port.

func (*Service) Stop

func (service *Service) Stop()

Stop stops gRPC server.

Jump to

Keyboard shortcuts

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