mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			42 lines
		
	
	
		
			783 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			783 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package caches
 | 
						|
 | 
						|
type ReaderFunc func(n int) (goNext bool, err error)
 | 
						|
 | 
						|
type Reader interface {
 | 
						|
	// Init 初始化
 | 
						|
	Init() error
 | 
						|
 | 
						|
	// TypeName 类型名称
 | 
						|
	TypeName() string
 | 
						|
 | 
						|
	// ExpiresAt 过期时间
 | 
						|
	ExpiresAt() int64
 | 
						|
 | 
						|
	// Status 状态码
 | 
						|
	Status() int
 | 
						|
 | 
						|
	// LastModified 最后修改时间
 | 
						|
	LastModified() int64
 | 
						|
 | 
						|
	// ReadHeader 读取Header
 | 
						|
	ReadHeader(buf []byte, callback ReaderFunc) error
 | 
						|
 | 
						|
	// ReadBody 读取Body
 | 
						|
	ReadBody(buf []byte, callback ReaderFunc) error
 | 
						|
 | 
						|
	// Read 实现io.Reader接口
 | 
						|
	Read(buf []byte) (int, error)
 | 
						|
 | 
						|
	// ReadBodyRange 读取某个范围内的Body
 | 
						|
	ReadBodyRange(buf []byte, start int64, end int64, callback ReaderFunc) error
 | 
						|
 | 
						|
	// HeaderSize Header Size
 | 
						|
	HeaderSize() int64
 | 
						|
 | 
						|
	// BodySize Body Size
 | 
						|
	BodySize() int64
 | 
						|
 | 
						|
	// Close 关闭
 | 
						|
	Close() error
 | 
						|
}
 |