Skip to content

Commit

Permalink
docs(vrl): Add parse_cbor vrl function documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MiracleWisp authored and Semyon Uchvatov committed Jan 9, 2025
1 parent 029a2ff commit f26b633
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bytesize
califrag
califragilistic
CAROOT
CBOR
cbor
cddl
cdylib
cef
Expand Down
36 changes: 36 additions & 0 deletions website/cue/reference/remap/functions/parse_cbor.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package metadata

remap: functions: parse_cbor: {
category: "Parse"
description: """
Parses the `value` as [CBOR](\(urls.cbor)).
"""
notices: [
"""
Only CBOR types are returned.
""",
]

arguments: [
{
name: "value"
description: "The CBOR payload to parse."
required: true
type: ["string"]
},
]
internal_failure_reasons: [
"`value` is not a valid CBOR-formatted payload.",
]
return: types: ["boolean", "integer", "float", "string", "object", "array", "null"]

examples: [
{
title: "Parse CBOR"
source: #"""
parse_cbor!(decode_base64!("oWVmaWVsZGV2YWx1ZQ=="))
"""#
return: field: "value"
},
]
}
1 change: 1 addition & 0 deletions website/cue/reference/urls.cue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ urls: {
bind_dnstap: "https://kb.isc.org/docs/aa-01342"
b_tree_map: "https://doc.rust-lang.org/std/collections/struct.BTreeMap.html"
cargo_audit: "\(github)/RustSec/cargo-audit"
cbor: "https://cbor.io"
centos: "https://www.centos.org/"
chrono_time_formats: "https://docs.rs/chrono/latest/chrono/format/strftime/index.html#specifiers"
cgroups_limit_resources: "https://the.binbashtheory.com/control-resources-cgroups/"
Expand Down

0 comments on commit f26b633

Please sign in to comment.