Documentation
¶
Index ¶
- type Fields
- func (f Fields) AllFields() []*field.Field
- func (f Fields) AllNames() []string
- func (f Fields) AreNested() (parentObjectName string, areNested bool)
- func (f Fields) GetJsonPropertyNameFromName(name string) (jsonPropertyName string, found bool)
- func (f Fields) SetFieldJsonPropertyName(name string, jsonPropertyName string) error
- func (f Fields) SetVisible(fieldNames []string) error
- func (f Fields) ShowAll()
- func (f Fields) VisibleFields() []*field.Field
- func (f Fields) VisibleFieldsJsonPropertyNames() []string
- func (f Fields) VisibleNames() []string
- func (f Fields) VisibleSize() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fields ¶
type Fields struct {
// contains filtered or unexported fields
}
Table fields
func New ¶
Create new Fields struct Exits with error code if fields don't respect the following requirements: - fields must be unique within a table - names must be less than 20 characters - names must contain only uppercase letters and hyphens - names must not start or end with a hyphen
func (Fields) AreNested ¶
Returns whether the fields belong to a nested structure and the parent object's name
func (Fields) GetJsonPropertyNameFromName ¶
Get JSON property name of field with the given name Returns the property name and a boolean to indicate whether the field was found
func (Fields) SetFieldJsonPropertyName ¶
Modify the JSON property name of the field with the given name If no field is found with the given name, returns an error
func (Fields) SetVisible ¶
Override the default visibility settings and display only the given fields
func (Fields) VisibleFieldsJsonPropertyNames ¶
Get the list of JSON property names of the visible fields
func (Fields) VisibleNames ¶
Get the list of names of the visible fields