Documentation
¶
Index ¶
- Variables
- func Every(ctx context.Context, d time.Duration, work func(t time.Time))
- func ExtractArchiveSourceName(f archiver.File, dir string) (name string, err error)
- func FirstNotEmpty(v ...string) string
- func FormatBytes(b int64) string
- func MustInt(v string) int
- func ScanReader(r io.Reader, callback func(line string)) error
- type AtomicBool
- type AtomicString
- type Information
Constants ¶
This section is empty.
Variables ¶
var (
// The current version of this software.
Version = "0.0.1"
)
Functions ¶
func ExtractArchiveSourceName ¶
ExtractArchiveSourceName looks for the provided archiver.File's name if it is a type that is supported, otherwise it returns an error to the caller.
func FirstNotEmpty ¶
FirstNotEmpty returns the first string passed in that is not an empty value.
func FormatBytes ¶
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
func NewAtomicBool ¶
func NewAtomicBool(v bool) *AtomicBool
func (*AtomicBool) Load ¶
func (ab *AtomicBool) Load() bool
func (*AtomicBool) MarshalJSON ¶
func (ab *AtomicBool) MarshalJSON() ([]byte, error)
func (*AtomicBool) Store ¶
func (ab *AtomicBool) Store(v bool)
func (*AtomicBool) SwapIf ¶
func (ab *AtomicBool) SwapIf(v bool) bool
Stores the value "v" if the current value stored in the AtomicBool is the opposite boolean value. If successfully swapped, the response is "true", otherwise "false" is returned.
func (*AtomicBool) UnmarshalJSON ¶
func (ab *AtomicBool) UnmarshalJSON(b []byte) error
type AtomicString ¶
type AtomicString struct {
// contains filtered or unexported fields
}
AtomicString allows for reading/writing to a given struct field without having to worry about a potential race condition scenario. Under the hood it uses a simple sync.RWMutex to control access to the value.
func NewAtomicString ¶
func NewAtomicString(v string) *AtomicString
func (*AtomicString) Load ¶
func (as *AtomicString) Load() string
Loads the string value and returns it.
func (*AtomicString) MarshalJSON ¶
func (as *AtomicString) MarshalJSON() ([]byte, error)
func (*AtomicString) Store ¶
func (as *AtomicString) Store(v string)
Stores the string value passed atomically.
func (*AtomicString) UnmarshalJSON ¶
func (as *AtomicString) UnmarshalJSON(b []byte) error
type Information ¶
type Information struct { Version string `json:"version"` KernelVersion string `json:"kernel_version"` Architecture string `json:"architecture"` OS string `json:"os"` CpuCount int `json:"cpu_count"` }
func GetSystemInformation ¶
func GetSystemInformation() (*Information, error)