diff --git a/chunks.go b/chunks.go index a86514c..f1214bb 100644 --- a/chunks.go +++ b/chunks.go @@ -228,4 +228,24 @@ func SortChunkStats(chunkstats []types.ChunkStats, sortSpec SortSpec) error { } // EXISTING_CODE +// Syntactic sugar +type IndexesOptions = ChunksOptions +type ManifestsOptions = ChunksOptions + +// Syntactic sugar +func (opts *IndexesOptions) IndexesList() ([]types.ChunkStats, *types.MetaData, error) { + return opts.ChunksStats() +} +func (opts *ManifestsOptions) ManifestsList() ([]types.ChunkManifest, *types.MetaData, error) { + return opts.ChunksManifest() +} + +// Syntactic sugar +func SortIndexes(chunkstats []types.ChunkStats, sortSpec SortSpec) error { + return SortChunkStats(chunkstats, sortSpec) +} +func SortManifests(chunkrecords []types.ChunkRecord, sortSpec SortSpec) error { + return SortChunkRecords(chunkrecords, sortSpec) +} + // EXISTING_CODE diff --git a/config.go b/config.go index 8672783..8529677 100644 --- a/config.go +++ b/config.go @@ -14,6 +14,7 @@ import ( "fmt" "strings" + configTypes "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/configtypes" "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output" "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types" // EXISTING_CODE @@ -88,4 +89,12 @@ func enumFromConfigMode(values []string) (ConfigMode, error) { } // EXISTING_CODE +type ConfigsOptions = ConfigOptions + +func (opts *ConfigsOptions) ConfigsList() ([]configTypes.Config, *types.MetaData, error) { + meta, err := GetMetaData(opts.Chain) + // the caller is responsible to fill this with the data + return []configTypes.Config{}, meta, err +} + // EXISTING_CODE diff --git a/names.go b/names.go index c869be4..a0028b1 100644 --- a/names.go +++ b/names.go @@ -152,4 +152,9 @@ func (opts *NamesOptions) ModifyName(op crud.Operation, cd *crud.NameCrud) ([]ty return nil, nil, errors.New("invalid operation " + string(op)) } +// Syntactic sugar +func (opts *NamesOptions) NamesList() ([]types.Name, *types.MetaData, error) { + return opts.Names() +} + // EXISTING_CODE diff --git a/status.go b/status.go index 2de2385..5d3bbca 100644 --- a/status.go +++ b/status.go @@ -307,4 +307,9 @@ func (opts *StatusOptions) Status() ([]types.Status, *types.MetaData, error) { return opts.StatusDiagnose() } +// Syntactic sugar +func (opts *StatusOptions) StatusList() ([]types.Status, *types.MetaData, error) { + return opts.StatusAll() +} + // EXISTING_CODE