util

package
v0.0.0-...-5a930d7 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppDataDir

func AppDataDir(appName string, roaming bool) string

AppDataDir returns an operating system specific directory to be used for storing application data for an application.

The appName parameter is the name of the application the data directory is being requested for. This function will prepend a period to the appName for POSIX style operating systems since that is standard practice. An empty appName or one with a single dot is treated as requesting the current directory so only "." will be returned. Further, the first character of appName will be made lowercase for POSIX style operating systems and uppercase for Mac and Windows since that is standard practice.

The roaming parameter only applies to Windows where it specifies the roaming application data profile (%APPDATA%) should be used instead of the local one (%LOCALAPPDATA%) that is used by default.

Example results:

dir := AppDataDir("myapp", false)
 POSIX (Linux/BSD): ~/.myapp
 Mac OS: $HOME/Library/Application Support/Myapp
 Windows: %LOCALAPPDATA%\Myapp
 Plan 9: $home/myapp

func CalcMinRequiredTxRelayFee

func CalcMinRequiredTxRelayFee(serializedSize int64, minRelayTxFee int64) int64

calcMinRequiredTxRelayFee returns the minimum transaction fee required for a transaction with the passed serialized size to be accepted into the memory pool and relayed.

func FileExists

func FileExists(filePath string) (bool, error)

FileExists reports whether the named file or directory exists.

Types

type ExplicitString

type ExplicitString struct {
	Value string
	// contains filtered or unexported fields
}

func (*ExplicitString) ExplicitlySet

func (e *ExplicitString) ExplicitlySet() bool

ExplicitlySet returns whether the flag was explicitly set through the flags.Unmarshaler interface.

func (*ExplicitString) MarshalFlag

func (e *ExplicitString) MarshalFlag() (string, error)

MarshalFlag implements the flags.Marshaler interface.

func (*ExplicitString) UnmarshalFlag

func (e *ExplicitString) UnmarshalFlag(value string) error

UnmarshalFlag implements the flags.Unmarshaler interface.

Jump to

Keyboard shortcuts

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