converters

package
v0.0.0-...-3f873ad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	String        TString
	Int           TInt
	Int64         TInt64
	Float64       TFloat64
	Bool          TBool
	List          TList
	ListLowercase TListLowercase
	Set           TSet
	Shlex         TShlex
	Duration      TDuration
	Umask         TUmask
	Size          TSize
	FileMode      TFileMode
	Tristate      TTristate
)
View Source
var (
	User  TUser
	Group TGroup
)

Functions

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

func ReadFile

func ReadFile(fs embed.FS, s string) string

Types

type TBool

type TBool string

func (TBool) Convert

func (t TBool) Convert(s string) (interface{}, error)

func (TBool) String

func (t TBool) String() string

type TDuration

type TDuration string

func (TDuration) Convert

func (t TDuration) Convert(s string) (interface{}, error)

Convert converts duration string to *time.Duration

nil is returned when duration is unset Default unit is second when not specified

func (TDuration) String

func (t TDuration) String() string

type TFileMode

type TFileMode string

func (TFileMode) Convert

func (t TFileMode) Convert(s string) (interface{}, error)

func (TFileMode) String

func (t TFileMode) String() string

type TFloat64

type TFloat64 string

func (TFloat64) Convert

func (t TFloat64) Convert(s string) (interface{}, error)

func (TFloat64) String

func (t TFloat64) String() string

type TGroup

type TGroup string

func (TGroup) Convert

func (t TGroup) Convert(s string) (interface{}, error)

func (TGroup) String

func (t TGroup) String() string

type TInt

type TInt string

func (TInt) Convert

func (t TInt) Convert(s string) (interface{}, error)

func (TInt) String

func (t TInt) String() string

type TInt64

type TInt64 string

func (TInt64) Convert

func (t TInt64) Convert(s string) (interface{}, error)

func (TInt64) String

func (t TInt64) String() string

type TList

type TList string

func (TList) Convert

func (t TList) Convert(s string) (interface{}, error)

func (TList) String

func (t TList) String() string

type TListLowercase

type TListLowercase string

func (TListLowercase) Convert

func (t TListLowercase) Convert(s string) (interface{}, error)

func (TListLowercase) String

func (t TListLowercase) String() string

type TSet

type TSet string

func (TSet) Convert

func (t TSet) Convert(s string) (interface{}, error)

func (TSet) String

func (t TSet) String() string

type TShlex

type TShlex string

func (TShlex) Convert

func (t TShlex) Convert(s string) (interface{}, error)

func (TShlex) String

func (t TShlex) String() string

type TSize

type TSize string

func (TSize) Convert

func (t TSize) Convert(s string) (interface{}, error)

func (TSize) String

func (t TSize) String() string

type TString

type TString string

func (TString) Convert

func (t TString) Convert(s string) (interface{}, error)

func (TString) String

func (t TString) String() string

type TTristate

type TTristate string

func (TTristate) Convert

func (t TTristate) Convert(s string) (interface{}, error)

func (TTristate) String

func (t TTristate) String() string

type TUmask

type TUmask string

func (TUmask) Convert

func (t TUmask) Convert(s string) (interface{}, error)

func (TUmask) String

func (t TUmask) String() string

type TUser

type TUser string

func (TUser) Convert

func (t TUser) Convert(s string) (interface{}, error)

func (TUser) String

func (t TUser) String() string

Jump to

Keyboard shortcuts

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