View Source erldns_zone_encoder (erldns v4.2.0)
A process that maintains a collection of encoders in its state for encoding zones from their Erlang representation to JSON.
Summary
Functions
Register a single encoder module.
Register a list of encoder modules.
Start the encoder process.
Encode a Zone meta data into JSON.
Encode the records in the zone with the given RRSet name and type into JSON
Encode the records in the zone with the given RRSet name and type into JSON
Encode a Zone meta data plus all of its records into JSON.
Functions
-spec register_encoder(module()) -> ok.
Register a single encoder module.
-spec register_encoders([module()]) -> ok.
Register a list of encoder modules.
-spec start_link() -> any().
Start the encoder process.
-spec zone_meta_to_json(#zone{name :: dns:dname(), version :: binary(), authority :: [dns:rr()], record_count :: non_neg_integer(), records :: [dns:rr()] | trimmed, records_by_name :: #{binary() => [dns:rr()]} | trimmed, records_by_type :: term(), keysets :: [erldns:keyset()]}) -> binary().
Encode a Zone meta data into JSON.
Encode the records in the zone with the given RRSet name and type into JSON
Encode the records in the zone with the given RRSet name and type into JSON
-spec zone_to_json(#zone{name :: dns:dname(), version :: binary(), authority :: [dns:rr()], record_count :: non_neg_integer(), records :: [dns:rr()] | trimmed, records_by_name :: #{binary() => [dns:rr()]} | trimmed, records_by_type :: term(), keysets :: [erldns:keyset()]}) -> binary().
Encode a Zone meta data plus all of its records into JSON.