hashmailrpc

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 15 Imported by: 4

Documentation

Overview

Package hashmailrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_hashmail_lnd_proto protoreflect.FileDescriptor
View Source
var HashMail_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hashmailrpc.HashMail",
	HandlerType: (*HashMailServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NewCipherBox",
			Handler:    _HashMail_NewCipherBox_Handler,
		},
		{
			MethodName: "DelCipherBox",
			Handler:    _HashMail_DelCipherBox_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SendStream",
			Handler:       _HashMail_SendStream_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "RecvStream",
			Handler:       _HashMail_RecvStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "hashmail-lnd.proto",
}

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

Functions

func RegisterHashMailHandler

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

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

func RegisterHashMailHandlerClient

func RegisterHashMailHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HashMailClient) error

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

func RegisterHashMailHandlerFromEndpoint

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

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

func RegisterHashMailHandlerServer

func RegisterHashMailHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HashMailServer) error

RegisterHashMailHandlerServer registers the http handlers for service HashMail to "mux". UnaryRPC :call HashMailServer 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 RegisterHashMailHandlerFromEndpoint instead.

func RegisterHashMailServer

func RegisterHashMailServer(s grpc.ServiceRegistrar, srv HashMailServer)

Types

type CipherBox

type CipherBox struct {
	Desc *CipherBoxDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"`
	Msg  []byte         `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*CipherBox) Descriptor deprecated

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

Deprecated: Use CipherBox.ProtoReflect.Descriptor instead.

func (*CipherBox) GetDesc

func (x *CipherBox) GetDesc() *CipherBoxDesc

func (*CipherBox) GetMsg

func (x *CipherBox) GetMsg() []byte

func (*CipherBox) ProtoMessage

func (*CipherBox) ProtoMessage()

func (*CipherBox) ProtoReflect

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

func (*CipherBox) Reset

func (x *CipherBox) Reset()

func (*CipherBox) String

func (x *CipherBox) String() string

type CipherBoxAuth

type CipherBoxAuth struct {

	// A description of the stream one is attempting to initialize.
	Desc *CipherBoxDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"`
	// Types that are assignable to Auth:
	//	*CipherBoxAuth_LndAuth
	Auth isCipherBoxAuth_Auth `protobuf_oneof:"auth"`
	// contains filtered or unexported fields
}

func (*CipherBoxAuth) Descriptor deprecated

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

Deprecated: Use CipherBoxAuth.ProtoReflect.Descriptor instead.

func (*CipherBoxAuth) GetAuth

func (m *CipherBoxAuth) GetAuth() isCipherBoxAuth_Auth

func (*CipherBoxAuth) GetDesc

func (x *CipherBoxAuth) GetDesc() *CipherBoxDesc

func (*CipherBoxAuth) GetLndAuth

func (x *CipherBoxAuth) GetLndAuth() *LndAuth

func (*CipherBoxAuth) ProtoMessage

func (*CipherBoxAuth) ProtoMessage()

func (*CipherBoxAuth) ProtoReflect

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

func (*CipherBoxAuth) Reset

func (x *CipherBoxAuth) Reset()

func (*CipherBoxAuth) String

func (x *CipherBoxAuth) String() string

type CipherBoxAuth_LndAuth

type CipherBoxAuth_LndAuth struct {
	LndAuth *LndAuth `protobuf:"bytes,2,opt,name=lnd_auth,json=lndAuth,proto3,oneof"`
}

type CipherBoxDesc

