Documentation ¶
Index ¶
- Constants
- func BytesToUint256(b []byte) *uint256.Int
- func BytesToUint32(b []byte) uint32
- func BytesToUint64(b []byte) uint64
- func EncodeToJsonHelper(arg interface{}) string
- func FileExists(path string) bool
- func GetFileSize(filepath string) (int64, error)
- func IsBitSet(bytes []byte, bitPosition int) bool
- func IsValidURI(u string) bool
- func MakeTimestamp() uint64
- func Max[T constraints.Ordered](a, b T) T
- func Min[T constraints.Ordered](a, b T) T
- func ReadJsonFile[T any](path string, res *T) (*T, error)
- func ShuffleSliceCopy[T any](src []T) (dst []T)
- func Uint256ToBytes(i *uint256.Int) []byte
- func Uint32ToBytes(i uint32) []byte
- func Uint64ToBytes(i uint64) []byte
- func Uint64ToBytes32(n uint64) []byte
- func WriteCBORError(w http.ResponseWriter, e error, code int)
- func WriteCBORResponse(w http.ResponseWriter, response any, statusCode int)
- func WriteDebugJsonLog(l log.Logger, m string, arg interface{})
- func WriteJsonFile[T any](path string, obj *T) error
- func WriteTraceJsonLog(l log.Logger, m string, arg interface{})
Constants ¶
View Source
const GenesisTime uint64 = 1681971084
GenesisTime min timestamp Thursday, April 20, 2023 6:11:24 AM GMT+00:00
Variables ¶
This section is empty.
Functions ¶
func BytesToUint256 ¶ added in v0.1.3
func BytesToUint32 ¶ added in v0.2.0
func BytesToUint64 ¶ added in v0.1.1
func EncodeToJsonHelper ¶ added in v0.2.0
func EncodeToJsonHelper(arg interface{}) string
EncodeToJsonHelper encodes to argument to json and returns it as string, on encode error return error message as string
func FileExists ¶
func GetFileSize ¶ added in v0.1.1
func IsValidURI ¶ added in v0.1.1
func MakeTimestamp ¶ added in v0.2.0
func MakeTimestamp() uint64
MakeTimestamp returns timestamp in seconds from epoch
func Max ¶ added in v0.2.0
func Max[T constraints.Ordered](a, b T) T
func Min ¶ added in v0.1.1
func Min[T constraints.Ordered](a, b T) T
func ReadJsonFile ¶
func ShuffleSliceCopy ¶
func ShuffleSliceCopy[T any](src []T) (dst []T)
func Uint256ToBytes ¶ added in v0.1.1
func Uint32ToBytes ¶ added in v0.1.1
func Uint64ToBytes ¶
func Uint64ToBytes32 ¶ added in v0.2.0
func WriteCBORError ¶ added in v0.2.0
func WriteCBORError(w http.ResponseWriter, e error, code int)
WriteCBORError replies to the request with the specified error message and HTTP code. It does not otherwise end the request; the caller should ensure no further writes are done to w.
func WriteCBORResponse ¶ added in v0.2.0
func WriteCBORResponse(w http.ResponseWriter, response any, statusCode int)
WriteCBORResponse replies to the request with the given response and HTTP code.
func WriteDebugJsonLog ¶
func WriteJsonFile ¶
func WriteTraceJsonLog ¶ added in v0.2.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.