github.com/jlowellwofford/u-root@v1.0.0/xcmds/archive/types.go (about) 1 // Copyright 2013 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 "os" 9 "time" 10 ) 11 12 type file struct { 13 Name string 14 Size int64 15 Mode os.FileMode 16 ModTime time.Time 17 IsDir bool 18 Link string 19 20 // Yes, this is Unix-specific. But u-root in general is very Unix-specific 21 // and I can't get that worried about it. 22 Uid int 23 Gid int 24 Dev uint64 25 // The offset is not exported. 26 // We want the VTOC at the head of the file so we can stream the file. 27 // We don't save the offset that is not known until we know the size 28 // of the VTOC, which then changes its size with many encodings 29 // (gob, JSON, etc.) 30 // So we compute it once we read in the VTOC -- from the 31 // file structs themselves. 32 offset int64 33 } 34 35 type vtoc struct { 36 f os.File 37 vtoc []*file 38 } 39 40 type VTOCOpt func(*vtoc) error