address

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidAddress

func IsValidAddress(address string) bool

IsValidAddress returns true when the given string is a valid BitMaelum address

Types

type Address

type Address struct {
	Local string // Local part is either <local>!  or  <local>@<organisation>!
	Org   string // Org part is either "" in case of <local>!  or <local>@<organisation>!
}

Address represents a bitMaelum address

func NewAddress

func NewAddress(address string) (*Address, error)

NewAddress returns a valid address structure based on the given address

func (*Address) Bytes

func (a *Address) Bytes() []byte

Bytes converts an address to []byte

func (*Address) HasOrganisationPart

func (a *Address) HasOrganisationPart() bool

HasOrganisationPart returns true when the address is an organisational address (user@org!)

func (*Address) Hash

func (a *Address) Hash() hash.Hash

Hash converts an address to a hashed value

func (*Address) LocalHash

func (a *Address) LocalHash() hash.Hash

LocalHash returns the hash of the local/user part of the address

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

MarshalJSON will marshal an address into a string of bytes for JSON output

func (*Address) OrgHash

func (a *Address) OrgHash() hash.Hash

OrgHash returns the hash of the organisation part of the address

func (*Address) String

func (a *Address) String() string

String converts an address to a string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(b []byte) error

UnmarshalJSON will unmarshal a string of bytes into an address

Jump to

Keyboard shortcuts

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