Documentation
¶
Index ¶
- func MaskMapPaths(m hexa.Map, mask *FieldMask, depth int)
- type FieldMask
- func (fm *FieldMask) IsMasked(i any) bool
- func (fm *FieldMask) MarshalJSON() ([]byte, error)
- func (fm *FieldMask) Mask(s any)
- func (fm *FieldMask) PathIsMasked(path string) bool
- func (fm *FieldMask) SetPaths(paths []string)
- func (fm *FieldMask) String() string
- func (fm *FieldMask) UnmarshalJSON(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldMask ¶
type FieldMask struct {
// contains filtered or unexported fields
}
FieldMask mask keep list of masked paths of a struct|map|... and then you can check whether a path|struct field is masked or not. Use it to detect which fields provided by a user in a PATCH request. Note: you can specify mask path of each field of a struct by set the "mask" tag, otherwise it check the "json" tag.
func (*FieldMask) IsMasked ¶
IsMasked gets a struct field and specifies whether that field is masked or not. before call to this method you must call to the Mask() method to mask a struct. Note: provided value must be pointer to the value. even if the field is a pointer, you must provide pointer to that pointer field.
func (*FieldMask) MarshalJSON ¶
func (*FieldMask) Mask ¶
Mask masks a struct's fields and then you can check to detect whether a field of that struct is masked or not. Note: provided value must be pointer to a struct.
func (*FieldMask) PathIsMasked ¶
PathIsMasked tel you whether the provided path is masked or not.