mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
2180aa4f6f
pkg/archive contains code both invoked from cli (cross platform) and daemon (linux only) and Unix-specific dependencies break compilation on Windows. We extracted those stat-related funcs into platform specific implementations at pkg/system and added unit tests. Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
42 lines
515 B
Go
42 lines
515 B
Go
package system
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
type Stat struct {
|
|
mode uint32
|
|
uid uint32
|
|
gid uint32
|
|
rdev uint64
|
|
size int64
|
|
mtim syscall.Timespec
|
|
}
|
|
|
|
func (s Stat) Mode() uint32 {
|
|
return s.mode
|
|
}
|
|
|
|
func (s Stat) Uid() uint32 {
|
|
return s.uid
|
|
}
|
|
|
|
func (s Stat) Gid() uint32 {
|
|
return s.gid
|
|
}
|
|
|
|
func (s Stat) Rdev() uint64 {
|
|
return s.rdev
|
|
}
|
|
|
|
func (s Stat) Size() int64 {
|
|
return s.size
|
|
}
|
|
|
|
func (s Stat) Mtim() syscall.Timespec {
|
|
return s.mtim
|
|
}
|
|
|
|
func (s Stat) GetLastModification() syscall.Timespec {
|
|
return s.Mtim()
|
|
}
|