Documentation ¶
Index ¶
- Variables
- func ContentHash(r io.Reader) (string, error)
- func ContentHashBytes(v []byte) string
- type FileContent
- type FileRef
- type HTTPResponse
- func (HTTPResponse) ConflictColumns() []clause.Column
- func (m *HTTPResponse) GetBody() (rc io.ReadCloser, err error)
- func (m *HTTPResponse) GetResponse(req *http.Request) (resp *http.Response, err error)
- func (m *HTTPResponse) ReadAll() (out []byte, err error)
- func (m *HTTPResponse) SetResponse(resp *http.Response) (err error)
- type Model
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultEncoding = httpencoding.EncodingZstd
Functions ¶
func ContentHashBytes ¶
Types ¶
type FileContent ¶
type FileContent struct { Model Hash string `gorm:"unique"` Name string Size int64 `gorm:"index"` Ext string ContentType string Content []byte Extension datatypes.JSON Attributes datatypes.JSON }
func (FileContent) ConflictColumns ¶
func (FileContent) ConflictColumns() []clause.Column
type FileRef ¶
type FileRef struct { Model Hash string `gorm:"uniqueIndex:idx_file_ref_hash_url"` URL string `gorm:"uniqueIndex:idx_file_ref_hash_url"` File *FileContent `gorm:"foreignKey:Hash;references:Hash"` Name string }
func (FileRef) ConflictColumns ¶
type HTTPResponse ¶
type HTTPResponse struct { Model Method string `gorm:"uniqueIndex:idx_http_responses_method_url"` URL string `gorm:"uniqueIndex:idx_http_responses_method_url"` Host string Path string Proto string StatusCode int Header datatypes.JSON RawSize int64 // size before encoding BodySize int64 // size of Body Body []byte ContentType string ContentEncoding string // gzip, deflate, br, zstd, identity ContentHash string // sha2-256 for raw data for file FileName string }
func (HTTPResponse) ConflictColumns ¶
func (HTTPResponse) ConflictColumns() []clause.Column
func (*HTTPResponse) GetBody ¶
func (m *HTTPResponse) GetBody() (rc io.ReadCloser, err error)
func (*HTTPResponse) GetResponse ¶
func (*HTTPResponse) ReadAll ¶
func (m *HTTPResponse) ReadAll() (out []byte, err error)
func (*HTTPResponse) SetResponse ¶
func (m *HTTPResponse) SetResponse(resp *http.Response) (err error)
Click to show internal directories.
Click to hide internal directories.