type CipherBoxDesc struct {
	StreamId []byte `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CipherBoxDesc) Descriptor deprecated

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

Deprecated: Use CipherBoxDesc.ProtoReflect.Descriptor instead.

func (*CipherBoxDesc) GetStreamId

func (x *CipherBoxDesc) GetStreamId() []byte

func (*CipherBoxDesc) ProtoMessage

func (*CipherBoxDesc) ProtoMessage()

func (*CipherBoxDesc) ProtoReflect

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

func (*CipherBoxDesc) Reset

func (x *CipherBoxDesc) Reset()

func (*CipherBoxDesc) String

func (x *CipherBoxDesc) String() string

type CipherChallenge

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

func (*CipherChallenge) Descriptor deprecated

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

Deprecated: Use CipherChallenge.ProtoReflect.Descriptor instead.

func (*CipherChallenge) ProtoMessage

func (*CipherChallenge) ProtoMessage()

func (*CipherChallenge) ProtoReflect

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

func (*CipherChallenge) Reset

func (x *CipherChallenge) Reset()

func (*CipherChallenge) String

func (x *CipherChallenge) String() string

type CipherError

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

func (*CipherError) Descriptor deprecated

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

Deprecated: Use CipherError.ProtoReflect.Descriptor instead.

func (*CipherError) ProtoMessage

func (*CipherError) ProtoMessage()

func (*CipherError) ProtoReflect

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

func (*CipherError) Reset

func (x *CipherError) Reset()

func (*CipherError) String

func (x *CipherError) String() string

type CipherInitResp

type CipherInitResp struct {

	// Types that are assignable to Resp:
	//	*CipherInitResp_Success
	//	*CipherInitResp_Challenge
	//	*CipherInitResp_Error
	Resp isCipherInitResp_Resp `protobuf_oneof:"resp"`
	// contains filtered or unexported fields
}

func (*CipherInitResp) Descriptor deprecated

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

Deprecated: Use CipherInitResp.ProtoReflect.Descriptor instead.

func (*CipherInitResp) GetChallenge

func (x *CipherInitResp) GetChallenge() *CipherChallenge

func (*CipherInitResp) GetError

func (x *CipherInitResp) GetError() *CipherError

func (*CipherInitResp) GetResp

func (m *CipherInitResp) GetResp() isCipherInitResp_Resp

func (*CipherInitResp) GetSuccess

func (x *CipherInitResp) GetSuccess() *CipherSuccess

func (*CipherInitResp) ProtoMessage

func (*CipherInitResp) ProtoMessage()

func (*CipherInitResp) ProtoReflect

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

func (*CipherInitResp) Reset

func (x *CipherInitResp) Reset()

func (*CipherInitResp) String

func (x *CipherInitResp) String() string

type CipherInitResp_Challenge

type CipherInitResp_Challenge struct {
	//
	//CipherChallenge is returned if the authentication mechanism was revoked
	//or needs to be refreshed.
	Challenge *CipherChallenge `protobuf:"bytes,2,opt,name=challenge,proto3,oneof"`
}

type CipherInitResp_Error

type CipherInitResp_Error struct {
	//
	//CipherError is returned if the authentication mechanism failed to
	//validate.
	Error *CipherError `protobuf:"bytes,3,opt,name=error,proto3,oneof"`
}

type CipherInitResp_Success

type CipherInitResp_Success struct {
	//
	//CipherSuccess is returned if the initialization of the cipher box was
	//successful.
	Success *CipherSuccess `protobuf:"bytes,1,opt,name=success,proto3,oneof"`
}

type CipherSuccess

type CipherSuccess struct {
	Desc *CipherBoxDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"`
	// contains filtered or unexported fields
}

func (*CipherSuccess) Descriptor deprecated

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

Deprecated: Use CipherSuccess.ProtoReflect.Descriptor instead.

func (*CipherSuccess) GetDesc

func (x *CipherSuccess) GetDesc() *CipherBoxDesc

func (*CipherSuccess) ProtoMessage

func (*CipherSuccess) ProtoMessage()

func (*CipherSuccess) ProtoReflect

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

func (*CipherSuccess) Reset

func (x *CipherSuccess) Reset()

func (*CipherSuccess) String

func (x *CipherSuccess) String() string

type DelCipherBoxResp

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

func (*DelCipherBoxResp) Descriptor deprecated

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

Deprecated: Use DelCipherBoxResp.ProtoReflect.Descriptor instead.

func (*DelCipherBoxResp) ProtoMessage

func (*DelCipherBoxResp) ProtoMessage()

func (*DelCipherBoxResp) ProtoReflect

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

func (*DelCipherBoxResp) Reset

func (x *DelCipherBoxResp) Reset()

func (*DelCipherBoxResp) String

func (x *DelCipherBoxResp) String() string

type HashMailClient

