Documentation ¶
Index ¶
- Variables
- func CreateSecretFromTemplate(templateName, secretTemplate string, option string, ...) (*corev1.Secret, error)
- func GetSecretDataForTemplate(Credential map[string]interface{}, instance map[string]string) map[string]interface{}
- func ParseTemplate(templateName, text string) (*template.Template, error)
- type LimitedWriter
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLimitExceeded is the error returned when a limit was exceeded. // Callers will test for ErrLimitExceeded using ==. ErrLimitExceeded = errors.New("limit exceeded") )
Functions ¶
func CreateSecretFromTemplate ¶
func CreateSecretFromTemplate(templateName, secretTemplate string, option string, data map[string]interface{}) (*corev1.Secret, error)
CreateSecretFromTemplate executes the template to create a secret objects, validates and returns it The template needs to be a v1 Secret and in metadata labels and annotations are allowed only Set templateOptions of the "text/template" package to specify the template behavior
Types ¶
type LimitedWriter ¶
type LimitedWriter struct { W io.Writer // underlying writer N int64 // max bytes remaining Converter func(err error) error }
A LimitedWriter writes to W but limits the amount of data that can be written to just N bytes. Each call to Write immediately returns ErrLimitExceeded if N <= 0. Otherwise Write writes max N bytes to W and updates N to reflect the new amount remaining. If the number of byte to be written is greater than N, ErrLimitExceeded is returned. Any error from W is returned to the caller of Write, i.e. they have precedence over ErrLimitExceeded.