grpc

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Index

Constants

View Source
const Kind = service.GRPC

Variables

This section is empty.

Functions

This section is empty.

Types

type Closeable

type Closeable interface {
	Close() error
}

type Container

type Container struct {
	service.GrpcConn
	Svc  *Service
	Name string
}

func (*Container) Addr

func (c *Container) Addr() string

func (*Container) AddrOrPanic

func (c *Container) AddrOrPanic() string

func (*Container) NewHealthCheckClient

func (c *Container) NewHealthCheckClient() (service.HealthChecker, error)

type HealthCheckClient

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

func NewHelthCheckClient

func NewHelthCheckClient(ctx context.Context, addr string, name string, d service.GrpcDialer) (*HealthCheckClient, error)

func NewHelthCheckClientWithConn

func NewHelthCheckClientWithConn(conn *grpc.ClientConn, name string) (*HealthCheckClient, error)

func (*HealthCheckClient) Check

func (*HealthCheckClient) CheckOk

func (c *HealthCheckClient) CheckOk(ctx context.Context) error

func (*HealthCheckClient) Close

func (c *HealthCheckClient) Close() error

type HealthCheckFn

type HealthCheckFn func(context.Context) error

type NewServiceFn

type NewServiceFn func(context.Context) (any, error)

type Option

type Option interface {
	Apply(*Options)
}

func WithAddr

func WithAddr(a string) Option

Setters

func WithContext

func WithContext(ctx context.Context) Option

func WithHealthCheckFn

func WithHealthCheckFn(healthCheck HealthCheckFn) Option

func WithListener

func WithListener(l service.GrpcListener) Option

func WithName

func WithName(n string) Option

func WithNewServiceFn

func WithNewServiceFn(newService NewServiceFn) Option

func WithPProfAddr

func WithPProfAddr(addr *string) Option

func WithProfilingEnabled

func WithProfilingEnabled(p bool) Option

func WithServiceDesc

func WithServiceDesc(serviceDesc *grpc.ServiceDesc) Option

type Options

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

type Service

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

func New

func New(opts ...Option) (*Service, error)

func (*Service) Addr

func (g *Service) Addr() string

func (*Service) Dial

func (g *Service) Dial(d service.GrpcDialer) (*grpc.ClientConn, error)

func (*Service) Dispose

func (g *Service) Dispose()

func (*Service) DoServe

func (g *Service) DoServe(listener net.Listener) error

func (*Service) Metadata

func (g *Service) Metadata() map[string]string

func (*Service) Name

func (g *Service) Name() string

func (*Service) NewHelthCheckClient

func (g *Service) NewHelthCheckClient(d service.GrpcDialer) (*HealthCheckClient, error)

func (*Service) Serve

func (g *Service) Serve() error

func (*Service) Stop

func (g *Service) Stop()

Directories

Path Synopsis
testing

Jump to

Keyboard shortcuts

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