mirror of
https://github.com/derfenix/webarchive.git
synced 2026-03-11 22:40:58 +03:00
Refactoring
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"github.com/vmihailenco/msgpack/v5"
|
||||
)
|
||||
|
||||
type ResultsRO []Result
|
||||
|
||||
type Result struct {
|
||||
Format Format
|
||||
Err error
|
||||
@@ -17,6 +19,13 @@ type Results struct {
|
||||
results []Result
|
||||
}
|
||||
|
||||
func (r *Results) RO() ResultsRO {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
return r.results
|
||||
}
|
||||
|
||||
func (r *Results) MarshalMsgpack() ([]byte, error) {
|
||||
return msgpack.Marshal(r.results)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user