Documentation ¶
Index ¶
- func Decode(input map[string]interface{}, obj interface{}) error
- func DecodeString(input string, obj interface{}) error
- func Encode(obj interface{}) (map[string]interface{}, error)
- func GetKey(input map[string]interface{}, key string) (interface{}, bool)
- func MapToSpec(m map[string]interface{}) *proto.Spec
- func ReadByTag(obj interface{}, target string) []string
- func ValidateRequired(input map[string]interface{}, obj interface{}) error
- type Array
- type Diff
- type DiffField
- type Field
- type Map
- type Record
- type ResourceData
- type ScalarType
- type Schema
- type Schema2
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeString ¶
DecodeString decodes a string into an object
func ValidateRequired ¶ added in v0.1.2
Types ¶
type Field ¶
type Field struct { Type Type // Computed describes whether the field is a status Computed bool // Required specifies if the field is required Required bool // ForceNew describes whether a change in the field requires delete the old one ForceNew bool // Default value for the field Default string }
Field is a field in a record
type Record ¶
Record is an object with several values
func (*Record) OpenAPIV3 ¶
func (s *Record) OpenAPIV3() interface{}
OpenAPIV3 returns the OpenApi v3 representation of the schema
func (*Record) OpenAPIV3JSON ¶
OpenAPIV3JSON creates the OpenAPIv3 spec for the Schema in JSON format
func (*Record) OpenAPIV3Yaml ¶
OpenAPIV3Yaml creates the OpenAPIv3 spec for the Schema in YAML format
type ResourceData ¶ added in v0.1.3
type ResourceData struct {
// contains filtered or unexported fields
}
func NewResourceData ¶ added in v0.1.3
func NewResourceData(sch *Schema2, data *proto.Spec) *ResourceData
func (*ResourceData) Decode ¶ added in v0.1.3
func (r *ResourceData) Decode(obj interface{}) error
func (*ResourceData) Get ¶ added in v0.1.3
func (r *ResourceData) Get(k string) interface{}
func (*ResourceData) GetOK ¶ added in v0.1.3
func (r *ResourceData) GetOK(k string) (interface{}, bool)
type ScalarType ¶
type ScalarType int
ScalarType is a scalar type
const ( // TypeString is a string type TypeString ScalarType = iota // TypeInt is a int type TypeInt // TypeBool is a bool type TypeBool )
func (ScalarType) Kind ¶ added in v0.1.3
func (s ScalarType) Kind() reflect.Type
func (ScalarType) String ¶
func (i ScalarType) String() string
type Schema ¶
Schema is an OpenAPIv3 schema of a resource
func GenerateSchema ¶
GenerateSchema generates an OpenAPIv3 schema
Click to show internal directories.
Click to hide internal directories.