tools

package
v0.0.2-testing Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debounce

func Debounce(interval time.Duration, maxDebounce int, input <-chan interface{}, f func(arg interface{}))

Debounce (inspired from https://nathanleclaire.com/blog/2014/08/03/write-a-function-similar-to-underscore-dot-jss-debounce-in-golang/)

func FileSize

func FileSize(s int64) string

FileSize calculates the file size and generate user-friendly string. (sources from gogs project)

func MergeChan

func MergeChan(cs ...<-chan interface{}) <-chan interface{}

MergeChan merge chan (code from Go documentatio) TODO maybe replace by https://godoc.org/github.com/eapache/channels#Multiplex

func Min

func Min(A, B int) int

Min tools minimum of int

func SetupLogger

func SetupLogger(cmd *cobra.Command, args []string)

SetupLogger parse cmd for log level

func SizeOfJSON

func SizeOfJSON(data map[string]interface{}) int

SizeOfJSON cumpotue size on a map object

func SortedKeys

func SortedKeys(m map[string]interface{}) []string

SortedKeys tools sort map[string]

func TypeOrEnv

func TypeOrEnv(cmd *cobra.Command, flag, envname string) string

TypeOrEnv parse cmd to file with env vars

Types

type ByCID

type ByCID []docker.APIContainers

ByCID sort class

func (ByCID) Len

func (b ByCID) Len() int

func (ByCID) Less

func (b ByCID) Less(i, j int) bool

func (ByCID) Swap

func (b ByCID) Swap(i, j int)

type ByIID

type ByIID []docker.APIImages

ByIID sort class

func (ByIID) Len

func (b ByIID) Len() int

func (ByIID) Less

func (b ByIID) Less(i, j int) bool

func (ByIID) Swap

func (b ByIID) Swap(i, j int)

type ByMount

type ByMount []docker.APIMount

ByMount sort class

func (ByMount) Len

func (b ByMount) Len() int

func (ByMount) Less

func (b ByMount) Less(i, j int) bool

func (ByMount) Swap

func (b ByMount) Swap(i, j int)

type ByNID

type ByNID []docker.Network

ByNID sort class

func (ByNID) Len

func (b ByNID) Len() int

func (ByNID) Less

func (b ByNID) Less(i, j int) bool

func (ByNID) Swap

func (b ByNID) Swap(i, j int)

type ByPeer

type ByPeer []swarm.Peer

ByPeer sort class

func (ByPeer) Len

func (b ByPeer) Len() int

func (ByPeer) Less

func (b ByPeer) Less(i, j int) bool

func (ByPeer) Swap

func (b ByPeer) Swap(i, j int)

type ByPort

type ByPort []docker.APIPort

ByPort sort class

func (ByPort) Len

func (b ByPort) Len() int

func (ByPort) Less

func (b ByPort) Less(i, j int) bool

func (ByPort) Swap

func (b ByPort) Swap(i, j int)

type ByVName

type ByVName []docker.Volume

ByVName sort class

func (ByVName) Len

func (b ByVName) Len() int

func (ByVName) Less

func (b ByVName) Less(i, j int) bool

func (ByVName) Swap

func (b ByVName) Swap(i, j int)

Jump to

Keyboard shortcuts

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