Documentation ¶
Overview ¶
Package identity defines the ID format used for uniquely identifying objects in Arigato.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID [18]byte
ID is an encoded unique identifier for an object.
The first byte holds the schema version of the id itself. The second byte holds the type of the object. The remaining 16 bytes hold a digest of the contents of the object for immutable objects, or a random value for mutable objects.
func DecodeFromString ¶
DecodeFromString returns an ID that is stored in the given string.
func Immutable ¶
func Immutable(body Identifiable, sig interface{}) (ID, error)
Immutable returns a new signed ID for an immutable object.
sig should be a registry.Signature type
func Mutable ¶
func Mutable(body Identifiable) (ID, error)
Mutable returns a new ID for a mutable object.
func (*ID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for IDs.
IDs are encoded in unpadded base32.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for IDs.
type Identifiable ¶
Identifiable is the interface implemented by objects that can be given IDs.