entity

package
v0.0.0-...-11620cc Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoxPrivateKey

type BoxPrivateKey *[32]byte

BoxPrivateKey represents an Entity's crypto private key for public-key cryptography that is interoperable with NaCl: https://nacl.cr.yp.to/box.html.

type BoxPublicKey

type BoxPublicKey *[32]byte

BoxPublicKey represents an Entity's public key for public-key cryptography that is interoperable with NaCl: https://nacl.cr.yp.to/box.html.

See: https://godoc.org/golang.org/x/crypto/nacl/box

type Domain

type Domain struct {
	DomainID
	Name
	ParentID DomainID
	// BoxPublicKey is used to exchange encrypted messages with the Domain
	BoxPublicKey  BoxPublicKey
	SignPublicKey SignPublicKey
}

Domain is used to represent an Entity domain. Domains can form a hierarchy, i.e., all Domains have a parent Domain, except for the root Domain.

func (Domain) IsRoot

func (d Domain) IsRoot() bool

IsRoot returns true of ParentID is a zero value

type DomainID

type DomainID ulid.ULID

DomainID is used as the Entity's domain ID

func (DomainID) IsZero

func (d DomainID) IsZero() bool

IsZero returns true of the DomainID has no value, i.e., is the zero value

type Entity

type Entity struct {
	// DomainID for the Entity owner
	DomainID
	ID
	// Name is the unique Entity name within
	Name
	// BoxPublicKey is used to exchange encrypted messages
	BoxPublicKey BoxPublicKey
}

Entity represents any entity instance for a given Class

type ID

type ID ulid.ULID

ID is used as the Entity identifier. The ID timestamp correlates to when the Entity was created.

type Name

type Name string

Name is used to assign a user friendly name for an Entity

type SignPrivateKey

type SignPrivateKey *[64]byte

SignPrivateKey represents an Entity's crypto private key for signing messages.

See: https://godoc.org/golang.org/x/crypto/nacl/sign

type SignPublicKey

type SignPublicKey *[32]byte

SignPublicKey is the public key used to verify signatures

See: https://godoc.org/golang.org/x/crypto/nacl/sign

type SignedULID

type SignedULID []byte

SignedULID is a signed ULID

func SignULID

func SignULID(id ulid.ULID, key SignPrivateKey) SignedULID

SignULID signs the specified ULID

func (SignedULID) Open

func (su SignedULID) Open(key SignPublicKey) (id ulid.ULID, ok bool)

Open verifies the signed ULID using the specified public key

Jump to

Keyboard shortcuts

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