Documentation ¶
Index ¶
- Constants
- func CiphData(toCipher DefsV2) string
- func GetBootnodesInfo(uri string) (bootnodes []string, reportAddress []string, err error)
- func GetDataFromServer(url string) (data []byte, err error)
- func SendDataToServers(hosts []string, cmd string, timeout time.Duration, data []byte) error
- type Defs
- type DefsV2
- type HttpReader
- func (hr *HttpReader) GetChunkFromCentral(uri string, start int64, topHash []byte, r *http.Request) (result []byte, isEnd bool)
- func (s *HttpReader) GetDataFromCentralServer(uri string, r *http.Request, w http.ResponseWriter, hash []byte, ...) (retrieved bool)
- func (hr *HttpReader) GetDataLenFromCenter() int64
- func (hr *HttpReader) SetCdnReporter(account string, serverUrls []string)
- type OnError
- type ReportData
- type ReportFmt
- type RpData
Constants ¶
View Source
const MaxLen = 25 * 1024 * 1024
从中心化服务端取数据,最多取1024*1024*8 (8M字节数据)
Variables ¶
This section is empty.
Functions ¶
func GetBootnodesInfo ¶
func GetDataFromServer ¶
Types ¶
type DefsV2 ¶
func DecipherData ¶
type HttpReader ¶
type HttpReader struct {
// contains filtered or unexported fields
}
func CreateHttpReader ¶
func CreateHttpReader() *HttpReader
func (*HttpReader) GetChunkFromCentral ¶
func (*HttpReader) GetDataFromCentralServer ¶
func (s *HttpReader) GetDataFromCentralServer(uri string, r *http.Request, w http.ResponseWriter, hash []byte, onError OnError) (retrieved bool)
get data from server and write to response
func (*HttpReader) GetDataLenFromCenter ¶
func (hr *HttpReader) GetDataLenFromCenter() int64
func (*HttpReader) SetCdnReporter ¶
func (hr *HttpReader) SetCdnReporter(account string, serverUrls []string)
type ReportData ¶
Click to show internal directories.
Click to hide internal directories.