remotestore

package
v0.0.0-...-a769ce7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: MIT Imports: 18 Imported by: 0

Documentation ¶

Index ¶

Constants ¶

This section is empty.

Variables ¶

View Source
var JWT_SECRET = []byte("jwt secret string") // @@TODO: make configurable

Functions ¶

func NewClient ¶

func NewClient(host string, address types.Address, sigprivkey rw.SigningPrivateKey) rw.Store

func NewServer ¶

func NewServer(listenNetwork, listenHost, dbPath string, allowedAddresses []types.Address) *server

func RegisterRemoteStoreServer ¶

func RegisterRemoteStoreServer(s *grpc.Server, srv RemoteStoreServer)

func StreamClientJWT ¶

func StreamClientJWT(redwoodClient *client) grpc.DialOption

func StreamServerLogger ¶

func StreamServerLogger(log ctxpkg.Logger) grpc.ServerOption

func UnaryClientJWT ¶

func UnaryClientJWT(redwoodClient *client) grpc.DialOption

func UnaryServerLogger ¶

func UnaryServerLogger(log ctxpkg.Logger) grpc.ServerOption

Types ¶

type AddTxRequest ¶

type AddTxRequest struct {
	TxHash               []byte   `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"`
	TxBytes              []byte   `protobuf:"bytes,2,opt,name=txBytes,proto3" json:"txBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddTxRequest) Descriptor ¶

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

func (*AddTxRequest) GetTxBytes ¶

func (m *AddTxRequest) GetTxBytes() []byte

func (*AddTxRequest) GetTxHash ¶

func (m *AddTxRequest) GetTxHash() []byte

func (*AddTxRequest) ProtoMessage ¶

func (*AddTxRequest) ProtoMessage()

func (*AddTxRequest) Reset ¶

func (m *AddTxRequest) Reset()

func (*AddTxRequest) String ¶

func (m *AddTxRequest) String() string

func (*AddTxRequest) XXX_DiscardUnknown ¶

func (m *AddTxRequest) XXX_DiscardUnknown()

func (*AddTxRequest) XXX_Marshal ¶

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

func (*AddTxRequest) XXX_Merge ¶

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

func (*AddTxRequest) XXX_Size ¶

func (m *AddTxRequest) XXX_Size() int

func (*AddTxRequest) XXX_Unmarshal ¶

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

type AddTxResponse ¶

type AddTxResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddTxResponse) Descriptor ¶

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

func (*AddTxResponse) ProtoMessage ¶

func (*AddTxResponse) ProtoMessage()

func (*AddTxResponse) Reset ¶

func (m *AddTxResponse) Reset()

func (*AddTxResponse) String ¶

func (m *AddTxResponse) String() string

func (*AddTxResponse) XXX_DiscardUnknown ¶

func (m *AddTxResponse) XXX_DiscardUnknown()

func (*AddTxResponse) XXX_Marshal ¶

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

func (*AddTxResponse) XXX_Merge ¶

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

func (*AddTxResponse) XXX_Size ¶

func (m *AddTxResponse) XXX_Size() int

func (*AddTxResponse) XXX_Unmarshal ¶

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

type AllTxsRequest ¶

type AllTxsRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AllTxsRequest) Descriptor ¶

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

func (*AllTxsRequest) ProtoMessage ¶

func (*AllTxsRequest) ProtoMessage()

func (*AllTxsRequest) Reset ¶

func (m *AllTxsRequest) Reset()

func (*AllTxsRequest) String ¶

func (m *AllTxsRequest) String() string

func (*AllTxsRequest) XXX_DiscardUnknown ¶

func (m *AllTxsRequest) XXX_DiscardUnknown()

func (*AllTxsRequest) XXX_Marshal ¶

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

func (*AllTxsRequest) XXX_Merge ¶

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

func (*AllTxsRequest) XXX_Size ¶

func (m *AllTxsRequest) XXX_Size() int

func (*AllTxsRequest) XXX_Unmarshal ¶

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

type AllTxsResponsePacket ¶

type AllTxsResponsePacket struct {
	TxBytes              []byte   `protobuf:"bytes,1,opt,name=txBytes,proto3" json:"txBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AllTxsResponsePacket) Descriptor ¶

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

func (*AllTxsResponsePacket) GetTxBytes ¶

func (m *AllTxsResponsePacket) GetTxBytes() []byte

func (*AllTxsResponsePacket) ProtoMessage ¶

func (*AllTxsResponsePacket) ProtoMessage()

func (*AllTxsResponsePacket) Reset ¶

func (m *AllTxsResponsePacket) Reset()

func (*AllTxsResponsePacket) String ¶

func (m *AllTxsResponsePacket) String() string

func (*AllTxsResponsePacket) XXX_DiscardUnknown ¶

func (m *AllTxsResponsePacket) XXX_DiscardUnknown()

func (*AllTxsResponsePacket) XXX_Marshal ¶

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

func (*AllTxsResponsePacket) XXX_Merge ¶

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

func (*AllTxsResponsePacket) XXX_Size ¶

func (m *AllTxsResponsePacket) XXX_Size() int

func (*AllTxsResponsePacket) XXX_Unmarshal ¶

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

type AuthenticateMessage ¶

type AuthenticateMessage struct {
	// Types that are valid to be assigned to Payload:
	//	*AuthenticateMessage_AuthenticateChallenge_
	//	*AuthenticateMessage_AuthenticateSignature_
	//	*AuthenticateMessage_AuthenticateResponse_
	Payload              isAuthenticateMessage_Payload `protobuf_oneof:"payload"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

func (*AuthenticateMessage) Descriptor ¶

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

func (*AuthenticateMessage) GetAuthenticateChallenge ¶

func (m *AuthenticateMessage) GetAuthenticateChallenge() *AuthenticateMessage_AuthenticateChallenge

func (*AuthenticateMessage) GetAuthenticateResponse ¶

func (m *AuthenticateMessage) GetAuthenticateResponse() *AuthenticateMessage_AuthenticateResponse

func (*AuthenticateMessage) GetAuthenticateSignature ¶

func (m *AuthenticateMessage) GetAuthenticateSignature() *AuthenticateMessage_AuthenticateSignature

func (*AuthenticateMessage) GetPayload ¶

func (m *AuthenticateMessage) GetPayload() isAuthenticateMessage_Payload

func (*AuthenticateMessage) ProtoMessage ¶

func (*AuthenticateMessage) ProtoMessage()

func (*AuthenticateMessage) Reset ¶

func (m *AuthenticateMessage) Reset()

func (*AuthenticateMessage) String ¶

func (m *AuthenticateMessage) String() string

func (*AuthenticateMessage) XXX_DiscardUnknown ¶

func (m *AuthenticateMessage) XXX_DiscardUnknown()

func (*AuthenticateMessage) XXX_Marshal ¶

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

func (*AuthenticateMessage) XXX_Merge ¶

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

func (*AuthenticateMessage) XXX_OneofWrappers ¶

func (*AuthenticateMessage) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*AuthenticateMessage) XXX_Size ¶

func (m *AuthenticateMessage) XXX_Size() int

func (*AuthenticateMessage) XXX_Unmarshal ¶

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

type AuthenticateMessage_AuthenticateChallenge ¶

type AuthenticateMessage_AuthenticateChallenge struct {
	Challenge            []byte   `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthenticateMessage_AuthenticateChallenge) Descriptor ¶

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

func (*AuthenticateMessage_AuthenticateChallenge) GetChallenge ¶

func (m *AuthenticateMessage_AuthenticateChallenge) GetChallenge() []byte

func (*AuthenticateMessage_AuthenticateChallenge) ProtoMessage ¶

func (*AuthenticateMessage_AuthenticateChallenge) Reset ¶

func (*AuthenticateMessage_AuthenticateChallenge) String ¶

func (*AuthenticateMessage_AuthenticateChallenge) XXX_DiscardUnknown ¶

func (m *AuthenticateMessage_AuthenticateChallenge) XXX_DiscardUnknown()

func (*AuthenticateMessage_AuthenticateChallenge) XXX_Marshal ¶

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

func (*AuthenticateMessage_AuthenticateChallenge) XXX_Merge ¶

func (*AuthenticateMessage_AuthenticateChallenge) XXX_Size ¶

func (*AuthenticateMessage_AuthenticateChallenge) XXX_Unmarshal ¶

type AuthenticateMessage_AuthenticateChallenge_ ¶

type AuthenticateMessage_AuthenticateChallenge_ struct {
	AuthenticateChallenge *AuthenticateMessage_AuthenticateChallenge `protobuf:"bytes,1,opt,name=authenticateChallenge,proto3,oneof"`
}

type AuthenticateMessage_AuthenticateResponse ¶

type AuthenticateMessage_AuthenticateResponse struct {
	Jwt                  string   `protobuf:"bytes,1,opt,name=jwt,proto3" json:"jwt,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthenticateMessage_AuthenticateResponse) Descriptor ¶

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

func (*AuthenticateMessage_AuthenticateResponse) GetJwt ¶

func (*AuthenticateMessage_AuthenticateResponse) ProtoMessage ¶

func (*AuthenticateMessage_AuthenticateResponse) Reset ¶

func (*AuthenticateMessage_AuthenticateResponse) String ¶

func (*AuthenticateMessage_AuthenticateResponse) XXX_DiscardUnknown ¶

func (m *AuthenticateMessage_AuthenticateResponse) XXX_DiscardUnknown()

func (*AuthenticateMessage_AuthenticateResponse) XXX_Marshal ¶

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

func (*AuthenticateMessage_AuthenticateResponse) XXX_Merge ¶

func (*AuthenticateMessage_AuthenticateResponse) XXX_Size ¶

func (*AuthenticateMessage_AuthenticateResponse) XXX_Unmarshal ¶

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

type AuthenticateMessage_AuthenticateResponse_ ¶

type AuthenticateMessage_AuthenticateResponse_ struct {
	AuthenticateResponse *AuthenticateMessage_AuthenticateResponse `protobuf:"bytes,3,opt,name=authenticateResponse,proto3,oneof"`
}

type AuthenticateMessage_AuthenticateSignature ¶

type AuthenticateMessage_AuthenticateSignature struct {
	Signature            []byte   `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthenticateMessage_AuthenticateSignature) Descriptor ¶

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

func (*AuthenticateMessage_AuthenticateSignature) GetSignature ¶

func (m *AuthenticateMessage_AuthenticateSignature) GetSignature() []byte

func (*AuthenticateMessage_AuthenticateSignature) ProtoMessage ¶

func (*AuthenticateMessage_AuthenticateSignature) Reset ¶

func (*AuthenticateMessage_AuthenticateSignature) String ¶

func (*AuthenticateMessage_AuthenticateSignature) XXX_DiscardUnknown ¶

func (m *AuthenticateMessage_AuthenticateSignature) XXX_DiscardUnknown()

func (*AuthenticateMessage_AuthenticateSignature) XXX_Marshal ¶

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

func (*AuthenticateMessage_AuthenticateSignature) XXX_Merge ¶

func (*AuthenticateMessage_AuthenticateSignature) XXX_Size ¶

func (*AuthenticateMessage_AuthenticateSignature) XXX_Unmarshal ¶

type AuthenticateMessage_AuthenticateSignature_ ¶

type AuthenticateMessage_AuthenticateSignature_ struct {
	AuthenticateSignature *AuthenticateMessage_AuthenticateSignature `protobuf:"bytes,2,opt,name=authenticateSignature,proto3,oneof"`
}

type FetchTxRequest ¶

type FetchTxRequest struct {
	TxHash               []byte   `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FetchTxRequest) Descriptor ¶

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

func (*FetchTxRequest) GetTxHash ¶

func (m *FetchTxRequest) GetTxHash() []byte

func (*FetchTxRequest) ProtoMessage ¶

func (*FetchTxRequest) ProtoMessage()

func (*FetchTxRequest) Reset ¶

func (m *FetchTxRequest) Reset()

func (*FetchTxRequest) String ¶

func (m *FetchTxRequest) String() string

func (*FetchTxRequest) XXX_DiscardUnknown ¶

func (m *FetchTxRequest) XXX_DiscardUnknown()

func (*FetchTxRequest) XXX_Marshal ¶

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

func (*FetchTxRequest) XXX_Merge ¶

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

func (*FetchTxRequest) XXX_Size ¶

func (m *FetchTxRequest) XXX_Size() int

func (*FetchTxRequest) XXX_Unmarshal ¶

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

type FetchTxResponse ¶

type FetchTxResponse struct {
	TxBytes              []byte   `protobuf:"bytes,1,opt,name=txBytes,proto3" json:"txBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FetchTxResponse) Descriptor ¶

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

func (*FetchTxResponse) GetTxBytes ¶

func (m *FetchTxResponse) GetTxBytes() []byte

func (*FetchTxResponse) ProtoMessage ¶

func (*FetchTxResponse) ProtoMessage()

func (*FetchTxResponse) Reset ¶

func (m *FetchTxResponse) Reset()

func (*FetchTxResponse) String ¶

func (m *FetchTxResponse) String() string

func (*FetchTxResponse) XXX_DiscardUnknown ¶

func (m *FetchTxResponse) XXX_DiscardUnknown()

func (*FetchTxResponse) XXX_Marshal ¶

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

func (*FetchTxResponse) XXX_Merge ¶

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

func (*FetchTxResponse) XXX_Size ¶

func (m *FetchTxResponse) XXX_Size() int

func (*FetchTxResponse) XXX_Unmarshal ¶

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

type RemoteStoreClient ¶

type RemoteStoreClient interface {
	Authenticate(ctx context.Context, opts ...grpc.CallOption) (RemoteStore_AuthenticateClient, error)
	AddTx(ctx context.Context, in *AddTxRequest, opts ...grpc.CallOption) (*AddTxResponse, error)
	RemoveTx(ctx context.Context, in *RemoveTxRequest, opts ...grpc.CallOption) (*RemoveTxResponse, error)
	FetchTx(ctx context.Context, in *FetchTxRequest, opts ...grpc.CallOption) (*FetchTxResponse, error)
	AllTxs(ctx context.Context, in *AllTxsRequest, opts ...grpc.CallOption) (RemoteStore_AllTxsClient, error)
}

RemoteStoreClient is the client API for RemoteStore service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRemoteStoreClient ¶

func NewRemoteStoreClient(cc *grpc.ClientConn) RemoteStoreClient

type RemoteStoreServer ¶

RemoteStoreServer is the server API for RemoteStore service.

type RemoteStore_AllTxsClient ¶

type RemoteStore_AllTxsClient interface {
	Recv() (*AllTxsResponsePacket, error)
	grpc.ClientStream
}

type RemoteStore_AllTxsServer ¶

type RemoteStore_AllTxsServer interface {
	Send(*AllTxsResponsePacket) error
	grpc.ServerStream
}

type RemoteStore_AuthenticateClient ¶

type RemoteStore_AuthenticateClient interface {
	Send(*AuthenticateMessage) error
	Recv() (*AuthenticateMessage, error)
	grpc.ClientStream
}

type RemoteStore_AuthenticateServer ¶

type RemoteStore_AuthenticateServer interface {
	Send(*AuthenticateMessage) error
	Recv() (*AuthenticateMessage, error)
	grpc.ServerStream
}

type RemoveTxRequest ¶

type RemoveTxRequest struct {
	TxHash               []byte   `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RemoveTxRequest) Descriptor ¶

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

func (*RemoveTxRequest) GetTxHash ¶

func (m *RemoveTxRequest) GetTxHash() []byte

func (*RemoveTxRequest) ProtoMessage ¶

func (*RemoveTxRequest) ProtoMessage()

func (*RemoveTxRequest) Reset ¶

func (m *RemoveTxRequest) Reset()

func (*RemoveTxRequest) String ¶

func (m *RemoveTxRequest) String() string

func (*RemoveTxRequest) XXX_DiscardUnknown ¶

func (m *RemoveTxRequest) XXX_DiscardUnknown()

func (*RemoveTxRequest) XXX_Marshal ¶

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

func (*RemoveTxRequest) XXX_Merge ¶

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

func (*RemoveTxRequest) XXX_Size ¶

func (m *RemoveTxRequest) XXX_Size() int

func (*RemoveTxRequest) XXX_Unmarshal ¶

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

type RemoveTxResponse ¶

type RemoveTxResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RemoveTxResponse) Descriptor ¶

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

func (*RemoveTxResponse) ProtoMessage ¶

func (*RemoveTxResponse) ProtoMessage()

func (*RemoveTxResponse) Reset ¶

func (m *RemoveTxResponse) Reset()

func (*RemoveTxResponse) String ¶

func (m *RemoveTxResponse) String() string

func (*RemoveTxResponse) XXX_DiscardUnknown ¶

func (m *RemoveTxResponse) XXX_DiscardUnknown()

func (*RemoveTxResponse) XXX_Marshal ¶

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

func (*RemoveTxResponse) XXX_Merge ¶

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

func (*RemoveTxResponse) XXX_Size ¶

func (m *RemoveTxResponse) XXX_Size() int

func (*RemoveTxResponse) XXX_Unmarshal ¶

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

type UnimplementedRemoteStoreServer ¶

type UnimplementedRemoteStoreServer struct {
}

UnimplementedRemoteStoreServer can be embedded to have forward compatible implementations.

func (*UnimplementedRemoteStoreServer) AddTx ¶

func (*UnimplementedRemoteStoreServer) AllTxs ¶

func (*UnimplementedRemoteStoreServer) Authenticate ¶

func (*UnimplementedRemoteStoreServer) FetchTx ¶

func (*UnimplementedRemoteStoreServer) RemoveTx ¶

Directories ¶

Path Synopsis

Jump to

Keyboard shortcuts

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