Skip to content

Commit

Permalink
Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Oct 29, 2024
1 parent ac2af62 commit c0a0407
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions names.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c0a0407

Please sign in to comment.