grpc

package
v0.3.7-beta Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: BSD-2-Clause Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closeable

type Closeable interface {
	Close() error
}

type HealthCheckFn

type HealthCheckFn func(context.Context) error

type HelthCheckClient

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

func NewHelthCheckClient

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

func NewHelthCheckClientWithConn

func NewHelthCheckClientWithConn(conn *grpc.ClientConn) (*HelthCheckClient, error)

func (*HelthCheckClient) Check

func (*HelthCheckClient) Close

func (c *HelthCheckClient) Close()

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 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) 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) Serve

func (g *Service) Serve() error

Directories

Path Synopsis
testing

Jump to

Keyboard shortcuts

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