Documentation ¶
Overview ¶
Package types provides a collection of Golang types with JSON marshaling support
Index ¶
- type ArrayOrInt
- type ArrayOrString
- type BoolYo
- type IntHash
- func (m *IntHash) DeepCopy() *IntHash
- func (m *IntHash) DeepCopyInto(out *IntHash)
- func (m *IntHash) Equal(u *IntHash) bool
- func (m IntHash) Generation() int64
- func (m IntHash) Hash() string
- func (m *IntHash) IsZero() bool
- func (m *IntHash) MarshalJSON() ([]byte, error)
- func (m IntHash) MarshalQueryParameter() (string, error)
- func (m *IntHash) MatchGeneration(u *IntHash) bool
- func (_ IntHash) OpenAPISchemaFormat() string
- func (_ IntHash) OpenAPISchemaType() []string
- func (m IntHash) String() string
- func (m *IntHash) UnmarshalJSON(data []byte) error
- type StrToBool
- type StrYo
- type URLMap
- type URLSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayOrInt ¶
type ArrayOrInt []int
GO => Json [] => `[]` [1] => `1`
[1, 2] => `[1,2]`
func (*ArrayOrInt) MarshalJSON ¶
func (m *ArrayOrInt) MarshalJSON() ([]byte, error)
func (*ArrayOrInt) UnmarshalJSON ¶
func (m *ArrayOrInt) UnmarshalJSON(data []byte) error
type ArrayOrString ¶
type ArrayOrString []string
GO => Json [] => `[]` ["a"] => `"a"`
["a", "b"] => `["a","b"]`
func (*ArrayOrString) MarshalJSON ¶
func (m *ArrayOrString) MarshalJSON() ([]byte, error)
func (*ArrayOrString) UnmarshalJSON ¶
func (m *ArrayOrString) UnmarshalJSON(data []byte) error
type IntHash ¶
type IntHash struct {
// contains filtered or unexported fields
}
IntHash represents as int64 Generation and string Hash. It is json serialized into <int64>$<hash_string>.
+k8s:openapi-gen=true
func IntHashForGeneration ¶
func IntHashForHash ¶
func NewIntHash ¶
func ParseIntHash ¶
func (*IntHash) DeepCopyInto ¶
func (IntHash) Generation ¶
func (*IntHash) MarshalJSON ¶
func (IntHash) MarshalQueryParameter ¶
MarshalQueryParameter converts to a URL query parameter value
func (*IntHash) MatchGeneration ¶
func (IntHash) OpenAPISchemaFormat ¶
OpenAPISchemaFormat is used by the kube-openapi generator when constructing the OpenAPI spec of this type.
func (IntHash) OpenAPISchemaType ¶
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 (*IntHash) UnmarshalJSON ¶
type StrToBool ¶
type StrToBool bool
StrToBool turns strings into bool when marshaled to Json. Empty strings are converted to false. Non-empty string, eg, `"false"` will become True bool value. If already a json bool, then no change is made.
This can be used to turn a string to bool if you have existing Json data.
func (*StrToBool) MarshalJSON ¶
func (*StrToBool) UnmarshalJSON ¶
type StrYo ¶
type StrYo string
StrYo turns non-strings into into a string by adding quotes around it into bool, when marshaled to Json. If input is already string, no change is done.