Skip to content

CommunityIndex

Namespace Nfty.Core.Publish.Community in assembly Nfty.Core.

public sealed record CommunityIndex : ISchemaVersioned

The gallery's published list: every entry, generated from the owners' repositories.

Constructors

CommunityIndex(int, DateTimeOffset, IReadOnlyList<CommunityEntry>)

public CommunityIndex(int SchemaVersion, DateTimeOffset Generated, IReadOnlyList<CommunityEntry> Entries);

Parameters

  • SchemaVersion (int) - The schema this list was written against.
  • Generated (DateTimeOffset) - When the list was built.
  • Entries (IReadOnlyList<CommunityEntry>) - The entries.

Properties

Entries

public IReadOnlyList<CommunityEntry> Entries { get; init; }

The entries.

Generated

public DateTimeOffset Generated { get; init; }

When the list was built.

SchemaVersion

public int SchemaVersion { get; init; }

The schema this list was written against.

Methods

Read(Stream)

public static CommunityIndex Read(Stream stream);

Reads a list, refusing a newer schema by name.

Parameters

  • stream (Stream) - The JSON.

Returns. The list read.

Write(CommunityIndex)

public static byte[] Write(CommunityIndex index);

Writes a list with entries sorted ordinally: owner id ascending, then slug.

Parameters

  • index (CommunityIndex) - The list.

Returns. The list as UTF-8 JSON, entries sorted.