Header menu logo FSharp.ATProto

Nsid Module

Functions for creating, validating, and extracting data from Nsid values.

Functions and values

Function or value Description

authority arg1

Full Usage: authority arg1

Parameters:
Returns: string The authority string (e.g. "app.bsky.feed" for NSID "app.bsky.feed.post").

Extract the authority (reversed domain name) portion of an NSID.

arg0 : Nsid
Returns: string

The authority string (e.g. "app.bsky.feed" for NSID "app.bsky.feed.post").

name arg1

Full Usage: name arg1

Parameters:
Returns: string The name string (e.g. "post" for NSID "app.bsky.feed.post").

Extract the name (final segment) of an NSID.

arg0 : Nsid
Returns: string

The name string (e.g. "post" for NSID "app.bsky.feed.post").

parse s

Full Usage: parse s

Parameters:
    s : string - An NSID string in the format domain.segments.name (e.g. "app.bsky.feed.post"). Must have at least three segments, where the final segment (name) starts with a letter and the preceding segments form a valid reversed domain authority.

Returns: Result<Nsid, string> Ok with a validated Nsid, or Error with a message describing the validation failure. Validation failures include: null input, exceeding the 317-character limit, or invalid NSID syntax.

Parse and validate an NSID string.

s : string

An NSID string in the format domain.segments.name (e.g. "app.bsky.feed.post"). Must have at least three segments, where the final segment (name) starts with a letter and the preceding segments form a valid reversed domain authority.

Returns: Result<Nsid, string>

Ok with a validated Nsid, or Error with a message describing the validation failure. Validation failures include: null input, exceeding the 317-character limit, or invalid NSID syntax.

Example

 match Nsid.parse "app.bsky.feed.post" with
 | Ok nsid -> printfn "Authority: %s, Name: %s" (Nsid.authority nsid) (Nsid.name nsid)
 | Error e -> printfn "Invalid: %s" e
union case Result.Ok: ResultValue: 'T -> Result<'T,'TError>
val nsid: obj
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
union case Result.Error: ErrorValue: 'TError -> Result<'T,'TError>
val e: string

value arg1

Full Usage: value arg1

Parameters:
Returns: string The full NSID string (e.g. "app.bsky.feed.post").

Extract the string representation of an NSID.

arg0 : Nsid
Returns: string

The full NSID string (e.g. "app.bsky.feed.post").

Type something to start searching.