node

package
v0.0.0-...-5a6e01e Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package node provides several Node types.

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseV0Type   = hint.Type("base-node")
	BaseV0Hint   = hint.NewHint(BaseV0Type, "v0.0.1")
	BaseV0Hinter = BaseV0{BaseHinter: hint.NewBaseHinter(BaseV0Hint)}
)

Functions

This section is empty.

Types

type BaseV0

type BaseV0 struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewBaseV0

func NewBaseV0(address base.Address, publickey key.Publickey) BaseV0

func (BaseV0) Address

func (bn BaseV0) Address() base.Address

func (BaseV0) IsValid

func (bn BaseV0) IsValid([]byte) error

func (BaseV0) MarshalBSON

func (bn BaseV0) MarshalBSON() ([]byte, error)

func (BaseV0) MarshalJSON

func (bn BaseV0) MarshalJSON() ([]byte, error)

func (BaseV0) Publickey

func (bn BaseV0) Publickey() key.Publickey

func (BaseV0) String

func (bn BaseV0) String() string

func (*BaseV0) UnpackBSON

func (bn *BaseV0) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseV0) UnpackJSON

func (bn *BaseV0) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type BaseV0PackerBSON

type BaseV0PackerBSON struct {
	HT hint.Hint     `bson:"_hint"`
	AD base.Address  `bson:"address"`
	PK key.Publickey `bson:"publickey"`
}

type BaseV0PackerJSON

type BaseV0PackerJSON struct {
	jsonenc.HintedHead
	AD base.Address  `json:"address"`
	PK key.Publickey `json:"publickey"`
}

type BaseV0UnpackerBSON

type BaseV0UnpackerBSON struct {
	AD base.AddressDecoder  `bson:"address"`
	PK key.PublickeyDecoder `bson:"publickey"`
}

type BaseV0UnpackerJSON

type BaseV0UnpackerJSON struct {
	AD base.AddressDecoder  `json:"address"`
	PK key.PublickeyDecoder `json:"publickey"`
}

type Local

type Local struct {
	BaseV0
	// contains filtered or unexported fields
}

func NewLocal

func NewLocal(address base.Address, privatekey key.Privatekey) Local

func (Local) Privatekey

func (ln Local) Privatekey() key.Privatekey

func (Local) Publickey

func (ln Local) Publickey() key.Publickey

type NodeError

type NodeError struct {
	// contains filtered or unexported fields
}

func NewNodeError

func NewNodeError(no base.Address, err error) NodeError

func (NodeError) Error

func (er NodeError) Error() string

func (NodeError) Unwrap

func (er NodeError) Unwrap() error

type Remote

type Remote struct {
	BaseV0
}

func NewRemote

func NewRemote(address base.Address, publickey key.Publickey) Remote

Jump to

Keyboard shortcuts

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