rpc

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 32 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthService        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowService          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group")
)

Functions

func GetKey

func GetKey(svc *Service) string

func GetWatcherKey

func GetWatcherKey(name string) string

func NewGrpcConn

func NewGrpcConn(ctx context.Context, svcName string, client *clientv3.Client) (*grpc.ClientConn, error)

func NewGrpcServer

func NewGrpcServer(ctx context.Context, conf *Config, client *clientv3.Client) (*grpc.Server, error)

Types

type Config

type Config struct {
	Name     string `yaml:"name"`
	Bind     string `yaml:"bind"`
	HttpBind string `yaml:"http_bind"`
}

type Register

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

func (*Register) Deregister

func (r *Register) Deregister(ctx context.Context) error

func (*Register) Register

func (r *Register) Register(ctx context.Context, svc *Service) error

Register ctx Can only be cancelled and cannot carry the timeout

type Service

type Service struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Bind                 string   `protobuf:"bytes,2,opt,name=bind,proto3" json:"bind,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func GetSvc

func GetSvc(conf *Config) (*Service, error)

func (*Service) Descriptor

func (*Service) Descriptor() ([]byte, []int)

func (*Service) GetBind

func (m *Service) GetBind() string

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) Marshal

func (m *Service) Marshal() (dAtA []byte, err error)

func (*Service) MarshalTo

func (m *Service) MarshalTo(dAtA []byte) (int, error)

func (*Service) MarshalToSizedBuffer

func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) Size

func (m *Service) Size() (n int)

func (*Service) String

func (m *Service) String() string

func (*Service) Unmarshal

func (m *Service) Unmarshal(dAtA []byte) error

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Service) XXX_Merge

func (m *Service) XXX_Merge(src proto.Message)

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

func (m *Service) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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