Debian Codegraph @

goyaml.v3/README.md

raw
1 # goyaml.v3
2
3 This package provides type and function aliases for the `go.yaml.in/yaml/v3` package (which is compatible with `gopkg.in/yaml.v3`).
4
5 ## Purpose
6
7 The purpose of this package is to:
8
9 1. Provide a transition path for users migrating from the sigs.k8s.io/yaml package to direct usage of go.yaml.in/yaml/v3
10 2. Maintain compatibility with existing code while encouraging migration to the upstream package
11 3. Reduce maintenance overhead by delegating to the upstream implementation
12
13 ## Usage
14
15 Instead of importing this package directly, you should migrate to using `go.yaml.in/yaml/v3` directly:
16
17 ```go
18 // Old way
19 import "sigs.k8s.io/yaml/goyaml.v3"
20
21 // Recommended way
22 import "go.yaml.in/yaml/v3"
23 ```
24
25 ## Available Types and Functions
26
27 All public types and functions from `go.yaml.in/yaml/v3` are available through this package:
28
29 ### Types
30
31 - `Unmarshaler` - Interface for custom unmarshaling behavior
32 - `Marshaler` - Interface for custom marshaling behavior
33 - `IsZeroer` - Interface to check if an object is zero
34 - `Decoder` - Reads and decodes YAML values from an input stream
35 - `Encoder` - Writes YAML values to an output stream
36 - `TypeError` - Error returned by Unmarshal for decoding issues
37 - `Node` - Represents a YAML node in the document
38 - `Kind` - Represents the kind of a YAML node
39 - `Style` - Represents the style of a YAML node
40
41 ### Functions
42
43 - `Unmarshal` - Decodes YAML data into a Go value
44 - `Marshal` - Serializes a Go value into YAML
45 - `NewDecoder` - Creates a new Decoder
46 - `NewEncoder` - Creates a new Encoder
47
48 ## Migration Guide
49
50 To migrate from this package to `go.yaml.in/yaml/v3`:
51
52 1. Update your import statements:
53 ```go
54 // From
55 import "sigs.k8s.io/yaml/goyaml.v3"
56
57 // To
58 import "go.yaml.in/yaml/v3"
59 ```
60
61 2. No code changes should be necessary as the API is identical
62
63 3. Update your go.mod file to include the dependency:
64 ```
65 require go.yaml.in/yaml/v3 v3.0.3
66 ```
67
68 ## Deprecation Notice
69
70 All types and functions in this package are marked as deprecated. You should migrate to using `go.yaml.in/yaml/v3` directly.