mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-21 19:19:52 +00:00
Add comments to most exported functions/types
This commit is contained in:
parent
f78b65b025
commit
4b16128b75
6 changed files with 20 additions and 4 deletions
|
|
@ -4,16 +4,19 @@ import (
|
|||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
// Resource represents a Kubernetes resource within a file
|
||||
type Resource struct {
|
||||
Path string
|
||||
Bytes []byte
|
||||
sig *Signature
|
||||
}
|
||||
|
||||
// Signature is a key representing a Kubernetes resource
|
||||
type Signature struct {
|
||||
Kind, Version, Namespace, Name string
|
||||
}
|
||||
|
||||
// Signature computes a signature for a resource, based on its Kind, Version, Namespace & Name
|
||||
func (res *Resource) Signature() (*Signature, error) {
|
||||
if res.sig != nil {
|
||||
return res.sig, nil
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"io/ioutil"
|
||||
)
|
||||
|
||||
// FromStream reads resources from a byte stream, usually here stdin
|
||||
func FromStream(ctx context.Context, path string, r io.Reader) (<-chan Resource, <-chan error) {
|
||||
resources := make(chan Resource)
|
||||
errors := make(chan error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue