| 1 | // Copyright 2019 The Kubernetes Authors. |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | // Package kio contains libraries for reading and writing collections of Resources. |
| 5 | // |
| 6 | // Reading Resources |
| 7 | // |
| 8 | // Resources are Read using a kio.Reader function. Examples: |
| 9 | // [kio.LocalPackageReader{}, kio.ByteReader{}] |
| 10 | // |
| 11 | // Resources read using a LocalPackageReader will have annotations applied so they can be |
| 12 | // written back to the files they were read from. |
| 13 | // |
| 14 | // Modifying Resources |
| 15 | // |
| 16 | // Resources are modified using a kio.Filter. The kio.Filter accepts a collection of |
| 17 | // Resources as input, and returns a new collection as output. |
| 18 | // It is recommended to use the yaml package for manipulating individual Resources in |
| 19 | // the collection. |
| 20 | // |
| 21 | // Writing Resources |
| 22 | // |
| 23 | // Resources are Read using a kio.Reader function. Examples: |
| 24 | // [kio.LocalPackageWriter{}, kio.ByteWriter{}] |
| 25 | // |
| 26 | // ReadWriters |
| 27 | // |
| 28 | // It is preferred to use a ReadWriter when reading and writing from / to the same source. |
| 29 | // |
| 30 | // Building Pipelines |
| 31 | // |
| 32 | // The preferred way to transforms a collection of Resources is to use kio.Pipeline to Read, |
| 33 | // Modify and Write the collection of Resources. Pipeline will automatically sequentially |
| 34 | // invoke the Read, Modify, Write steps, returning and error immediately on any failure. |
| 35 | package kio |