Documentation ¶
Index ¶
- type Action
- type Key
- type Patch
- func FromBytes(data []byte) (Patch, error)
- func NewAddAlsoKnownAs(uris string) (Patch, error)
- func NewAddPublicKeysPatch(publicKeys string) (Patch, error)
- func NewAddServiceEndpointsPatch(serviceEndpoints string) (Patch, error)
- func NewJSONPatch(patches string) (Patch, error)
- func NewRemoveAlsoKnownAs(uris string) (Patch, error)
- func NewRemovePublicKeysPatch(publicKeyIds string) (Patch, error)
- func NewRemoveServiceEndpointsPatch(serviceEndpointIds string) (Patch, error)
- func NewReplacePatch(doc 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 ( // Replace captures enum value "replace". Replace Action = "replace" // 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-services". AddServiceEndpoints Action = "add-services" // RemoveServiceEndpoints captures "remove-services". RemoveServiceEndpoints Action = "remove-services" // JSONPatch captures enum value "json-patch". JSONPatch Action = "ietf-json-patch" // AddAlsoKnownAs captures "add-also-known-as". AddAlsoKnownAs Action = "add-also-known-as" // RemoveAlsoKnownAs captures "remove-also-known-as". RemoveAlsoKnownAs Action = "remove-also-known-as" )
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 "publicKeys" key. PublicKeys Key = "publicKeys" // ServicesKey captures "services" key. ServicesKey Key = "services" // IdsKey captures "ids" key. IdsKey Key = "ids" // ActionKey captures "action" key. ActionKey Key = "action" // UrisKey captures "uris" key. UrisKey Key = "uris" )
type Patch ¶
type Patch map[Key]interface{}
Patch defines generic patch structure.
func NewAddAlsoKnownAs ¶ added in v1.0.0
NewAddAlsoKnownAs creates new patch for adding also-known-as property.
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 NewRemoveAlsoKnownAs ¶ added in v1.0.0
NewRemoveAlsoKnownAs creates new patch for removing also-known-as URI.
func NewRemovePublicKeysPatch ¶
NewRemovePublicKeysPatch creates new patch for removing public keys.
func NewRemoveServiceEndpointsPatch ¶
NewRemoveServiceEndpointsPatch creates new patch for removing service endpoints.
func NewReplacePatch ¶ added in v0.1.4
NewReplacePatch creates new replace patch.
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.