backup

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QueryType_name = map[int32]string{
		0: "Phone",
		1: "Email",
		2: "Address",
	}
	QueryType_value = map[string]int32{
		"Phone":   0,
		"Email":   1,
		"Address": 2,
	}
)

Enum value maps for QueryType.

View Source
var Backup_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dtalk.backup.Backup",
	HandlerType: (*BackupServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Retrieve",
			Handler:    _Backup_Retrieve_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api.proto",
}

Backup_ServiceDesc is the grpc.ServiceDesc for Backup service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterBackupServer

func RegisterBackupServer(s grpc.ServiceRegistrar, srv BackupServer)

Types

type BackupClient

type BackupClient interface {
	Retrieve(ctx context.Context, in *RetrieveReq, opts ...grpc.CallOption) (*RetrieveReply, error)
}

BackupClient is the client API for Backup service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewBackupClient

func NewBackupClient(cc grpc.ClientConnInterface) BackupClient

type BackupServer

type BackupServer interface {
	Retrieve(context.Context, *RetrieveReq) (*RetrieveReply, error)
	// contains filtered or unexported methods
}

BackupServer is the server API for Backup service. All implementations must embed UnimplementedBackupServer for forward compatibility

type Client

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

func New

func New(etcdAddr, schema, srvName string, dial time.Duration) *Client

func (*Client) Retrieve

func (c *Client) Retrieve(ctx context.Context, tp QueryType, val string) (*RetrieveReply, error)

type QueryType

type QueryType int32
const (
	QueryType_Phone   QueryType = 0
	QueryType_Email   QueryType = 1
	QueryType_Address QueryType = 2
)

func (QueryType) Descriptor

func (QueryType) Descriptor() protoreflect.EnumDescriptor

func (QueryType) Enum

func (x QueryType) Enum() *QueryType

func (QueryType) EnumDescriptor deprecated

func (QueryType) EnumDescriptor() ([]byte, []int)

Deprecated: Use QueryType.Descriptor instead.

func (QueryType) Number

func (x QueryType) Number() protoreflect.EnumNumber

func (QueryType) String

func (x QueryType) String() string

func (QueryType) Type

type RetrieveReply

type RetrieveReply struct {
	Address    string `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
	Area       string `protobuf:"bytes,2,opt,name=Area,proto3" json:"Area,omitempty"`
	Phone      string `protobuf:"bytes,3,opt,name=Phone,proto3" json:"Phone,omitempty"`
	Email      string `protobuf:"bytes,4,opt,name=Email,proto3" json:"Email,omitempty"`
	Mnemonic   string `protobuf:"bytes,5,opt,name=Mnemonic,proto3" json:"Mnemonic,omitempty"`
	PrivateKey string `protobuf:"bytes,6,opt,name=PrivateKey,proto3" json:"PrivateKey,omitempty"`
	UpdateTime int64  `protobuf:"varint,7,opt,name=UpdateTime,proto3" json:"UpdateTime,omitempty"`
	CreateTime int64  `protobuf:"varint,8,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"`
	// contains filtered or unexported fields
}

func (*RetrieveReply) Descriptor deprecated

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

Deprecated: Use RetrieveReply.ProtoReflect.Descriptor instead.

func (*RetrieveReply) GetAddress

func (x *RetrieveReply) GetAddress() string

func (*RetrieveReply) GetArea

func (x *RetrieveReply) GetArea() string

func (*RetrieveReply) GetCreateTime

func (x *RetrieveReply) GetCreateTime() int64

func (*RetrieveReply) GetEmail

func (x *RetrieveReply) GetEmail() string

func (*RetrieveReply) GetMnemonic

func (x *RetrieveReply) GetMnemonic() string

func (*RetrieveReply) GetPhone

func (x *RetrieveReply) GetPhone() string

func (*RetrieveReply) GetPrivateKey

func (x *RetrieveReply) GetPrivateKey() string

func (*RetrieveReply) GetUpdateTime

func (x *RetrieveReply) GetUpdateTime() int64

func (*RetrieveReply) ProtoMessage

func (*RetrieveReply) ProtoMessage()

func (*RetrieveReply) ProtoReflect

func (x *RetrieveReply) ProtoReflect() protoreflect.Message

func (*RetrieveReply) Reset

func (x *RetrieveReply) Reset()

func (*RetrieveReply) String

func (x *RetrieveReply) String() string

type RetrieveReq

type RetrieveReq struct {
	Type QueryType `protobuf:"varint,1,opt,name=type,proto3,enum=dtalk.backup.QueryType" json:"type,omitempty"`
	Val  string    `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"`
	// contains filtered or unexported fields
}

func (*RetrieveReq) Descriptor deprecated

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

Deprecated: Use RetrieveReq.ProtoReflect.Descriptor instead.

func (*RetrieveReq) GetType

func (x *RetrieveReq) GetType() QueryType

func (*RetrieveReq) GetVal

func (x *RetrieveReq) GetVal() string

func (*RetrieveReq) ProtoMessage

func (*RetrieveReq) ProtoMessage()

func (*RetrieveReq) ProtoReflect

func (x *RetrieveReq) ProtoReflect() protoreflect.Message

func (*RetrieveReq) Reset

func (x *RetrieveReq) Reset()

func (*RetrieveReq) String

func (x *RetrieveReq) String() string

type UnimplementedBackupServer

type UnimplementedBackupServer struct {
}

UnimplementedBackupServer must be embedded to have forward compatible implementations.

func (UnimplementedBackupServer) Retrieve

type UnsafeBackupServer

type UnsafeBackupServer interface {
	// contains filtered or unexported methods
}

UnsafeBackupServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BackupServer will result in compilation errors.

Jump to

Keyboard shortcuts

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