type HashMailClient interface {
	//
	//NewCipherBox creates a new cipher box pipe/stream given a valid
	//authentication mechanism. If the authentication mechanism has been revoked,
	//or needs to be changed, then a CipherChallenge message is returned.
	//Otherwise the method will either be accepted or rejected.
	NewCipherBox(ctx context.Context, in *CipherBoxAuth, opts ...grpc.CallOption) (*CipherInitResp, error)
	//
	//DelCipherBox attempts to tear down an existing cipher box pipe. The same
	//authentication mechanism used to initially create the stream MUST be
	//specified.
	DelCipherBox(ctx context.Context, in *CipherBoxAuth, opts ...grpc.CallOption) (*DelCipherBoxResp, error)
	//
	//SendStream opens up the write side of the passed CipherBox pipe. Writes
	//will be non-blocking up to the buffer size of the pipe. Beyond that writes
	//will block until completed.
	SendStream(ctx context.Context, opts ...grpc.CallOption) (HashMail_SendStreamClient, error)
	//
	//RecvStream opens up the read side of the passed CipherBox pipe. This method
	//will block until a full message has been read as this is a message based
	//pipe/stream abstraction.
	RecvStream(ctx context.Context, in *CipherBoxDesc, opts ...grpc.CallOption) (HashMail_RecvStreamClient, error)
}

HashMailClient is the client API for HashMail 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 NewHashMailClient

func NewHashMailClient(cc grpc.ClientConnInterface) HashMailClient

type HashMailServer

type HashMailServer interface {
	//
	//NewCipherBox creates a new cipher box pipe/stream given a valid
	//authentication mechanism. If the authentication mechanism has been revoked,
	//or needs to be changed, then a CipherChallenge message is returned.
	//Otherwise the method will either be accepted or rejected.
	NewCipherBox(context.Context, *CipherBoxAuth) (*CipherInitResp, error)
	//
	//DelCipherBox attempts to tear down an existing cipher box pipe. The same
	//authentication mechanism used to initially create the stream MUST be
	//specified.
	DelCipherBox(context.Context, *CipherBoxAuth) (*DelCipherBoxResp, error)
	//
	//SendStream opens up the write side of the passed CipherBox pipe. Writes
	//will be non-blocking up to the buffer size of the pipe. Beyond that writes
	//will block until completed.
	SendStream(HashMail_SendStreamServer) error
	//
	//RecvStream opens up the read side of the passed CipherBox pipe. This method
	//will block until a full message has been read as this is a message based
	//pipe/stream abstraction.
	RecvStream(*CipherBoxDesc, HashMail_RecvStreamServer) error
	// contains filtered or unexported methods
}

HashMailServer is the server API for HashMail service. All implementations must embed UnimplementedHashMailServer for forward compatibility

type HashMail_RecvStreamClient

type HashMail_RecvStreamClient interface {
	Recv() (*CipherBox, error)
	grpc.ClientStream
}

type HashMail_RecvStreamServer

type HashMail_RecvStreamServer interface {
	Send(*CipherBox) error
	grpc.ServerStream
}

type HashMail_SendStreamClient

type HashMail_SendStreamClient interface {
	Send(*CipherBox) error
	CloseAndRecv() (*CipherBoxDesc, error)
	grpc.ClientStream
}

type HashMail_SendStreamServer

type HashMail_SendStreamServer interface {
	SendAndClose(*CipherBoxDesc) error
	Recv() (*CipherBox, error)
	grpc.ServerStream
}

type LndAuth

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

func (*LndAuth) Descriptor deprecated

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

Deprecated: Use LndAuth.ProtoReflect.Descriptor instead.

func (*LndAuth) ProtoMessage

func (*LndAuth) ProtoMessage()

func (*LndAuth) ProtoReflect

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

func (*LndAuth) Reset

func (x *LndAuth) Reset()

func (*LndAuth) String

func (x *LndAuth) String() string

type UnimplementedHashMailServer

type UnimplementedHashMailServer struct {
}

UnimplementedHashMailServer must be embedded to have forward compatible implementations.

func (UnimplementedHashMailServer) DelCipherBox

func (UnimplementedHashMailServer) NewCipherBox

func (UnimplementedHashMailServer) RecvStream

func (UnimplementedHashMailServer) SendStream

type UnsafeHashMailServer

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

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

Jump to

Keyboard shortcuts

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