// GetMethodMetadata retrieves method metadata from document metadata.
GetMethodMetadata retrieves method metadata from document metadata.
// GetMethodMetadata retrieves method metadata from document metadata .
func GetMethodMetadata(metadata document.Metadata) (map[string]interface{}, error) {
	if metadata == nil {
		return nil, fmt.Errorf("missing document metadata")
	}
	methodMetadataObj, ok := metadata[document.MethodProperty]
	if !ok {
		return nil, fmt.Errorf("missing method metadata")
	}
	switch val := methodMetadataObj.(type) {
	case document.Metadata:
		return val, nil
	case map[string]interface{}:
		return val, nil
	default:
		return nil, fmt.Errorf("method metadata is wrong type[%T]", methodMetadataObj)
	}
}
func GetMethodMetadata ( metadata document . Metadata ) ( map [ string ] interface { } , error ) { if metadata == nil { return nil , fmt . Errorf ( " " ) } methodMetadataObj , ok := metadata [ document . MethodProperty ] if ! ok { return nil , fmt . Errorf ( " " ) } switch val := methodMetadataObj . ( type ) { case document . Metadata : return val , nil case map [ string ] interface { } : return val , nil default : return nil , fmt . Errorf ( " " , methodMetadataObj ) } }
GetMethodMetadata retrieves method metadata from document metadata.
GetMethodMetadata retrieves method metadata from document metadata .