gf

package
v0.0.0-...-8a5cab9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Port int
	Host string
}

Addr for host port

func (*Addr) String

func (a *Addr) String() string

Addr returns host port

type Service

type Service struct {
	ID   string
	Name string

	ServiceAdrr    Addr
	PrometheusAdrr Addr
	// Interceptors
	UnaryInterceptors  []grpc.UnaryServerInterceptor
	StreamInterceptors []grpc.StreamServerInterceptor
	// The RPC server implementation
	GRPCServer func(*grpc.Server)
	// Tracing
	Tracer opentracing.Tracer
	//Registry
	Registry registry.Registry
	// contains filtered or unexported fields
}

Service define.

func NewService

func NewService(name string) *Service

NewService creates a service

func (*Service) AddStreamInterceptor

func (service *Service) AddStreamInterceptor(interceptor grpc.StreamServerInterceptor)

AddStreamInterceptor adds a stream interceptor to the RPC server

func (*Service) AddUnaryInterceptor

func (service *Service) AddUnaryInterceptor(interceptor grpc.UnaryServerInterceptor)

AddUnaryInterceptor adds a unary interceptor to the RPC server

func (*Service) GRPCImplementation

func (service *Service) GRPCImplementation(r func(*grpc.Server))

GRPCImplementation for GRPCServer

func (*Service) Run

func (service *Service) Run()

Run service

func (*Service) Shutdown

func (service *Service) Shutdown()

Shutdown service server instance

func (*Service) UsePrometheusAdrr

func (service *Service) UsePrometheusAdrr(addr Addr)

UsePrometheusAdrr to set PrometheusAdrr

func (*Service) UseRegistry

func (service *Service) UseRegistry(r registry.Registry)

UseRegistry to set registry

func (*Service) UseServiceAdrr

func (service *Service) UseServiceAdrr(addr Addr)

UseServiceAdrr to set ServiceAdrr

func (*Service) UseTracer

func (service *Service) UseTracer(t opentracing.Tracer)

UseTracer to set tracer

Directories

Path Synopsis
lb

Jump to

Keyboard shortcuts

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