Documentation ¶
Index ¶
- type Action
- type Key
- type Patch
- func FromBytes(data []byte) (Patch, error)
- func NewAddPublicKeysPatch(publicKeys string) (Patch, error)
- func NewAddServiceEndpointsPatch(serviceEndpoints string) (Patch, error)
- func NewJSONPatch(patches string) (Patch, error)
- func NewRemovePublicKeysPatch(publicKeyIds string) (Patch, error)
- func NewRemoveServiceEndpointsPatch(serviceEndpointIds string) (Patch, error)
- func PatchesFromDocument(doc string) ([]Patch, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action defines action of document patch
const ( // AddPublicKeys captures enum value "add-public-keys" AddPublicKeys Action = "add-public-keys" // RemovePublicKeys captures enum value "remove-public-keys" RemovePublicKeys Action = "remove-public-keys" //AddServiceEndpoints captures "add-service-endpoints" AddServiceEndpoints Action = "add-service-endpoints" //RemoveServiceEndpoints captures "remove-service-endpoints" RemoveServiceEndpoints Action = "remove-service-endpoints" // JSONPatch captures enum value "json-patch" JSONPatch Action = "ietf-json-patch" )
type Key ¶
type Key string
Key defines key that will be used to get document patch information
const ( // DocumentKey captures "document" key DocumentKey Key = "document" // PatchesKey captures "patches" key PatchesKey Key = "patches" // PublicKeys captures "public_keys" key PublicKeys Key = "public_keys" //ServiceEndpointsKey captures "service_endpoints" key ServiceEndpointsKey Key = "service_endpoints" //ServiceEndpointIdsKey captures "ids" key ServiceEndpointIdsKey Key = "ids" // ActionKey captures "action" key ActionKey Key = "action" )
type Patch ¶
type Patch map[Key]interface{}
Patch defines generic patch structure
func NewAddPublicKeysPatch ¶
NewAddPublicKeysPatch creates new patch for adding public keys
func NewAddServiceEndpointsPatch ¶
NewAddServiceEndpointsPatch creates new patch for adding service endpoints
func NewJSONPatch ¶
NewJSONPatch creates new generic update patch (will be used for generic updates)
func NewRemovePublicKeysPatch ¶
NewRemovePublicKeysPatch creates new patch for removing public keys
func NewRemoveServiceEndpointsPatch ¶
NewRemoveServiceEndpointsPatch creates new patch for removing service endpoints
func PatchesFromDocument ¶
PatchesFromDocument creates patches from opaque document
func (Patch) GetAction ¶
GetAction returns string value for specified key or "" if not found or wrong type
func (Patch) JSONLdObject ¶
JSONLdObject returns map that represents JSON LD Object