id

package
v0.0.0-...-c1a87c5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidIDError = errors.New("invalid ID")
)

Functions

This section is empty.

Types

type ID

type ID [20]byte

ID is a unique identifier.

func New

func New() (ID, error)

New returns a random ID value.

func (ID) MarshalBinary

func (id ID) MarshalBinary() ([]byte, error)

MarshalBinary returns a slice of bytes.

func (ID) MarshalText

func (id ID) MarshalText() (text []byte, err error)

MarshalText returns a hex-encoded slice of bytes.

func (*ID) Scan

func (id *ID) Scan(src interface{}) error

Scan sets the value of the ID based on an interface.

func (ID) String

func (id ID) String() string

String returns a hex-encoded string.

func (*ID) UnmarshalBinary

func (id *ID) UnmarshalBinary(data []byte) error

UnmarshalText sets the value of the ID based on a slice of bytes.

func (*ID) UnmarshalText

func (id *ID) UnmarshalText(text []byte) error

UnmarshalText sets the value of the ID based on a hex-encoded slice of bytes.

func (ID) Value

func (id ID) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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