Documentation ¶
Index ¶
- func ListenAndServe(port int) (*grpc.Server, error)
- func RegisterBlobExchangeServer(s *grpc.Server, srv BlobExchangeServer)
- type BlobExchangeClient
- type BlobExchangeServer
- type BlobExchange_DownloadClient
- type BlobExchange_DownloadServer
- type BlobExchange_UploadClient
- type BlobExchange_UploadServer
- type DownloadRequest
- func (*DownloadRequest) Descriptor() ([]byte, []int)
- func (m *DownloadRequest) GetHash() string
- func (*DownloadRequest) ProtoMessage()
- func (m *DownloadRequest) Reset()
- func (m *DownloadRequest) String() string
- func (m *DownloadRequest) XXX_DiscardUnknown()
- func (m *DownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DownloadRequest) XXX_Merge(src proto.Message)
- func (m *DownloadRequest) XXX_Size() int
- func (m *DownloadRequest) XXX_Unmarshal(b []byte) error
- type DownloadResponse
- func (*DownloadResponse) Descriptor() ([]byte, []int)
- func (m *DownloadResponse) GetAddress() string
- func (m *DownloadResponse) GetBlob() []byte
- func (m *DownloadResponse) GetError() *Error
- func (m *DownloadResponse) GetHash() string
- func (m *DownloadResponse) GetPrice() uint64
- func (*DownloadResponse) ProtoMessage()
- func (m *DownloadResponse) Reset()
- func (m *DownloadResponse) String() string
- func (m *DownloadResponse) XXX_DiscardUnknown()
- func (m *DownloadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DownloadResponse) XXX_Merge(src proto.Message)
- func (m *DownloadResponse) XXX_Size() int
- func (m *DownloadResponse) XXX_Unmarshal(b []byte) error
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (m *Error) GetCode() uint32
- func (m *Error) GetMessage() string
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) String() string
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type HashesRequest
- func (*HashesRequest) Descriptor() ([]byte, []int)
- func (m *HashesRequest) GetHashes() []string
- func (*HashesRequest) ProtoMessage()
- func (m *HashesRequest) Reset()
- func (m *HashesRequest) String() string
- func (m *HashesRequest) XXX_DiscardUnknown()
- func (m *HashesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashesRequest) XXX_Merge(src proto.Message)
- func (m *HashesRequest) XXX_Size() int
- func (m *HashesRequest) XXX_Unmarshal(b []byte) error
- type HashesResponse
- func (*HashesResponse) Descriptor() ([]byte, []int)
- func (m *HashesResponse) GetError() *Error
- func (m *HashesResponse) GetHashes() map[string]bool
- func (*HashesResponse) ProtoMessage()
- func (m *HashesResponse) Reset()
- func (m *HashesResponse) String() string
- func (m *HashesResponse) XXX_DiscardUnknown()
- func (m *HashesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashesResponse) XXX_Merge(src proto.Message)
- func (m *HashesResponse) XXX_Size() int
- func (m *HashesResponse) XXX_Unmarshal(b []byte) error
- type PriceCheckRequest
- func (*PriceCheckRequest) Descriptor() ([]byte, []int)
- func (*PriceCheckRequest) ProtoMessage()
- func (m *PriceCheckRequest) Reset()
- func (m *PriceCheckRequest) String() string
- func (m *PriceCheckRequest) XXX_DiscardUnknown()
- func (m *PriceCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PriceCheckRequest) XXX_Merge(src proto.Message)
- func (m *PriceCheckRequest) XXX_Size() int
- func (m *PriceCheckRequest) XXX_Unmarshal(b []byte) error
- type PriceCheckResponse
- func (*PriceCheckResponse) Descriptor() ([]byte, []int)
- func (m *PriceCheckResponse) GetDeweysPerKB() uint64
- func (m *PriceCheckResponse) GetError() *Error
- func (*PriceCheckResponse) ProtoMessage()
- func (m *PriceCheckResponse) Reset()
- func (m *PriceCheckResponse) String() string
- func (m *PriceCheckResponse) XXX_DiscardUnknown()
- func (m *PriceCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PriceCheckResponse) XXX_Merge(src proto.Message)
- func (m *PriceCheckResponse) XXX_Size() int
- func (m *PriceCheckResponse) XXX_Unmarshal(b []byte) error
- type Server
- func (s *Server) Download(BlobExchange_DownloadServer) error
- func (s *Server) DownloadCheck(context.Context, *HashesRequest) (*HashesResponse, error)
- func (s *Server) PriceCheck(ctx context.Context, r *PriceCheckRequest) (*PriceCheckResponse, error)
- func (s *Server) Upload(BlobExchange_UploadServer) error
- func (s *Server) UploadCheck(context.Context, *HashesRequest) (*HashesResponse, error)
- type UploadRequest
- func (*UploadRequest) Descriptor() ([]byte, []int)
- func (m *UploadRequest) GetBlob() []byte
- func (m *UploadRequest) GetHash() string
- func (*UploadRequest) ProtoMessage()
- func (m *UploadRequest) Reset()
- func (m *UploadRequest) String() string
- func (m *UploadRequest) XXX_DiscardUnknown()
- func (m *UploadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UploadRequest) XXX_Merge(src proto.Message)
- func (m *UploadRequest) XXX_Size() int
- func (m *UploadRequest) XXX_Unmarshal(b []byte) error
- type UploadResponse
- func (*UploadResponse) Descriptor() ([]byte, []int)
- func (m *UploadResponse) GetError() *Error
- func (m *UploadResponse) GetHash() string
- func (*UploadResponse) ProtoMessage()
- func (m *UploadResponse) Reset()
- func (m *UploadResponse) String() string
- func (m *UploadResponse) XXX_DiscardUnknown()
- func (m *UploadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UploadResponse) XXX_Merge(src proto.Message)
- func (m *UploadResponse) XXX_Size() int
- func (m *UploadResponse) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterBlobExchangeServer ¶
func RegisterBlobExchangeServer(s *grpc.Server, srv BlobExchangeServer)
Types ¶
type BlobExchangeClient ¶
type BlobExchangeClient interface { PriceCheck(ctx context.Context, in *PriceCheckRequest, opts ...grpc.CallOption) (*PriceCheckResponse, error) DownloadCheck(ctx context.Context, in *HashesRequest, opts ...grpc.CallOption) (*HashesResponse, error) Download(ctx context.Context, opts ...grpc.CallOption) (BlobExchange_DownloadClient, error) UploadCheck(ctx context.Context, in *HashesRequest, opts ...grpc.CallOption) (*HashesResponse, error) Upload(ctx context.Context, opts ...grpc.CallOption) (BlobExchange_UploadClient, error) }
BlobExchangeClient is the client API for BlobExchange service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBlobExchangeClient ¶
func NewBlobExchangeClient(cc *grpc.ClientConn) BlobExchangeClient
type BlobExchangeServer ¶
type BlobExchangeServer interface { PriceCheck(context.Context, *PriceCheckRequest) (*PriceCheckResponse, error) DownloadCheck(context.Context, *HashesRequest) (*HashesResponse, error) Download(BlobExchange_DownloadServer) error UploadCheck(context.Context, *HashesRequest) (*HashesResponse, error) Upload(BlobExchange_UploadServer) error }
BlobExchangeServer is the server API for BlobExchange service.
type BlobExchange_DownloadClient ¶
type BlobExchange_DownloadClient interface { Send(*DownloadRequest) error Recv() (*DownloadResponse, error) grpc.ClientStream }
type BlobExchange_DownloadServer ¶
type BlobExchange_DownloadServer interface { Send(*DownloadResponse) error Recv() (*DownloadRequest, error) grpc.ServerStream }
type BlobExchange_UploadClient ¶
type BlobExchange_UploadClient interface { Send(*UploadRequest) error Recv() (*UploadResponse, error) grpc.ClientStream }
type BlobExchange_UploadServer ¶
type BlobExchange_UploadServer interface { Send(*UploadResponse) error Recv() (*UploadRequest, error) grpc.ServerStream }
type DownloadRequest ¶
type DownloadRequest struct { Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
download the hash
func (*DownloadRequest) Descriptor ¶
func (*DownloadRequest) Descriptor() ([]byte, []int)
func (*DownloadRequest) GetHash ¶
func (m *DownloadRequest) GetHash() string
func (*DownloadRequest) ProtoMessage ¶
func (*DownloadRequest) ProtoMessage()
func (*DownloadRequest) Reset ¶
func (m *DownloadRequest) Reset()
func (*DownloadRequest) String ¶
func (m *DownloadRequest) String() string
func (*DownloadRequest) XXX_DiscardUnknown ¶
func (m *DownloadRequest) XXX_DiscardUnknown()
func (*DownloadRequest) XXX_Marshal ¶
func (m *DownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DownloadRequest) XXX_Merge ¶
func (m *DownloadRequest) XXX_Merge(src proto.Message)
func (*DownloadRequest) XXX_Size ¶
func (m *DownloadRequest) XXX_Size() int
func (*DownloadRequest) XXX_Unmarshal ¶
func (m *DownloadRequest) XXX_Unmarshal(b []byte) error
type DownloadResponse ¶
type DownloadResponse struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"` Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` Price uint64 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DownloadResponse) Descriptor ¶
func (*DownloadResponse) Descriptor() ([]byte, []int)
func (*DownloadResponse) GetAddress ¶
func (m *DownloadResponse) GetAddress() string
func (*DownloadResponse) GetBlob ¶
func (m *DownloadResponse) GetBlob() []byte
func (*DownloadResponse) GetError ¶
func (m *DownloadResponse) GetError() *Error
func (*DownloadResponse) GetHash ¶
func (m *DownloadResponse) GetHash() string
func (*DownloadResponse) GetPrice ¶
func (m *DownloadResponse) GetPrice() uint64
func (*DownloadResponse) ProtoMessage ¶
func (*DownloadResponse) ProtoMessage()
func (*DownloadResponse) Reset ¶
func (m *DownloadResponse) Reset()
func (*DownloadResponse) String ¶
func (m *DownloadResponse) String() string
func (*DownloadResponse) XXX_DiscardUnknown ¶
func (m *DownloadResponse) XXX_DiscardUnknown()
func (*DownloadResponse) XXX_Marshal ¶
func (m *DownloadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DownloadResponse) XXX_Merge ¶
func (m *DownloadResponse) XXX_Merge(src proto.Message)
func (*DownloadResponse) XXX_Size ¶
func (m *DownloadResponse) XXX_Size() int
func (*DownloadResponse) XXX_Unmarshal ¶
func (m *DownloadResponse) XXX_Unmarshal(b []byte) error
type Error ¶
type Error struct { // should we enum the error codes? Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Error) Descriptor ¶
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type HashesRequest ¶
type HashesRequest struct { Hashes []string `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
are any of the hashs available for download, or are any of the hashes desired for upload NOTE: if any hashes are stream hashes, and the server has the manifest but not all the content blobs, the server may reply that it needs extra blobs that were not in the original request
func (*HashesRequest) Descriptor ¶
func (*HashesRequest) Descriptor() ([]byte, []int)
func (*HashesRequest) GetHashes ¶
func (m *HashesRequest) GetHashes() []string
func (*HashesRequest) ProtoMessage ¶
func (*HashesRequest) ProtoMessage()
func (*HashesRequest) Reset ¶
func (m *HashesRequest) Reset()
func (*HashesRequest) String ¶
func (m *HashesRequest) String() string
func (*HashesRequest) XXX_DiscardUnknown ¶
func (m *HashesRequest) XXX_DiscardUnknown()
func (*HashesRequest) XXX_Marshal ¶
func (m *HashesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HashesRequest) XXX_Merge ¶
func (m *HashesRequest) XXX_Merge(src proto.Message)
func (*HashesRequest) XXX_Size ¶
func (m *HashesRequest) XXX_Size() int
func (*HashesRequest) XXX_Unmarshal ¶
func (m *HashesRequest) XXX_Unmarshal(b []byte) error
type HashesResponse ¶
type HashesResponse struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Hashes map[string]bool `` /* 154-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HashesResponse) Descriptor ¶
func (*HashesResponse) Descriptor() ([]byte, []int)
func (*HashesResponse) GetError ¶
func (m *HashesResponse) GetError() *Error
func (*HashesResponse) GetHashes ¶
func (m *HashesResponse) GetHashes() map[string]bool
func (*HashesResponse) ProtoMessage ¶
func (*HashesResponse) ProtoMessage()
func (*HashesResponse) Reset ¶
func (m *HashesResponse) Reset()
func (*HashesResponse) String ¶
func (m *HashesResponse) String() string
func (*HashesResponse) XXX_DiscardUnknown ¶
func (m *HashesResponse) XXX_DiscardUnknown()
func (*HashesResponse) XXX_Marshal ¶
func (m *HashesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HashesResponse) XXX_Merge ¶
func (m *HashesResponse) XXX_Merge(src proto.Message)
func (*HashesResponse) XXX_Size ¶
func (m *HashesResponse) XXX_Size() int
func (*HashesResponse) XXX_Unmarshal ¶
func (m *HashesResponse) XXX_Unmarshal(b []byte) error
type PriceCheckRequest ¶
type PriceCheckRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
how much does the host charge per kb at the moment
func (*PriceCheckRequest) Descriptor ¶
func (*PriceCheckRequest) Descriptor() ([]byte, []int)
func (*PriceCheckRequest) ProtoMessage ¶
func (*PriceCheckRequest) ProtoMessage()
func (*PriceCheckRequest) Reset ¶
func (m *PriceCheckRequest) Reset()
func (*PriceCheckRequest) String ¶
func (m *PriceCheckRequest) String() string
func (*PriceCheckRequest) XXX_DiscardUnknown ¶
func (m *PriceCheckRequest) XXX_DiscardUnknown()
func (*PriceCheckRequest) XXX_Marshal ¶
func (m *PriceCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PriceCheckRequest) XXX_Merge ¶
func (m *PriceCheckRequest) XXX_Merge(src proto.Message)
func (*PriceCheckRequest) XXX_Size ¶
func (m *PriceCheckRequest) XXX_Size() int
func (*PriceCheckRequest) XXX_Unmarshal ¶
func (m *PriceCheckRequest) XXX_Unmarshal(b []byte) error
type PriceCheckResponse ¶
type PriceCheckResponse struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` DeweysPerKB uint64 `protobuf:"varint,2,opt,name=deweysPerKB,proto3" json:"deweysPerKB,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PriceCheckResponse) Descriptor ¶
func (*PriceCheckResponse) Descriptor() ([]byte, []int)
func (*PriceCheckResponse) GetDeweysPerKB ¶
func (m *PriceCheckResponse) GetDeweysPerKB() uint64
func (*PriceCheckResponse) GetError ¶
func (m *PriceCheckResponse) GetError() *Error
func (*PriceCheckResponse) ProtoMessage ¶
func (*PriceCheckResponse) ProtoMessage()
func (*PriceCheckResponse) Reset ¶
func (m *PriceCheckResponse) Reset()
func (*PriceCheckResponse) String ¶
func (m *PriceCheckResponse) String() string
func (*PriceCheckResponse) XXX_DiscardUnknown ¶
func (m *PriceCheckResponse) XXX_DiscardUnknown()
func (*PriceCheckResponse) XXX_Marshal ¶
func (m *PriceCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PriceCheckResponse) XXX_Merge ¶
func (m *PriceCheckResponse) XXX_Merge(src proto.Message)
func (*PriceCheckResponse) XXX_Size ¶
func (m *PriceCheckResponse) XXX_Size() int
func (*PriceCheckResponse) XXX_Unmarshal ¶
func (m *PriceCheckResponse) XXX_Unmarshal(b []byte) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Download ¶
func (s *Server) Download(BlobExchange_DownloadServer) error
func (*Server) DownloadCheck ¶
func (s *Server) DownloadCheck(context.Context, *HashesRequest) (*HashesResponse, error)
func (*Server) PriceCheck ¶
func (s *Server) PriceCheck(ctx context.Context, r *PriceCheckRequest) (*PriceCheckResponse, error)
func (*Server) Upload ¶
func (s *Server) Upload(BlobExchange_UploadServer) error
func (*Server) UploadCheck ¶
func (s *Server) UploadCheck(context.Context, *HashesRequest) (*HashesResponse, error)
type UploadRequest ¶
type UploadRequest struct { Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3" json:"blob,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
upload the hash
func (*UploadRequest) Descriptor ¶
func (*UploadRequest) Descriptor() ([]byte, []int)
func (*UploadRequest) GetBlob ¶
func (m *UploadRequest) GetBlob() []byte
func (*UploadRequest) GetHash ¶
func (m *UploadRequest) GetHash() string
func (*UploadRequest) ProtoMessage ¶
func (*UploadRequest) ProtoMessage()
func (*UploadRequest) Reset ¶
func (m *UploadRequest) Reset()
func (*UploadRequest) String ¶
func (m *UploadRequest) String() string
func (*UploadRequest) XXX_DiscardUnknown ¶
func (m *UploadRequest) XXX_DiscardUnknown()
func (*UploadRequest) XXX_Marshal ¶
func (m *UploadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UploadRequest) XXX_Merge ¶
func (m *UploadRequest) XXX_Merge(src proto.Message)
func (*UploadRequest) XXX_Size ¶
func (m *UploadRequest) XXX_Size() int
func (*UploadRequest) XXX_Unmarshal ¶
func (m *UploadRequest) XXX_Unmarshal(b []byte) error
type UploadResponse ¶
type UploadResponse struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UploadResponse) Descriptor ¶
func (*UploadResponse) Descriptor() ([]byte, []int)
func (*UploadResponse) GetError ¶
func (m *UploadResponse) GetError() *Error
func (*UploadResponse) GetHash ¶
func (m *UploadResponse) GetHash() string
func (*UploadResponse) ProtoMessage ¶
func (*UploadResponse) ProtoMessage()
func (*UploadResponse) Reset ¶
func (m *UploadResponse) Reset()
func (*UploadResponse) String ¶
func (m *UploadResponse) String() string
func (*UploadResponse) XXX_DiscardUnknown ¶
func (m *UploadResponse) XXX_DiscardUnknown()
func (*UploadResponse) XXX_Marshal ¶
func (m *UploadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UploadResponse) XXX_Merge ¶
func (m *UploadResponse) XXX_Merge(src proto.Message)
func (*UploadResponse) XXX_Size ¶
func (m *UploadResponse) XXX_Size() int
func (*UploadResponse) XXX_Unmarshal ¶
func (m *UploadResponse) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.