Documentation ¶
Overview ¶
Package proto is used by some of the tools (currently only chifra names) to provide a gRPC server when needed.
Index ¶
- Constants
- Variables
- func GetContext() (context.Context, context.CancelFunc)
- func RegisterNamesServer(s grpc.ServiceRegistrar, srv NamesServer)
- func SocketAddress() string
- type CRUDResponse
- func (*CRUDResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CRUDResponse) GetError() string
- func (x *CRUDResponse) GetSuccess() bool
- func (*CRUDResponse) ProtoMessage()
- func (x *CRUDResponse) ProtoReflect() protoreflect.Message
- func (x *CRUDResponse) Reset()
- func (x *CRUDResponse) String() string
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetChain() string
- func (x *CreateRequest) GetName() *Name
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRequest) GetAddress() string
- func (x *DeleteRequest) GetChain() string
- func (*DeleteRequest) ProtoMessage()
- func (x *DeleteRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRequest) Reset()
- func (x *DeleteRequest) String() string
- type Name
- func (*Name) Descriptor() ([]byte, []int)deprecated
- func (x *Name) GetAddress() string
- func (x *Name) GetDecimals() uint64
- func (x *Name) GetDeleted() bool
- func (x *Name) GetIsContract() bool
- func (x *Name) GetIsCustom() bool
- func (x *Name) GetIsErc20() bool
- func (x *Name) GetIsErc721() bool
- func (x *Name) GetIsPrefund() bool
- func (x *Name) GetName() string
- func (x *Name) GetPetname() string
- func (x *Name) GetSource() string
- func (x *Name) GetSymbol() string
- func (x *Name) GetTags() string
- func (*Name) ProtoMessage()
- func (x *Name) ProtoReflect() protoreflect.Message
- func (x *Name) Reset()
- func (x *Name) String() string
- type NamesClient
- type NamesServer
- type Names_SearchStreamClient
- type Names_SearchStreamServer
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchRequest) GetParts() int64
- func (x *SearchRequest) GetSort() int64
- func (x *SearchRequest) GetTerms() []string
- func (*SearchRequest) ProtoMessage()
- func (x *SearchRequest) ProtoReflect() protoreflect.Message
- func (x *SearchRequest) Reset()
- func (x *SearchRequest) String() string
- type SearchResponse
- type UnimplementedNamesServer
- func (UnimplementedNamesServer) Create(context.Context, *CreateRequest) (*CRUDResponse, error)
- func (UnimplementedNamesServer) Delete(context.Context, *DeleteRequest) (*CRUDResponse, error)
- func (UnimplementedNamesServer) Remove(context.Context, *DeleteRequest) (*CRUDResponse, error)
- func (UnimplementedNamesServer) Search(context.Context, *SearchRequest) (*SearchResponse, error)
- func (UnimplementedNamesServer) SearchStream(*SearchRequest, Names_SearchStreamServer) error
- func (UnimplementedNamesServer) Undelete(context.Context, *DeleteRequest) (*CRUDResponse, error)
- func (UnimplementedNamesServer) Update(context.Context, *CreateRequest) (*CRUDResponse, error)
- type UnsafeNamesServer
Constants ¶
const ( Names_Search_FullMethodName = "/Names/Search" Names_SearchStream_FullMethodName = "/Names/SearchStream" Names_Create_FullMethodName = "/Names/Create" Names_Update_FullMethodName = "/Names/Update" Names_Delete_FullMethodName = "/Names/Delete" Names_Undelete_FullMethodName = "/Names/Undelete" Names_Remove_FullMethodName = "/Names/Remove" )
Variables ¶
var ErrServerNotRunning = errors.New("gRPC server not running")
var File_chifra_proto protoreflect.FileDescriptor
var Names_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Names", HandlerType: (*NamesServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Search", Handler: _Names_Search_Handler, }, { MethodName: "Create", Handler: _Names_Create_Handler, }, { MethodName: "Update", Handler: _Names_Update_Handler, }, { MethodName: "Delete", Handler: _Names_Delete_Handler, }, { MethodName: "Undelete", Handler: _Names_Undelete_Handler, }, { MethodName: "Remove", Handler: _Names_Remove_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "SearchStream", Handler: _Names_SearchStream_Handler, ServerStreams: true, }, }, Metadata: "chifra.proto", }
Names_ServiceDesc is the grpc.ServiceDesc for Names service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func GetContext ¶
func GetContext() (context.Context, context.CancelFunc)
func RegisterNamesServer ¶
func RegisterNamesServer(s grpc.ServiceRegistrar, srv NamesServer)
func SocketAddress ¶
func SocketAddress() string
Types ¶
type CRUDResponse ¶
type CRUDResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Error *string `protobuf:"bytes,2,opt,name=error,proto3,oneof" json:"error,omitempty"` // contains filtered or unexported fields }
func (*CRUDResponse) Descriptor
deprecated
func (*CRUDResponse) Descriptor() ([]byte, []int)
Deprecated: Use CRUDResponse.ProtoReflect.Descriptor instead.
func (*CRUDResponse) GetError ¶
func (x *CRUDResponse) GetError() string
func (*CRUDResponse) GetSuccess ¶
func (x *CRUDResponse) GetSuccess() bool
func (*CRUDResponse) ProtoMessage ¶
func (*CRUDResponse) ProtoMessage()
func (*CRUDResponse) ProtoReflect ¶
func (x *CRUDResponse) ProtoReflect() protoreflect.Message
func (*CRUDResponse) Reset ¶
func (x *CRUDResponse) Reset()
func (*CRUDResponse) String ¶
func (x *CRUDResponse) String() string
type CreateRequest ¶
type CreateRequest struct { Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` Name *Name `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetChain ¶
func (x *CreateRequest) GetChain() string
func (*CreateRequest) GetName ¶
func (x *CreateRequest) GetName() *Name
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
type DeleteRequest ¶
type DeleteRequest struct { Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetAddress ¶
func (x *DeleteRequest) GetAddress() string
func (*DeleteRequest) GetChain ¶
func (x *DeleteRequest) GetChain() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type Name ¶
type Name struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Decimals *uint64 `protobuf:"varint,2,opt,name=decimals,proto3,oneof" json:"decimals,omitempty"` Deleted *bool `protobuf:"varint,3,opt,name=deleted,proto3,oneof" json:"deleted,omitempty"` IsContract *bool `protobuf:"varint,4,opt,name=isContract,proto3,oneof" json:"isContract,omitempty"` IsCustom *bool `protobuf:"varint,5,opt,name=isCustom,proto3,oneof" json:"isCustom,omitempty"` IsErc20 *bool `protobuf:"varint,6,opt,name=isErc20,proto3,oneof" json:"isErc20,omitempty"` IsErc721 *bool `protobuf:"varint,7,opt,name=isErc721,proto3,oneof" json:"isErc721,omitempty"` IsPrefund *bool `protobuf:"varint,8,opt,name=isPrefund,proto3,oneof" json:"isPrefund,omitempty"` Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` Petname *string `protobuf:"bytes,10,opt,name=petname,proto3,oneof" json:"petname,omitempty"` Source *string `protobuf:"bytes,11,opt,name=source,proto3,oneof" json:"source,omitempty"` Symbol *string `protobuf:"bytes,12,opt,name=symbol,proto3,oneof" json:"symbol,omitempty"` Tags *string `protobuf:"bytes,13,opt,name=tags,proto3,oneof" json:"tags,omitempty"` // contains filtered or unexported fields }
func (*Name) Descriptor
deprecated
func (*Name) GetAddress ¶
func (*Name) GetDecimals ¶
func (*Name) GetDeleted ¶
func (*Name) GetIsContract ¶
func (*Name) GetIsCustom ¶
func (*Name) GetIsErc20 ¶
func (*Name) GetIsErc721 ¶
func (*Name) GetIsPrefund ¶
func (*Name) GetPetname ¶
func (*Name) ProtoMessage ¶
func (*Name) ProtoMessage()
func (*Name) ProtoReflect ¶
func (x *Name) ProtoReflect() protoreflect.Message
type NamesClient ¶
type NamesClient interface { // Search Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) SearchStream(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (Names_SearchStreamClient, error) // CRUD Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CRUDResponse, error) Update(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CRUDResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*CRUDResponse, error) Undelete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*CRUDResponse, error) Remove(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*CRUDResponse, error) }
NamesClient is the client API for Names service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func Connect ¶
func Connect(ctx context.Context) (connection *grpc.ClientConn, client NamesClient, err error)
func NewNamesClient ¶
func NewNamesClient(cc grpc.ClientConnInterface) NamesClient
type NamesServer ¶
type NamesServer interface { // Search Search(context.Context, *SearchRequest) (*SearchResponse, error) SearchStream(*SearchRequest, Names_SearchStreamServer) error // CRUD Create(context.Context, *CreateRequest) (*CRUDResponse, error) Update(context.Context, *CreateRequest) (*CRUDResponse, error) Delete(context.Context, *DeleteRequest) (*CRUDResponse, error) Undelete(context.Context, *DeleteRequest) (*CRUDResponse, error) Remove(context.Context, *DeleteRequest) (*CRUDResponse, error) // contains filtered or unexported methods }
NamesServer is the server API for Names service. All implementations must embed UnimplementedNamesServer for forward compatibility
type Names_SearchStreamClient ¶
type Names_SearchStreamClient interface { Recv() (*Name, error) grpc.ClientStream }
type Names_SearchStreamServer ¶
type Names_SearchStreamServer interface { Send(*Name) error grpc.ServerStream }
type SearchRequest ¶
type SearchRequest struct { Parts int64 `protobuf:"varint,1,opt,name=parts,proto3" json:"parts,omitempty"` Terms []string `protobuf:"bytes,2,rep,name=terms,proto3" json:"terms,omitempty"` Sort int64 `protobuf:"varint,3,opt,name=sort,proto3" json:"sort,omitempty"` // contains filtered or unexported fields }
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetParts ¶
func (x *SearchRequest) GetParts() int64
func (*SearchRequest) GetSort ¶
func (x *SearchRequest) GetSort() int64
func (*SearchRequest) GetTerms ¶
func (x *SearchRequest) GetTerms() []string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type SearchResponse ¶
type SearchResponse struct { Names []*Name `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` // contains filtered or unexported fields }
func (*SearchResponse) Descriptor
deprecated
func (*SearchResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) GetNames ¶
func (x *SearchResponse) GetNames() []*Name
func (*SearchResponse) ProtoMessage ¶
func (*SearchResponse) ProtoMessage()
func (*SearchResponse) ProtoReflect ¶
func (x *SearchResponse) ProtoReflect() protoreflect.Message
func (*SearchResponse) Reset ¶
func (x *SearchResponse) Reset()
func (*SearchResponse) String ¶
func (x *SearchResponse) String() string
type UnimplementedNamesServer ¶
type UnimplementedNamesServer struct { }
UnimplementedNamesServer must be embedded to have forward compatible implementations.
func (UnimplementedNamesServer) Create ¶
func (UnimplementedNamesServer) Create(context.Context, *CreateRequest) (*CRUDResponse, error)
func (UnimplementedNamesServer) Delete ¶
func (UnimplementedNamesServer) Delete(context.Context, *DeleteRequest) (*CRUDResponse, error)
func (UnimplementedNamesServer) Remove ¶
func (UnimplementedNamesServer) Remove(context.Context, *DeleteRequest) (*CRUDResponse, error)
func (UnimplementedNamesServer) Search ¶
func (UnimplementedNamesServer) Search(context.Context, *SearchRequest) (*SearchResponse, error)
func (UnimplementedNamesServer) SearchStream ¶
func (UnimplementedNamesServer) SearchStream(*SearchRequest, Names_SearchStreamServer) error
func (UnimplementedNamesServer) Undelete ¶
func (UnimplementedNamesServer) Undelete(context.Context, *DeleteRequest) (*CRUDResponse, error)
func (UnimplementedNamesServer) Update ¶
func (UnimplementedNamesServer) Update(context.Context, *CreateRequest) (*CRUDResponse, error)
type UnsafeNamesServer ¶
type UnsafeNamesServer interface {
// contains filtered or unexported methods
}
UnsafeNamesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NamesServer will result in compilation errors.