Header menu logo FSharp.ATProto

Did Module

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

Functions and values

Function or value Description

method arg1

Full Usage: method arg1

Parameters:
Returns: string The method string (e.g. "plc" or "web").

Extract the DID method from a validated DID.

arg0 : Did
Returns: string

The method string (e.g. "plc" or "web").

parse s

Full Usage: parse s

Parameters:
    s : string - A DID string in the format did:<method>:<method-specific-id> (e.g. "did:plc:z72i7hdynmk6r22z27h6tvur" or "did:web:example.com").

Returns: Result<Did, string> Ok with a validated Did, or Error with a message describing the validation failure. Validation failures include: null input, exceeding the 2048-character limit, invalid DID syntax, or invalid percent-encoding.

Parse and validate a DID string.

s : string

A DID string in the format did:<method>:<method-specific-id> (e.g. "did:plc:z72i7hdynmk6r22z27h6tvur" or "did:web:example.com").

Returns: Result<Did, string>

Ok with a validated Did, or Error with a message describing the validation failure. Validation failures include: null input, exceeding the 2048-character limit, invalid DID syntax, or invalid percent-encoding.

Example

 match Did.parse "did:plc:z72i7hdynmk6r22z27h6tvur" with
 | Ok did -> printfn "Valid: %s" (Did.value did)
 | Error e -> printfn "Invalid: %s" e
union case Result.Ok: ResultValue: 'T -> Result<'T,'TError>
val did: 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 DID string (e.g. "did:plc:z72i7hdynmk6r22z27h6tvur").

Extract the string representation of a DID.

arg0 : Did
Returns: string

The full DID string (e.g. "did:plc:z72i7hdynmk6r22z27h6tvur").

Type something to start searching.