Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
Header for a WARC record. Header field names are case-sensitive.
func NewHeader ¶
func NewHeader() Header
NewHeader returns a Header with its own unique ID and the current timestamp.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer can write records to a file in WARC format. It is safe for concurrent access, since writes are serialized internally.
func NewMultiWriter ¶
NewMultiWriter initializes a new Writer that writes its output to multiple files of limited size approximately equal to maxSize, rotating them when necessary. The input path should contain a literal '%s' token, which will be replaced with a (lexically sortable) unique token.
func NewWriter ¶
func NewWriter(w io.WriteCloser) *Writer
NewWriter initializes a new Writer and returns it.
func (*Writer) Close ¶
Close the WARC writer and flush all buffers. This will also call Close on the wrapped io.WriteCloser object.
func (*Writer) NewRecord ¶
func (w *Writer) NewRecord(hdr Header) (io.WriteCloser, error)
NewRecord starts a new WARC record with the provided header. The caller must call Close on the returned writer before creating the next record. Note that this function may block until that condition is satisfied. If this function returns an error, the state of the Writer is invalid and it should no longer be used.