address

package
v0.0.0-...-9f124b0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package address provides utility functions for working with stellar addresses. See https://www.stellar.org/developers/guides/concepts/federation. html#stellar-addresses for more on addresses.

Index

Constants

View Source
const Separator = "*"

Separator seperates the name and domain portions of an address

Variables

View Source
var (
	// ErrInvalidAddress is the error returned when an address is invalid in
	// such a way that we do not know if the name or domain portion is at fault.
	ErrInvalidAddress = errors.New("invalid address")

	// ErrInvalidName is the error returned when an address's name portion is
	// invalid.
	ErrInvalidName = errors.New("name part of address is invalid")

	// ErrInvalidDomain is the error returned when an address's domain portion
	// is invalid.
	ErrInvalidDomain = errors.New("domain part of address is invalid")
)

Functions

func New

func New(name, domain string) string

New returns a new address based upon the provided name and domain. Note: Not validation is performed on the parts provided... it is possible to create an invalid address by supplying invalid information, for example, supplying a blank domain.

func Split

func Split(address string) (name, domain string, err error)

Split takes an address, of the form "name*domain" and provides the constituent elements.

Types

This section is empty.

Jump to

Keyboard shortcuts

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