🏷️ Created Static domain

This commit is contained in:
Maxim Lebedev 2023-11-19 13:51:15 +06:00
parent c8c5a89269
commit 3a2515c255
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 36 additions and 0 deletions

36
internal/domain/static.go Normal file
View File

@ -0,0 +1,36 @@
package domain
import (
"io"
"time"
)
type Static struct {
modTime time.Time
readSeeker io.ReadSeeker
name string
}
func NewStatic(rs io.ReadSeeker, modTime time.Time, name string) *Static {
return &Static{
name: name,
modTime: modTime,
readSeeker: rs,
}
}
func (s Static) Name() string {
return s.name
}
func (s Static) ModTime() time.Time {
return s.modTime
}
func (s *Static) Read(p []byte) (int, error) {
return s.readSeeker.Read(p)
}
func (s *Static) Seek(offset int64, whence int) (int64, error) {
return s.readSeeker.Seek(offset, whence)
}