Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Stringer interface to all types #3568

Merged
merged 20 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adds Stringer interface to all types
  • Loading branch information
tjayrush committed Apr 9, 2024
commit 380daa92884899569887a6fd5cd4ce75aa761c0a
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/blocks/types_blockcount.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package blocksPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/utils"
Expand All @@ -31,6 +33,11 @@ type simpleBlockCount struct {
// EXISTING_CODE
}

func (s *simpleBlockCount) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleBlockCount) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/chunks/types_chunkaddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package chunksPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)
Expand All @@ -26,6 +28,11 @@ type simpleChunkAddress struct {
// EXISTING_CODE
}

func (s *simpleChunkAddress) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleChunkAddress) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/chunks/types_chunkbloom.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package chunksPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)
Expand All @@ -29,6 +31,11 @@ type simpleChunkBloom struct {
// EXISTING_CODE
}

func (s *simpleChunkBloom) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleChunkBloom) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/chunks/types_chunkindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package chunksPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)
Expand All @@ -28,6 +30,11 @@ type simpleChunkIndex struct {
// EXISTING_CODE
}

func (s *simpleChunkIndex) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleChunkIndex) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/chunks/types_chunkpinreport.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package chunksPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)
Expand All @@ -27,6 +29,11 @@ type simpleChunkPinReport struct {
// EXISTING_CODE
}

func (s *simpleChunkPinReport) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleChunkPinReport) Raw() *types.RawModeler {
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions src/apps/chifra/internal/chunks/types_ipfspin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package chunksPkg

// EXISTING_CODE
import (
"encoding/json"
"strings"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
Expand All @@ -29,6 +30,11 @@ type simpleIpfsPin struct {
// EXISTING_CODE
}

func (s *simpleIpfsPin) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleIpfsPin) Raw() *types.RawModeler {
return nil
}
Expand Down
11 changes: 10 additions & 1 deletion src/apps/chifra/internal/chunks/types_reportcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
package chunksPkg

// EXISTING_CODE
import "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)

// EXISTING_CODE

Expand All @@ -27,6 +31,11 @@ type simpleReportCheck struct {
// EXISTING_CODE
}

func (s *simpleReportCheck) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleReportCheck) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/monitors/types_monitorclean.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package monitorsPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)
Expand All @@ -26,6 +28,11 @@ type simpleMonitorClean struct {
// EXISTING_CODE
}

func (s *simpleMonitorClean) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleMonitorClean) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/status/types_cacheitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package statusPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)

Expand All @@ -28,6 +30,11 @@ type simpleCacheItem struct {
// EXISTING_CODE
}

func (s *simpleCacheItem) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleCacheItem) Raw() *types.RawModeler {
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions src/apps/chifra/internal/status/types_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package statusPkg

// EXISTING_CODE
import (
"encoding/json"
"fmt"
"io"
"sort"
Expand Down Expand Up @@ -58,6 +59,11 @@ type simpleStatus struct {
// EXISTING_CODE
}

func (s *simpleStatus) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleStatus) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/traces/types_tracecount.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package tracesPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/utils"
Expand All @@ -28,6 +30,11 @@ type simpleTraceCount struct {
// EXISTING_CODE
}

func (s *simpleTraceCount) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleTraceCount) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/internal/when/types_timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package whenPkg

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/utils"
Expand All @@ -26,6 +28,11 @@ type simpleTimestamp struct {
// EXISTING_CODE
}

func (s *simpleTimestamp) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleTimestamp) Raw() *types.RawModeler {
return nil
}
Expand Down
11 changes: 10 additions & 1 deletion src/apps/chifra/internal/when/types_timestampcount.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
package whenPkg

// EXISTING_CODE
import "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)

// EXISTING_CODE

Expand All @@ -20,6 +24,11 @@ type simpleTimestampCount struct {
// EXISTING_CODE
}

func (s *simpleTimestampCount) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *simpleTimestampCount) Raw() *types.RawModeler {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions src/apps/chifra/pkg/types/types_abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package types

// EXISTING_CODE
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
)

Expand All @@ -30,6 +32,11 @@ type SimpleAbi struct {
// EXISTING_CODE
}

func (s *SimpleAbi) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *SimpleAbi) Raw() *RawAbi {
return s.raw
}
Expand Down
6 changes: 6 additions & 0 deletions src/apps/chifra/pkg/types/types_appearance.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package types

// EXISTING_CODE
import (
"encoding/json"
"fmt"
"sort"

Expand Down Expand Up @@ -51,6 +52,11 @@ type SimpleAppearance struct {
// EXISTING_CODE
}

func (s *SimpleAppearance) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *SimpleAppearance) Raw() *RawAppearance {
return s.raw
}
Expand Down
11 changes: 10 additions & 1 deletion src/apps/chifra/pkg/types/types_appearancecount.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
package types

// EXISTING_CODE
import "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
import (
"encoding/json"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
)

// EXISTING_CODE

Expand All @@ -30,6 +34,11 @@ type SimpleAppearanceCount struct {
// EXISTING_CODE
}

func (s *SimpleAppearanceCount) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *SimpleAppearanceCount) Raw() *RawAppearanceCount {
return s.raw
}
Expand Down
6 changes: 6 additions & 0 deletions src/apps/chifra/pkg/types/types_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package types

// EXISTING_CODE
import (
"encoding/json"
"fmt"
"io"
"path/filepath"
Expand Down Expand Up @@ -68,6 +69,11 @@ type SimpleBlock[Tx string | SimpleTransaction] struct {
// EXISTING_CODE
}

func (s *SimpleBlock[Tx]) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *SimpleBlock[Tx]) Raw() *RawBlock {
return s.raw
}
Expand Down
6 changes: 6 additions & 0 deletions src/apps/chifra/pkg/types/types_bounds.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package types

// EXISTING_CODE
import (
"encoding/json"
"fmt"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
Expand Down Expand Up @@ -39,6 +40,11 @@ type SimpleBounds struct {
// EXISTING_CODE
}

func (s *SimpleBounds) String() string {
bytes, _ := json.Marshal(s)
return string(bytes)
}

func (s *SimpleBounds) Raw() *RawBounds {
return s.raw
}
Expand Down
Loading
Loading