Documentation ¶
Index ¶
Constants ¶
View Source
const ( KindDirectory = "directory" KindRegular = "regular" KindSymlink = "symlink" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CASReader ¶
type CASReader interface { // Open returns a reader for the given SRI. // If the SRI does not exist, it returns fs.ErrNotExist. Open(sri string) (io.ReadCloser, error) }
type CloseWaitFunc ¶
type CloseWaitFunc func() error
CloseWaitFunc is a function that closes a resource and waits for it to be closed.
type Flat ¶
type Flat struct {
Files []Stat
}
Flat is a flat representation of a tree. It is used to serialize a tree.
type Node ¶
type Node struct { // Stat is the stat (metadata) of the node. Stat Stat // Children are the children of the node. Children []*Node }
Node is a node in the file system tree.
type NodeAttributes ¶
type NodeAttributes struct { // Mtime is the modification time of the node. Mtime time.Time `json:"mtime,omitempty"` // UserID is the uid of the node. UserID string `json:"uid,omitempty"` // GroupID is the gid of the node. GroupID string `json:"gid,omitempty"` // UserName is the name of the user that owns the node. UserName string `json:"uname,omitempty"` // GroupName is the name of the group that owns the node. GroupName string `json:"gname,omitempty"` // Mode is the mode of the node. Mode string `json:"mode,omitempty"` // XAttrs are the extended attributes of the node. XAttrs map[string]string `json:"xattrs,omitempty"` }
NodeAttributes are the attributes of a node.
func (*NodeAttributes) MarshalJSON ¶
func (a *NodeAttributes) MarshalJSON() ([]byte, error)
type Source ¶
type Source interface { // Next returns the next node in the source. // If there are no more nodes, it returns io.EOF. Next() (SourceNode, error) }
type SourceNode ¶
type SourceNode struct { Stat Stat Open func() (io.ReadCloser, error) }
type Stat ¶
type Stat struct { // Name is the name of the node. Name string `json:"name"` // Kind is the kind of the node. Kind string `json:"kind"` // Attributes are the attributes of the node. Attributes NodeAttributes `json:"attributes,inline"` // Payload is a reference to the payload of the node. // It uses the Subresource Integrity (SRI) format for regular files. // For symlinks, it is the target path. Payload string `json:"payload,omitempty"` // Size is the size of the node. // Only regular files have a size. Size int64 `json:"size"` }
Node is a node in the file system tree.
func (*Stat) MarshalJSON ¶
func (*Stat) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.