Documentation
¶
Index ¶
- Constants
- Variables
- func CamelCase(in string) (out string)
- func Env(name string, ptr interface{}, tag string, def interface{}, usage string)
- func Eval(in interface{}, fnc func(*TaggedValue) error) (err error)
- func Exec(cmd string) (out []byte, err error)
- func Id0Hash() string
- func IsFile(path string, in ...int) (ok bool)
- func MacAddr() (addr string)
- func MacHash() string
- func NewWorkPool(options ...Options) *workPool
- func PlatformVersion() (out string)
- func UnderScore(in string) string
- func Units(in interface{}) string
- func YamlRead(path string, in interface{}) error
- func YamlWrite(path string, in interface{}) error
- type BsonTag
- type Collection
- type Fifo
- type Host
- type JsonTag
- type KeyRef
- type LoadAvg
- type Md5Sum
- type Node
- type Option
- type Options
- type PoolWorker
- type Queue
- type Range
- type RangeRequest
- type RangeResponse
- type Set
- type Sha1Sum
- type Span
- type SqlTag
- type Stack
- type Tag
- type TagMap
- type TagOption
- type TaggedValue
- type Template
- type Timer
- type Value
- type Values
- type WorkPool
Constants ¶
const PlatformTag = "lnx"
Variables ¶
var (
ErrNoTimer = errors.New("Timer is nil")
)
Functions ¶
func Env ¶
Env works similar to 'flag', but overrides the default value with env variable (name) if present.
TODO: So far, we only care about bool, int and string. float64 and 'big-ints' not currently implemented.
func Eval ¶
func Eval(in interface{}, fnc func(*TaggedValue) error) (err error)
func Id0Hash ¶
func Id0Hash() string
Id0Hash attempts to get the first available UUID from /dev/disk/by-uuid. If this fails, use MacAddr() as input. Returns an MD5 hash of either result.
func IsFile ¶
IsFile checks if file (path) exists, and is a Regular file. Will recurse on symlinks to a max depth of 10
func MacAddr ¶
func MacAddr() (addr string)
MacAddr gets the MAC hardware address of 1st (non-loopback) interface the host machine
func NewWorkPool ¶
func NewWorkPool(options ...Options) *workPool
NewWorkPool instantiates and returns a WorkPool with (optional) parameters
func PlatformVersion ¶
func PlatformVersion() (out string)
func UnderScore ¶
Types ¶
type Collection ¶
type Collection interface { Add(...interface{}) Remove(...interface{}) Has(...interface{}) List([]interface{}) Reset() Size() int }
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a basic FIFO queue based on a circular list that resizes as needed.
type RangeRequest ¶
type RangeRequest struct {
// contains filtered or unexported fields
}
func (*RangeRequest) String ¶
func (r *RangeRequest) String() (rs string)
type RangeResponse ¶
type RangeResponse struct {
// contains filtered or unexported fields
}
func (*RangeResponse) String ¶
func (r *RangeResponse) String() (rs string)
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack is a basic LIFO stack that resizes as needed.
type Tag ¶
type Tag interface { Name() string Convert() bool Ignore() bool Null() bool Key() bool Primary() bool Ref() *KeyRef }
func TagOf ¶
func TagOf(f reflect.StructField) (out Tag)
type TaggedValue ¶
type TaggedValue struct { Value T Tag F reflect.StructField A interface{} }
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
type WorkPool ¶
type WorkPool interface {
Submit(w PoolWorker) error
}
WorkPool holds the Queue and Worker channels