Add comments to most exported functions/types

This commit is contained in:
Yann Hamon 2020-11-08 22:35:17 +01:00
parent f78b65b025
commit 4b16128b75
6 changed files with 20 additions and 4 deletions

View file

@ -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

View file

@ -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)