Documentation
¶
Index ¶
- func StaticValue[Model any](v any) func(oldField Field)
- type ConcreteField
- func (s *ConcreteField[Model]) IsReadable() bool
- func (s *ConcreteField[Model]) IsWritable() bool
- func (s *ConcreteField[Model]) Name() string
- func (s *ConcreteField[Model]) ToInternalValue(reprModel map[string]any, ctx *gin.Context) (any, error)
- func (s *ConcreteField[Model]) ToRepresentation(intVal models.InternalValue, ctx *gin.Context) (any, error)
- func (s *ConcreteField[Model]) WithInternalValueFunc(f InternalValueFunc) Field
- func (s *ConcreteField[Model]) WithReadOnly() Field
- func (s *ConcreteField[Model]) WithReadWrite() Field
- func (s *ConcreteField[Model]) WithRepresentationFunc(f RepresentationFunc) Field
- func (s *ConcreteField[Model]) WithWriteOnly() Field
- type ErrorFieldIsNotPresentInPayload
- type Field
- type GRFParsable
- type GRFRepresentable
- type InternalValueFunc
- type RepresentationFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StaticValue ¶
Types ¶
type ConcreteField ¶ added in v1.1.0
type ConcreteField[Model any] struct { Readable bool Writable bool // contains filtered or unexported fields }
func (*ConcreteField[Model]) IsReadable ¶ added in v1.1.0
func (s *ConcreteField[Model]) IsReadable() bool
func (*ConcreteField[Model]) IsWritable ¶ added in v1.1.0
func (s *ConcreteField[Model]) IsWritable() bool
func (*ConcreteField[Model]) Name ¶ added in v1.1.0
func (s *ConcreteField[Model]) Name() string
func (*ConcreteField[Model]) ToInternalValue ¶ added in v1.1.0
func (*ConcreteField[Model]) ToRepresentation ¶ added in v1.1.0
func (s *ConcreteField[Model]) ToRepresentation(intVal models.InternalValue, ctx *gin.Context) (any, error)
func (*ConcreteField[Model]) WithInternalValueFunc ¶ added in v1.1.0
func (s *ConcreteField[Model]) WithInternalValueFunc(f InternalValueFunc) Field
func (*ConcreteField[Model]) WithReadOnly ¶ added in v1.1.0
func (s *ConcreteField[Model]) WithReadOnly() Field
func (*ConcreteField[Model]) WithReadWrite ¶ added in v1.1.0
func (s *ConcreteField[Model]) WithReadWrite() Field
func (*ConcreteField[Model]) WithRepresentationFunc ¶ added in v1.1.0
func (s *ConcreteField[Model]) WithRepresentationFunc(f RepresentationFunc) Field
func (*ConcreteField[Model]) WithWriteOnly ¶ added in v1.1.0
func (s *ConcreteField[Model]) WithWriteOnly() Field
type ErrorFieldIsNotPresentInPayload ¶
type ErrorFieldIsNotPresentInPayload struct {
// contains filtered or unexported fields
}
func NewErrorFieldIsNotPresentInPayload ¶
func NewErrorFieldIsNotPresentInPayload(name string) ErrorFieldIsNotPresentInPayload
func (ErrorFieldIsNotPresentInPayload) Error ¶
func (e ErrorFieldIsNotPresentInPayload) Error() string
type Field ¶
type Field interface { Name() string ToRepresentation(models.InternalValue, *gin.Context) (any, error) ToInternalValue(map[string]any, *gin.Context) (any, error) IsReadable() bool IsWritable() bool WithReadOnly() Field WithWriteOnly() Field WithReadWrite() Field WithRepresentationFunc(RepresentationFunc) Field WithInternalValueFunc(InternalValueFunc) Field }
type GRFParsable ¶
type GRFRepresentable ¶
type InternalValueFunc ¶
type RepresentationFunc ¶
Click to show internal directories.
Click to hide internal directories.