Documentation ¶
Index ¶
Constants ¶
View Source
const ( PatchOperationAdd = "add" PatchOperationRemove = "remove" PatchOperationReplace = "replace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PatchOperation ¶
type PatchOperation string
type PatchRequest ¶
type PatchRequest[T any] struct { Operation PatchOperation `json:"op" validate:"required,oneof=remove replace"` // TODO implements add Path string `json:"path" validate:"required,jsonpath,ne=$"` Value any `json:"value"` }
func (*PatchRequest[T]) Apply ¶
func (pr *PatchRequest[T]) Apply(initialResource *T, emptyResource *T) (*T, error)
Apply TODO
type PatchRequests ¶
type PatchRequests[T any] struct { Patches []*PatchRequest[T] `json:"patches" validate:"required,min=1,dive,required"` }
func (*PatchRequests[T]) Apply ¶
func (prs *PatchRequests[T]) Apply(initialResource *T, newer func() *T) (*T, error)
Apply TODO
Click to show internal directories.
Click to hide internal directories.