Documentation ¶
Index ¶
- func AutoFormatBalance(b Balance) string
- func AutoFormatStatic(amount int64) string
- func FormatBalance(b Balance, unit BalanceUnit) string
- func FormatStatic(amount int64, unit string) string
- func ParseBalanceStatic(str string) (int64, error)
- type Balance
- type BalanceUnit
- type DiskFS
- func (dfs *DiskFS) MkdirAll(path string, perm os.FileMode) error
- func (dfs *DiskFS) Open(name string) (File, error)
- func (dfs *DiskFS) OpenFile(name string, flag int, perm os.FileMode) (File, error)
- func (dfs *DiskFS) ReadFile(name string) ([]byte, error)
- func (dfs *DiskFS) Remove(name string) error
- func (dfs *DiskFS) WriteFile(name string, data []byte, perm os.FileMode) error
- type FS
- type File
- type Key
- type MemFS
- func (mfs *MemFS) MkdirAll(path string, perm os.FileMode) error
- func (mfs *MemFS) Open(name string) (File, error)
- func (mfs *MemFS) OpenFile(name string, flag int, perm os.FileMode) (File, error)
- func (mfs *MemFS) ReadFile(name string) ([]byte, error)
- func (mfs *MemFS) Remove(name string) error
- func (mfs *MemFS) WriteFile(name string, data []byte, perm os.FileMode) error
- type MemFile
- type MemFileInfo
- func (i *MemFileInfo) Info() (fs.FileInfo, error)
- func (i *MemFileInfo) IsDir() bool
- func (i *MemFileInfo) ModTime() time.Time
- func (i *MemFileInfo) Mode() fs.FileMode
- func (i *MemFileInfo) Name() string
- func (i *MemFileInfo) Size() int64
- func (i *MemFileInfo) Sys() interface{}
- func (i *MemFileInfo) Type() fs.FileMode
- type Size
- type Timestamp
- type WhoPays
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoFormatBalance ¶ added in v1.2.86
func AutoFormatStatic ¶ added in v1.2.88
func FormatBalance ¶ added in v1.2.86
func FormatBalance(b Balance, unit BalanceUnit) string
func FormatStatic ¶ added in v1.2.88
func ParseBalanceStatic ¶ added in v1.2.88
Types ¶
type Balance ¶
type Balance int64
Balance represents 0chain native token
func ParseBalance ¶ added in v1.2.86
func (Balance) AutoFormat ¶ added in v1.2.86
func (Balance) Format ¶ added in v1.2.86
func (b Balance) Format(unit BalanceUnit) string
type BalanceUnit ¶ added in v1.2.86
type BalanceUnit byte
const ( SAS BalanceUnit = iota UZCN MZCN ZCN )
func (*BalanceUnit) Parse ¶ added in v1.2.86
func (unit *BalanceUnit) Parse(s string) error
func (BalanceUnit) String ¶ added in v1.2.86
func (unit BalanceUnit) String() string
type DiskFS ¶ added in v1.3.5
type DiskFS struct { }
DiskFS implement file system on disk
func (*DiskFS) Open ¶ added in v1.3.5
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
func (*DiskFS) ReadFile ¶ added in v1.3.6
ReadFile reads the file named by filename and returns the contents.
type FS ¶ added in v1.3.5
type FS interface { // Open opens the named file for reading. If successful, methods on // the returned file can be used for reading; the associated file // descriptor has mode O_RDONLY. // If there is an error, it will be of type *PathError. Open(name string) (File, error) // OpenFile open a file OpenFile(name string, flag int, perm os.FileMode) (File, error) // ReadFile reads the file named by filename and returns the contents. ReadFile(name string) ([]byte, error) // WriteFile writes data to a file named by filename. WriteFile(name string, data []byte, perm fs.FileMode) error // Remove removes the named file or (empty) directory. // If there is an error, it will be of type *PathError. Remove(name string) error //MkdirAll creates a directory named path MkdirAll(path string, perm os.FileMode) error }
FS An FS provides access to a hierarchical file system.
type Key ¶
type Key string
A Key represents an identifier. It can be a pool ID, client ID, smart contract address, etc.
type MemFS ¶ added in v1.3.5
type MemFS struct {
// contains filtered or unexported fields
}
MemFS implement file system on memory
func (*MemFS) Open ¶ added in v1.3.5
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
func (*MemFS) ReadFile ¶ added in v1.3.6
ReadFile reads the file named by filename and returns the contents.
type MemFile ¶ added in v1.3.5
type MemFile struct { Name string Buffer *bytes.Buffer // file content Mode fs.FileMode // FileInfo.Mode ModTime time.Time // FileInfo.ModTime Sys interface{} // FileInfo.Sys // contains filtered or unexported fields }
type MemFileInfo ¶ added in v1.3.5
type MemFileInfo struct {
// contains filtered or unexported fields
}
func (*MemFileInfo) IsDir ¶ added in v1.3.5
func (i *MemFileInfo) IsDir() bool
func (*MemFileInfo) ModTime ¶ added in v1.3.5
func (i *MemFileInfo) ModTime() time.Time
func (*MemFileInfo) Mode ¶ added in v1.3.5
func (i *MemFileInfo) Mode() fs.FileMode
func (*MemFileInfo) Name ¶ added in v1.3.5
func (i *MemFileInfo) Name() string
func (*MemFileInfo) Size ¶ added in v1.3.5
func (i *MemFileInfo) Size() int64
func (*MemFileInfo) Sys ¶ added in v1.3.5
func (i *MemFileInfo) Sys() interface{}
func (*MemFileInfo) Type ¶ added in v1.3.5
func (i *MemFileInfo) Type() fs.FileMode
type Timestamp ¶
type Timestamp int64
Timestamp represents Unix time (e.g. in seconds)
type WhoPays ¶
type WhoPays int
WhoPays for file downloading.
const ( WhoPaysOwner WhoPays = iota // 0, file owner pays WhoPays3rdParty // 1, 3rd party user pays )
possible variants