account

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Overview

Package account is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Account_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.account.Account",
	HandlerType: (*AccountServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterAccount",
			Handler:    _Account_RegisterAccount_Handler,
		},
		{
			MethodName: "GetPublicKey",
			Handler:    _Account_GetPublicKey_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1/account/service.proto",
}

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

View Source
var File_v1_account_service_proto protoreflect.FileDescriptor

Functions

func RegisterAccountHandler

func RegisterAccountHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAccountHandler registers the http handlers for service Account to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAccountHandlerClient

func RegisterAccountHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountClient) error

RegisterAccountHandlerClient registers the http handlers for service Account to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccountClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccountClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AccountClient" to call the correct interceptors.

func RegisterAccountHandlerFromEndpoint

func RegisterAccountHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAccountHandlerFromEndpoint is same as RegisterAccountHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAccountHandlerServer

func RegisterAccountHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServer) error

RegisterAccountHandlerServer registers the http handlers for service Account to "mux". UnaryRPC :call AccountServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAccountHandlerFromEndpoint instead.

func RegisterAccountServer

func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer)

Types

type AccountClient

type AccountClient interface {
	RegisterAccount(ctx context.Context, in *RegisterAccountRequest, opts ...grpc.CallOption) (*RegisterAccountResponse, error)
	GetPublicKey(ctx context.Context, in *GetPublicKeyRequest, opts ...grpc.CallOption) (*GetPublicKeyResponse, error)
}

AccountClient is the client API for Account 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 NewAccountClient

func NewAccountClient(cc grpc.ClientConnInterface) AccountClient

type AccountServer

type AccountServer interface {
	RegisterAccount(context.Context, *RegisterAccountRequest) (*RegisterAccountResponse, error)
	GetPublicKey(context.Context, *GetPublicKeyRequest) (*GetPublicKeyResponse, error)
	// contains filtered or unexported methods
}

AccountServer is the server API for Account service. All implementations must embed UnimplementedAccountServer for forward compatibility

type GetPublicKeyRequest

type GetPublicKeyRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPublicKeyRequest) Descriptor deprecated

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

Deprecated: Use GetPublicKeyRequest.ProtoReflect.Descriptor instead.

func (*GetPublicKeyRequest) GetAddress

func (x *GetPublicKeyRequest) GetAddress() string

func (*GetPublicKeyRequest) ProtoMessage

func (*GetPublicKeyRequest) ProtoMessage()

func (*GetPublicKeyRequest) ProtoReflect

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

func (*GetPublicKeyRequest) Reset

func (x *GetPublicKeyRequest) Reset()

func (*GetPublicKeyRequest) String

func (x *GetPublicKeyRequest) String() string

type GetPublicKeyResponse

type GetPublicKeyResponse struct {
	Pubkey string `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPublicKeyResponse) Descriptor deprecated

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

Deprecated: Use GetPublicKeyResponse.ProtoReflect.Descriptor instead.

func (*GetPublicKeyResponse) GetPubkey

func (x *GetPublicKeyResponse) GetPubkey() string

func (*GetPublicKeyResponse) ProtoMessage

func (*GetPublicKeyResponse) ProtoMessage()

func (*GetPublicKeyResponse) ProtoReflect

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

func (*GetPublicKeyResponse) Reset

func (x *GetPublicKeyResponse) Reset()

func (*GetPublicKeyResponse) String

func (x *GetPublicKeyResponse) String() string

type RegisterAccountRequest

type RegisterAccountRequest struct {
	Pubkey string `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterAccountRequest) Descriptor deprecated

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

Deprecated: Use RegisterAccountRequest.ProtoReflect.Descriptor instead.

func (*RegisterAccountRequest) GetPubkey

func (x *RegisterAccountRequest) GetPubkey() string

func (*RegisterAccountRequest) ProtoMessage

func (*RegisterAccountRequest) ProtoMessage()

func (*RegisterAccountRequest) ProtoReflect

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

func (*RegisterAccountRequest) Reset

func (x *RegisterAccountRequest) Reset()

func (*RegisterAccountRequest) String

func (x *RegisterAccountRequest) String() string

type RegisterAccountResponse

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

func (*RegisterAccountResponse) Descriptor deprecated

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

Deprecated: Use RegisterAccountResponse.ProtoReflect.Descriptor instead.

func (*RegisterAccountResponse) ProtoMessage

func (*RegisterAccountResponse) ProtoMessage()

func (*RegisterAccountResponse) ProtoReflect

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

func (*RegisterAccountResponse) Reset

func (x *RegisterAccountResponse) Reset()

func (*RegisterAccountResponse) String

func (x *RegisterAccountResponse) String() string

type UnimplementedAccountServer

type UnimplementedAccountServer struct {
}

UnimplementedAccountServer must be embedded to have forward compatible implementations.

func (UnimplementedAccountServer) GetPublicKey

func (UnimplementedAccountServer) RegisterAccount

type UnsafeAccountServer

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

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

Jump to

Keyboard shortcuts

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