prefixinfo

package
v0.0.0-...-2c34a8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Package cloudeng.io/cmd/idu/internal/prefixinfo

CircleCI Go Report Card

import cloudeng.io/cmd/idu/internal/prefixinfo

Functions

Func NewSysInfo
func NewSysInfo(uid, gid int64, dev, ino uint64, blocks int64) any

NewSysInfo is intended to be used by tests.

Types

Type IDSanner
type IDSanner interface {
	Next() bool
	Info() file.Info
}

IDScanner allows for iterating over files that belong to a particular user or group.

Type Stats
type Stats struct {
	ID           uint32
	Files        int64 // number of files
	Prefixes     int64 // number of prefixes/directories
	Bytes        int64 // total size of files
	StorageBytes int64 // total size of files on disk
	PrefixBytes  int64 // total size of prefixes
}
Methods
func (s *Stats) AppendBinary(data []byte) []byte
func (s *Stats) DecodeBinary(data []byte) []byte
func (s *Stats) MarshalBinary() (data []byte, err error)
func (s *Stats) UnmarshalBinary(data []byte) error
Type StatsList
type StatsList []Stats
Methods
func (sl StatsList) AppendBinary(data []byte) []byte
func (sl *StatsList) DecodeBinary(data []byte) []byte
func (sl StatsList) MarshalBinary() (data []byte, err error)
func (sl *StatsList) UnmarshalBinary(data []byte) error
Type T
type T struct {
	// contains filtered or unexported fields
}
Functions
func New(pathname string, info file.Info) T

New creates a new PrefixInfo for the supplied file.Info. It assumes that the supplied file.Info contains a file.XAttr in its Sys() value.

Methods
func (pi *T) AppendBinary(buf *bytes.Buffer) error
func (pi *T) AppendInfo(entry file.Info)
func (pi *T) AppendInfoList(entries file.InfoList)
func (pi T) Blocks() int64
func (pi T) DevIno() (device, inode uint64)
func (pi T) FilesOnly() file.InfoList
func (pi *T) GroupIDScan(id int64) (IDSanner, error)

GroupIDScan returns an IDSanner for the supplied group id.

func (pi T) InfoList() file.InfoList

Info returns the list of file.Info's available for this prefix. NOTE that these may contain directories, ie. entries for which IsDir is true.

func (pi *T) MarshalBinary() ([]byte, error)
func (pi T) ModTime() time.Time
func (pi T) Mode() fs.FileMode
func (pi T) PrefixesOnly() file.InfoList
func (pi *T) SetInfoList(entries file.InfoList)
func (pi T) Size() int64
func (pi T) Type() fs.FileMode
func (pi T) Unchanged(npi T) bool
func (pi T) UnchangedInfo(info file.Info) bool
func (pi *T) UnmarshalBinary(data []byte) error
func (pi T) UserGroup() (uid, gid int64)
func (pi *T) UserIDScan(id int64) (IDSanner, error)

UserIDScan returns an IDSanner for the supplied user id. It can only be used after Finalize has been called.

func (pi T) XAttr() file.XAttr
func (pi T) XAttrInfo(fi file.Info) file.XAttr
TODO
  • cnicolaou: parametize for posix and non-posix (ie. numeric vs string) UID/GID.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSysInfo

func NewSysInfo(uid, gid int64, dev, ino uint64, blocks int64) any

NewSysInfo is intended to be used by tests.

Types

type IDSanner

type IDSanner interface {
	Next() bool
	Info() file.Info
}

IDScanner allows for iterating over files that belong to a particular user or group.

type Stats

type Stats struct {
	ID           uint32
	Files        int64 // number of files
	Prefixes     int64 // number of prefixes/directories
	Bytes        int64 // total size of files
	StorageBytes int64 // total size of files on disk
	PrefixBytes  int64 // total size of prefixes
}

func (*Stats) AppendBinary

func (s *Stats) AppendBinary(data []byte) []byte

func (*Stats) DecodeBinary

func (s *Stats) DecodeBinary(data []byte) []byte

func (*Stats) MarshalBinary

func (s *Stats) MarshalBinary() (data []byte, err error)

func (*Stats) UnmarshalBinary

func (s *Stats) UnmarshalBinary(data []byte) error

type StatsList

type StatsList []Stats

func (StatsList) AppendBinary

func (sl StatsList) AppendBinary(data []byte) []byte

func (*StatsList) DecodeBinary

func (sl *StatsList) DecodeBinary(data []byte) []byte

func (StatsList) MarshalBinary

func (sl StatsList) MarshalBinary() (data []byte, err error)

func (*StatsList) UnmarshalBinary

func (sl *StatsList) UnmarshalBinary(data []byte) error

type T

type T struct {
	// contains filtered or unexported fields
}

func New

func New(pathname string, info file.Info) T

New creates a new PrefixInfo for the supplied file.Info. It assumes that the supplied file.Info contains a file.XAttr in its Sys() value.

func (*T) AppendBinary

func (pi *T) AppendBinary(buf *bytes.Buffer) error

func (*T) AppendInfo

func (pi *T) AppendInfo(entry file.Info)

func (*T) AppendInfoList

func (pi *T) AppendInfoList(entries file.InfoList)

func (T) Blocks

func (pi T) Blocks() int64

func (T) DevIno

func (pi T) DevIno() (device, inode uint64)

func (T) FilesOnly

func (pi T) FilesOnly() file.InfoList

func (*T) GroupIDScan

func (pi *T) GroupIDScan(id int64) (IDSanner, error)

GroupIDScan returns an IDSanner for the supplied group id.

func (T) InfoList

func (pi T) InfoList() file.InfoList

Info returns the list of file.Info's available for this prefix. NOTE that these may contain directories, ie. entries for which IsDir is true.

func (*T) MarshalBinary

func (pi *T) MarshalBinary() ([]byte, error)

func (T) ModTime

func (pi T) ModTime() time.Time

func (T) Mode

func (pi T) Mode() fs.FileMode

func (T) PrefixesOnly

func (pi T) PrefixesOnly() file.InfoList

func (*T) SetInfoList

func (pi *T) SetInfoList(entries file.InfoList)

func (T) Size

func (pi T) Size() int64

func (T) Type

func (pi T) Type() fs.FileMode

func (T) Unchanged

func (pi T) Unchanged(npi T) bool

func (T) UnchangedInfo

func (pi T) UnchangedInfo(info file.Info) bool

func (*T) UnmarshalBinary

func (pi *T) UnmarshalBinary(data []byte) error

func (T) UserGroup

func (pi T) UserGroup() (uid, gid int64)

func (*T) UserIDScan

func (pi *T) UserIDScan(id int64) (IDSanner, error)

UserIDScan returns an IDSanner for the supplied user id. It can only be used after Finalize has been called.

func (T) XAttr

func (pi T) XAttr() file.XAttr

func (T) XAttrInfo

func (pi T) XAttrInfo(fi file.Info) file.XAttr

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL