strconf

package
v0.0.0-...-7d92a45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeToString

func TypeToString(t Type) string

TypeToString returns the human readable type of a stringOrConfig type.

func Validate

func Validate(fldPath *field.Path, source *ConfigSource) field.ErrorList

Validate validates a testrun config element.

Types

type ConfigSource

type ConfigSource struct {
	// Selects a key of a ConfigMap.
	// +optional
	ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
	// Selects a key of a secret in the pod's namespace
	// +optional
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

ConfigSource represents a source for the value of a config element. +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func (*ConfigSource) DeepCopy

func (in *ConfigSource) DeepCopy() *ConfigSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSource.

func (*ConfigSource) DeepCopyInto

func (in *ConfigSource) DeepCopyInto(out *ConfigSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StringOrConfig

type StringOrConfig struct {
	Type      Type
	StrVal    string
	ConfigVal ConfigSource
}

StringOrConfig represents a type that could be from a string or a configuration +k8s:deepcopy-gen=true +k8s:openapi-gen=true

func FromConfig

func FromConfig(c ConfigSource) *StringOrConfig

FromConfig creates a StringOrConfoig from a ConfigSoource.

func FromString

func FromString(s string) *StringOrConfig

FromString creates a StringOrConfig from a string.

func (*StringOrConfig) Config

func (strsec *StringOrConfig) Config() *ConfigSource

Config returns the strconf as a Config struct

func (*StringOrConfig) DeepCopy

func (in *StringOrConfig) DeepCopy() *StringOrConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringOrConfig.

func (*StringOrConfig) DeepCopyInto

func (in *StringOrConfig) DeepCopyInto(out *StringOrConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StringOrConfig) MarshalJSON

func (strsec *StringOrConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

func (StringOrConfig) OpenAPISchemaFormat

func (_ StringOrConfig) OpenAPISchemaFormat() string

OpenAPISchemaFormat is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

func (StringOrConfig) OpenAPISchemaType

func (_ StringOrConfig) OpenAPISchemaType() []string

OpenAPISchemaType is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators

func (*StringOrConfig) String

func (strsec *StringOrConfig) String() string

String returns the strconf as a string value

func (*StringOrConfig) UnmarshalJSON

func (strsec *StringOrConfig) UnmarshalJSON(value []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

type Type

type Type int

Type represents the stored type of IntOrString.

const (
	String Type = iota // The IntOrString holds an int.
	Config             // The IntOrString holds a string.
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL