1# Utils 2 3[![Build Status]](https://travis-ci.org/kubernetes/utils) [![GoDoc](https://godoc.org/k8s.io/utils?status.svg)](https://godoc.org/k8s.io/utils) 4 5A set of Go libraries that provide low-level, 6kubernetes-independent packages supplementing the [Go 7standard libs]. 8 9## Purpose 10 11As Kubernetes grows and spins functionality out of its 12[core] and into cooperating repositories like 13[apiserver], [kubectl], [kubeadm], etc., the need 14arises for leaf repositories to house shared code and 15avoid cycles in repository relationships. 16 17This repository is intended to hold shared utilities 18with no Kubernetes dependence that may be of interest 19to any Go project. See these [instructions for moving] 20an existing package to this repository. 21 22 23## Criteria for adding code here 24 25- Used by multiple Kubernetes repositories. 26 27- Full unit test coverage. 28 29- Go tools compliant (`go get`, `go test`, etc.). 30 31- Complex enough to be worth vendoring, rather than copying. 32 33- Stable, or backward compatible, API. 34 35- _No dependence on any Kubernetes repository_. 36 37## Libraries 38 39- [Exec](/exec) provides an interface for `os/exec`. It makes it easier 40 to mock and replace in tests, especially with 41 the [FakeExec](exec/testing/fake_exec.go) struct. 42 43- [Temp](/temp) provides an interface to create temporary directories. It also 44 provides a [FakeDir](temp/temptest) implementation to replace in tests. 45 46- [Clock](/clock) provides an interface for time-based operations. It allows 47 mocking time for testing. 48 49- [Pointer](/pointer) provides some functions for pointer-based operations. 50 51- [Io](/io) provides interfaces for working with file IO. Currently it provides 52 functionality for consistently reading a file. 53 54- [NSEnter](/nsenter) provides interfaces for executing and interacting with 55 processes running within a namespace. 56 57[Build Status]: https://travis-ci.org/kubernetes/utils.svg?branch=master 58[Go standard libs]: https://golang.org/pkg/#stdlib 59[api]: https://github.com/kubernetes/api 60[apiserver]: https://github.com/kubernetes/apiserver 61[core]: https://github.com/kubernetes/kubernetes 62[ingress]: https://github.com/kubernetes/ingress 63[kubeadm]: https://github.com/kubernetes/kubeadm 64[kubectl]: https://github.com/kubernetes/kubectl 65[instructions for moving]: ./HOWTOMOVE.md 66 67## Contributing 68 69Please see [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to contribute. 70