micro

package
v0.0.0-...-fdc4385 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name, Version string
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(opts ...Option) *Client

NewClient ...

func (*Client) Conn

func (c *Client) Conn() *grpc.ClientConn

Conn is *grpc.ClientConn

type Option

type Option interface {
	String() string
	Value() interface{}
}

Option ...

func Name

func Name(s string) Option

Name return name option for service

func RegistryCenter

func RegistryCenter(r Registry) Option

RegistryCenter return registry option for service

func Version

func Version(s string) Option

Version return version option for service

type Registry

type Registry interface {
	Register(*Service)
	UnRegister(*Service)
	Query(*Client) (string, error)
	String() string
}

Registry is registry center interface for service

func NewRegistry

func NewRegistry(driver string) Registry

NewRegistry return a registry center object

type Service

type Service struct {
	// S is grpc server
	S *grpc.Server

	Name, Version, UUID string
	// contains filtered or unexported fields
}

Service ...

func NewService

func NewService(opts ...Option) *Service

NewService ...

func (*Service) Init

func (s *Service) Init() *Service

Init ...

func (*Service) Serve

func (s *Service) Serve() error

Serve ...

Jump to

Keyboard shortcuts

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