Documentation ¶
Index ¶
- Variables
- func RegisterStorageServer(s *grpc.Server, srv StorageServer)
- type Ack
- func (*Ack) Descriptor() ([]byte, []int)
- func (m *Ack) Marshal() (dAtA []byte, err error)
- func (m *Ack) MarshalTo(dAtA []byte) (int, error)
- func (*Ack) ProtoMessage()
- func (m *Ack) Reset()
- func (m *Ack) Size() (n int)
- func (m *Ack) String() string
- func (m *Ack) Unmarshal(dAtA []byte) error
- func (m *Ack) XXX_DiscardUnknown()
- func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Ack) XXX_Merge(src proto.Message)
- func (m *Ack) XXX_Size() int
- func (m *Ack) XXX_Unmarshal(b []byte) error
- type AuthRequest
- func (*AuthRequest) Descriptor() ([]byte, []int)
- func (m *AuthRequest) GetFileHash() []byte
- func (m *AuthRequest) GetPeerIds() [][]byte
- func (m *AuthRequest) Marshal() (dAtA []byte, err error)
- func (m *AuthRequest) MarshalTo(dAtA []byte) (int, error)
- func (*AuthRequest) ProtoMessage()
- func (m *AuthRequest) Reset()
- func (m *AuthRequest) Size() (n int)
- func (m *AuthRequest) String() string
- func (m *AuthRequest) Unmarshal(dAtA []byte) error
- func (m *AuthRequest) XXX_DiscardUnknown()
- func (m *AuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *AuthRequest) XXX_Merge(src proto.Message)
- func (m *AuthRequest) XXX_Size() int
- func (m *AuthRequest) XXX_Unmarshal(b []byte) error
- type DownloadRequest
- func (*DownloadRequest) Descriptor() ([]byte, []int)
- func (m *DownloadRequest) GetFileHash() []byte
- func (m *DownloadRequest) GetPeerId() []byte
- func (m *DownloadRequest) Marshal() (dAtA []byte, err error)
- func (m *DownloadRequest) MarshalTo(dAtA []byte) (int, error)
- func (*DownloadRequest) ProtoMessage()
- func (m *DownloadRequest) Reset()
- func (m *DownloadRequest) Size() (n int)
- func (m *DownloadRequest) String() string
- func (m *DownloadRequest) Unmarshal(dAtA []byte) error
- func (m *DownloadRequest) XXX_DiscardUnknown()
- func (m *DownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DownloadRequest) XXX_Merge(src proto.Message)
- func (m *DownloadRequest) XXX_Size() int
- func (m *DownloadRequest) XXX_Unmarshal(b []byte) error
- type SessionFileChunk
- func (*SessionFileChunk) Descriptor() ([]byte, []int)
- func (m *SessionFileChunk) GetData() []byte
- func (m *SessionFileChunk) GetId() []byte
- func (m *SessionFileChunk) Marshal() (dAtA []byte, err error)
- func (m *SessionFileChunk) MarshalTo(dAtA []byte) (int, error)
- func (*SessionFileChunk) ProtoMessage()
- func (m *SessionFileChunk) Reset()
- func (m *SessionFileChunk) Size() (n int)
- func (m *SessionFileChunk) String() string
- func (m *SessionFileChunk) Unmarshal(dAtA []byte) error
- func (m *SessionFileChunk) XXX_DiscardUnknown()
- func (m *SessionFileChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SessionFileChunk) XXX_Merge(src proto.Message)
- func (m *SessionFileChunk) XXX_Size() int
- func (m *SessionFileChunk) XXX_Unmarshal(b []byte) error
- type StorageClient
- type StorageServer
- type Storage_DownloadClient
- type Storage_DownloadServer
- type Storage_UploadClient
- type Storage_UploadServer
- type UploadAck
- func (*UploadAck) Descriptor() ([]byte, []int)
- func (m *UploadAck) GetFileHash() []byte
- func (m *UploadAck) Marshal() (dAtA []byte, err error)
- func (m *UploadAck) MarshalTo(dAtA []byte) (int, error)
- func (*UploadAck) ProtoMessage()
- func (m *UploadAck) Reset()
- func (m *UploadAck) Size() (n int)
- func (m *UploadAck) String() string
- func (m *UploadAck) Unmarshal(dAtA []byte) error
- func (m *UploadAck) XXX_DiscardUnknown()
- func (m *UploadAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *UploadAck) XXX_Merge(src proto.Message)
- func (m *UploadAck) XXX_Size() int
- func (m *UploadAck) XXX_Unmarshal(b []byte) error
- type UploadReq
- func (*UploadReq) Descriptor() ([]byte, []int)
- func (m *UploadReq) GetFileName() string
- func (m *UploadReq) Marshal() (dAtA []byte, err error)
- func (m *UploadReq) MarshalTo(dAtA []byte) (int, error)
- func (*UploadReq) ProtoMessage()
- func (m *UploadReq) Reset()
- func (m *UploadReq) Size() (n int)
- func (m *UploadReq) String() string
- func (m *UploadReq) Unmarshal(dAtA []byte) error
- func (m *UploadReq) XXX_DiscardUnknown()
- func (m *UploadReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *UploadReq) XXX_Merge(src proto.Message)
- func (m *UploadReq) XXX_Size() int
- func (m *UploadReq) XXX_Unmarshal(b []byte) error
- type UploadSession
- func (*UploadSession) Descriptor() ([]byte, []int)
- func (m *UploadSession) GetId() []byte
- func (m *UploadSession) Marshal() (dAtA []byte, err error)
- func (m *UploadSession) MarshalTo(dAtA []byte) (int, error)
- func (*UploadSession) ProtoMessage()
- func (m *UploadSession) Reset()
- func (m *UploadSession) Size() (n int)
- func (m *UploadSession) String() string
- func (m *UploadSession) Unmarshal(dAtA []byte) error
- func (m *UploadSession) XXX_DiscardUnknown()
- func (m *UploadSession) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *UploadSession) XXX_Merge(src proto.Message)
- func (m *UploadSession) XXX_Size() int
- func (m *UploadSession) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthStorage = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStorage = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterStorageServer ¶
func RegisterStorageServer(s *grpc.Server, srv StorageServer)
Types ¶
type Ack ¶
type Ack struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
An empty ack.
func (*Ack) Descriptor ¶
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Ack) XXX_DiscardUnknown()
func (*Ack) XXX_Marshal ¶ added in v0.2.0
func (*Ack) XXX_Unmarshal ¶ added in v0.2.0
type AuthRequest ¶
type AuthRequest struct { PeerIds [][]byte `protobuf:"bytes,1,rep,name=peer_ids,json=peerIds" json:"peer_ids,omitempty"` FileHash []byte `protobuf:"bytes,2,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AuthRequest) Descriptor ¶
func (*AuthRequest) Descriptor() ([]byte, []int)
func (*AuthRequest) GetFileHash ¶
func (m *AuthRequest) GetFileHash() []byte
func (*AuthRequest) GetPeerIds ¶
func (m *AuthRequest) GetPeerIds() [][]byte
func (*AuthRequest) Marshal ¶
func (m *AuthRequest) Marshal() (dAtA []byte, err error)
func (*AuthRequest) ProtoMessage ¶
func (*AuthRequest) ProtoMessage()
func (*AuthRequest) Reset ¶
func (m *AuthRequest) Reset()
func (*AuthRequest) Size ¶
func (m *AuthRequest) Size() (n int)
func (*AuthRequest) String ¶
func (m *AuthRequest) String() string
func (*AuthRequest) Unmarshal ¶
func (m *AuthRequest) Unmarshal(dAtA []byte) error
func (*AuthRequest) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *AuthRequest) XXX_DiscardUnknown()
func (*AuthRequest) XXX_Marshal ¶ added in v0.2.0
func (m *AuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AuthRequest) XXX_Merge ¶ added in v0.2.0
func (dst *AuthRequest) XXX_Merge(src proto.Message)
func (*AuthRequest) XXX_Size ¶ added in v0.2.0
func (m *AuthRequest) XXX_Size() int
func (*AuthRequest) XXX_Unmarshal ¶ added in v0.2.0
func (m *AuthRequest) XXX_Unmarshal(b []byte) error
type DownloadRequest ¶
type DownloadRequest struct { PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` FileHash []byte `protobuf:"bytes,2,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DownloadRequest) Descriptor ¶
func (*DownloadRequest) Descriptor() ([]byte, []int)
func (*DownloadRequest) GetFileHash ¶
func (m *DownloadRequest) GetFileHash() []byte
func (*DownloadRequest) GetPeerId ¶
func (m *DownloadRequest) GetPeerId() []byte
func (*DownloadRequest) Marshal ¶
func (m *DownloadRequest) Marshal() (dAtA []byte, err error)
func (*DownloadRequest) ProtoMessage ¶
func (*DownloadRequest) ProtoMessage()
func (*DownloadRequest) Reset ¶
func (m *DownloadRequest) Reset()
func (*DownloadRequest) Size ¶
func (m *DownloadRequest) Size() (n int)
func (*DownloadRequest) String ¶
func (m *DownloadRequest) String() string
func (*DownloadRequest) Unmarshal ¶
func (m *DownloadRequest) Unmarshal(dAtA []byte) error
func (*DownloadRequest) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *DownloadRequest) XXX_DiscardUnknown()
func (*DownloadRequest) XXX_Marshal ¶ added in v0.2.0
func (m *DownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DownloadRequest) XXX_Merge ¶ added in v0.2.0
func (dst *DownloadRequest) XXX_Merge(src proto.Message)
func (*DownloadRequest) XXX_Size ¶ added in v0.2.0
func (m *DownloadRequest) XXX_Size() int
func (*DownloadRequest) XXX_Unmarshal ¶ added in v0.2.0
func (m *DownloadRequest) XXX_Unmarshal(b []byte) error
type SessionFileChunk ¶
type SessionFileChunk struct { // file name is required only on first message. Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SessionFileChunk) Descriptor ¶
func (*SessionFileChunk) Descriptor() ([]byte, []int)
func (*SessionFileChunk) GetData ¶
func (m *SessionFileChunk) GetData() []byte
func (*SessionFileChunk) GetId ¶
func (m *SessionFileChunk) GetId() []byte
func (*SessionFileChunk) Marshal ¶
func (m *SessionFileChunk) Marshal() (dAtA []byte, err error)
func (*SessionFileChunk) ProtoMessage ¶
func (*SessionFileChunk) ProtoMessage()
func (*SessionFileChunk) Reset ¶
func (m *SessionFileChunk) Reset()
func (*SessionFileChunk) Size ¶
func (m *SessionFileChunk) Size() (n int)
func (*SessionFileChunk) String ¶
func (m *SessionFileChunk) String() string
func (*SessionFileChunk) Unmarshal ¶
func (m *SessionFileChunk) Unmarshal(dAtA []byte) error
func (*SessionFileChunk) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *SessionFileChunk) XXX_DiscardUnknown()
func (*SessionFileChunk) XXX_Marshal ¶ added in v0.2.0
func (m *SessionFileChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SessionFileChunk) XXX_Merge ¶ added in v0.2.0
func (dst *SessionFileChunk) XXX_Merge(src proto.Message)
func (*SessionFileChunk) XXX_Size ¶ added in v0.2.0
func (m *SessionFileChunk) XXX_Size() int
func (*SessionFileChunk) XXX_Unmarshal ¶ added in v0.2.0
func (m *SessionFileChunk) XXX_Unmarshal(b []byte) error
type StorageClient ¶
type StorageClient interface { // Upload a file to the Stratumn node. Upload(ctx context.Context, opts ...grpc.CallOption) (Storage_UploadClient, error) // Sends a request to the server to start a new upload. StartUpload(ctx context.Context, in *UploadReq, opts ...grpc.CallOption) (*UploadSession, error) // Upload a single chunk of a file to the server. UploadChunk(ctx context.Context, in *SessionFileChunk, opts ...grpc.CallOption) (*Ack, error) // Notifies the server that the session's file has been entirely sent. EndUpload(ctx context.Context, in *UploadSession, opts ...grpc.CallOption) (*UploadAck, error) // Give peers access to a file. AuthorizePeers(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*Ack, error) // Download downloads a file from a peer. Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (Storage_DownloadClient, error) }
func NewStorageClient ¶
func NewStorageClient(cc *grpc.ClientConn) StorageClient
type StorageServer ¶
type StorageServer interface { // Upload a file to the Stratumn node. Upload(Storage_UploadServer) error // Sends a request to the server to start a new upload. StartUpload(context.Context, *UploadReq) (*UploadSession, error) // Upload a single chunk of a file to the server. UploadChunk(context.Context, *SessionFileChunk) (*Ack, error) // Notifies the server that the session's file has been entirely sent. EndUpload(context.Context, *UploadSession) (*UploadAck, error) // Give peers access to a file. AuthorizePeers(context.Context, *AuthRequest) (*Ack, error) // Download downloads a file from a peer. Download(*DownloadRequest, Storage_DownloadServer) error }
type Storage_DownloadClient ¶
type Storage_DownloadClient interface { Recv() (*pb.FileChunk, error) grpc.ClientStream }
type Storage_DownloadServer ¶
type Storage_DownloadServer interface { Send(*pb.FileChunk) error grpc.ServerStream }
type Storage_UploadClient ¶
type Storage_UploadServer ¶
type UploadAck ¶
type UploadAck struct { FileHash []byte `protobuf:"bytes,1,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UploadAck) Descriptor ¶
func (*UploadAck) GetFileHash ¶
func (*UploadAck) ProtoMessage ¶
func (*UploadAck) ProtoMessage()
func (*UploadAck) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *UploadAck) XXX_DiscardUnknown()
func (*UploadAck) XXX_Marshal ¶ added in v0.2.0
func (*UploadAck) XXX_Unmarshal ¶ added in v0.2.0
type UploadReq ¶
type UploadReq struct { FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UploadReq) Descriptor ¶
func (*UploadReq) GetFileName ¶
func (*UploadReq) ProtoMessage ¶
func (*UploadReq) ProtoMessage()
func (*UploadReq) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *UploadReq) XXX_DiscardUnknown()
func (*UploadReq) XXX_Marshal ¶ added in v0.2.0
func (*UploadReq) XXX_Unmarshal ¶ added in v0.2.0
type UploadSession ¶
type UploadSession struct { Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UploadSession) Descriptor ¶
func (*UploadSession) Descriptor() ([]byte, []int)
func (*UploadSession) GetId ¶
func (m *UploadSession) GetId() []byte
func (*UploadSession) Marshal ¶
func (m *UploadSession) Marshal() (dAtA []byte, err error)
func (*UploadSession) ProtoMessage ¶
func (*UploadSession) ProtoMessage()
func (*UploadSession) Reset ¶
func (m *UploadSession) Reset()
func (*UploadSession) Size ¶
func (m *UploadSession) Size() (n int)
func (*UploadSession) String ¶
func (m *UploadSession) String() string
func (*UploadSession) Unmarshal ¶
func (m *UploadSession) Unmarshal(dAtA []byte) error
func (*UploadSession) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *UploadSession) XXX_DiscardUnknown()
func (*UploadSession) XXX_Marshal ¶ added in v0.2.0
func (m *UploadSession) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UploadSession) XXX_Merge ¶ added in v0.2.0
func (dst *UploadSession) XXX_Merge(src proto.Message)
func (*UploadSession) XXX_Size ¶ added in v0.2.0
func (m *UploadSession) XXX_Size() int
func (*UploadSession) XXX_Unmarshal ¶ added in v0.2.0
func (m *UploadSession) XXX_Unmarshal(b []byte) error
Directories ¶
Path | Synopsis |
---|---|
Package mockstorage is a generated GoMock package.
|
Package mockstorage is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.