util

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthereumAddress

type EthereumAddress struct {
	// contains filtered or unexported fields
}

func NewEthereumAddressFromBytes

func NewEthereumAddressFromBytes(address []byte) (EthereumAddress, error)

func NewEthereumAddressFromString

func NewEthereumAddressFromString(address string) (EthereumAddress, error)

func Unsafe_NewEthereumAddressFromString

func Unsafe_NewEthereumAddressFromString(address string) EthereumAddress

Unsafe_NewEthereumAddressFromString the difference is that it panics on errors

func (*EthereumAddress) Address

func (e *EthereumAddress) Address() string

Address returns the address as a hex string, starting with 0x

func (*EthereumAddress) Bytes

func (e *EthereumAddress) Bytes() []byte

Bytes returns the address as a byte slice

func (*EthereumAddress) MarshalJSON

func (e *EthereumAddress) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*EthereumAddress) UnmarshalJSON

func (e *EthereumAddress) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type StreamId

type StreamId struct {
	// contains filtered or unexported fields
}

func GenerateStreamId

func GenerateStreamId(s string) StreamId

GenerateStreamId is the hash fn to generate a stream id from a string it already prepends the "st" prefix to the hash, and returns the first 30 characters, to fit kwil's limit

func NewStreamId

func NewStreamId(s string) (*StreamId, error)

func (*StreamId) MarshalJSON

func (s *StreamId) MarshalJSON() ([]byte, error)

func (*StreamId) String

func (s *StreamId) String() string

func (*StreamId) UnmarshalJSON

func (s *StreamId) UnmarshalJSON(b []byte) error

func (*StreamId) Validate

func (s *StreamId) Validate() error

type StreamIdSlice

type StreamIdSlice []StreamId

func (StreamIdSlice) Len

func (s StreamIdSlice) Len() int

func (StreamIdSlice) Less

func (s StreamIdSlice) Less(i, j int) bool

func (StreamIdSlice) Strings

func (s StreamIdSlice) Strings() []string

func (StreamIdSlice) Swap

func (s StreamIdSlice) Swap(i, j int)

type VisibilityEnum

type VisibilityEnum int
const (
	PublicVisibility  VisibilityEnum = 0
	PrivateVisibility VisibilityEnum = 1
)

func NewVisibilityEnum

func NewVisibilityEnum(value int) (VisibilityEnum, error)

func (*VisibilityEnum) UnmarshalJSON

func (v *VisibilityEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the visibility enum, also checking if the value is valid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL