service

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The default service name
	DefaultService = "go.micro.registry"
)

Functions

func NewRegistry

func NewRegistry(opts ...Option) registry.Registry

NewRegistry returns a new registry service client

func ToItem

func ToItem(s *pb.Item) registry.Item

func ToNode

func ToNode(n *pb.Node) registry.Node

func ToProtoItem

func ToProtoItem(i registry.Item) *pb.Item

func ToProtoNode

func ToProtoNode(n registry.Node) *pb.Node

func ToProtoService

func ToProtoService(s registry.Service) *pb.Service

func ToService

func ToService(s *pb.Service) registry.Service

Types

type Option

type Option func(*Options)

func WithConn

func WithConn(c grpc.ClientConnInterface) Option

WithConn sets the gRPC connection

type Options

type Options struct {
	Addrs     []string
	Timeout   time.Duration
	Secure    bool
	TLSConfig *tls.Config
	// Other options for implementations of the interface
	// can be stored in a context
	Context context.Context
}

type URLOpener

type URLOpener struct {
	grpc.ClientConnInterface
}

func (*URLOpener) OpenURL

func (o *URLOpener) OpenURL(ctx context.Context, u *url.URL) (registry.Registry, error)

Jump to

Keyboard shortcuts

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