crpc

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, serviceName string, etcdUrls []string) (*grpc.ClientConn, error)

Types

type GetMachineIP

type GetMachineIP func() string

type Option

type Option func(o *options)

func AfterStart

func AfterStart(fn func() error) Option

func BeforeStart

func BeforeStart(fn func() error) Option

func Context

func Context(ctx context.Context) Option

func EtcdUrls

func EtcdUrls(urls []string) Option

func GetMachineIPFn

func GetMachineIPFn(fn GetMachineIP) Option

func Metadata

func Metadata(md map[string]string) Option

func Name

func Name(name string) Option

func RegisterServiceFn

func RegisterServiceFn(fn func(*server.Server)) Option

func Registrar

func Registrar(r sd.Registrar) Option

func Server

func Server(srv *server.Server) Option

type Service

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

func NewService

func NewService(opts ...Option) *Service

func (*Service) Metadata

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

func (*Service) Name

func (s *Service) Name() string

func (*Service) Run

func (s *Service) Run() error

func (*Service) Server

func (s *Service) Server() *server.Server

Directories

Path Synopsis
_examples
pb
sd

Jump to

Keyboard shortcuts

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