mock

package
v0.0.0-...-133031b Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package mock uses mocked structures to filter out non-essential data to clarify testing. These mocked types are not valid data, and can only be used during testing where data is unvalidated.

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID string

ID mocks out `fields.QualifiedHash`.

func FromQualifiedHash

func FromQualifiedHash(h *fields.QualifiedHash) ID

func (ID) IntoQualifiedHash

func (id ID) IntoQualifiedHash() *fields.QualifiedHash

type IDs

type IDs []ID

func FromQualifiedHashList

func FromQualifiedHashList(hashes []*fields.QualifiedHash) (list IDs)

func (IDs) IntoQualifiedHashList

func (list IDs) IntoQualifiedHashList() (hashes []*fields.QualifiedHash)

type Node

type Node struct {
	Type    fields.NodeType
	ID      string
	Created fields.Timestamp
	Parent  ID
}

Node mocks out `forest.Node`. Resolves to a non-validated `forest.Node`.

func FromNode

func FromNode(n forest.Node) Node

func FromReply

func FromReply(r forest.Reply) Node

func (Node) Into

func (m Node) Into() forest.Node

func (Node) IntoReply

func (m Node) IntoReply() *forest.Reply

type Nodes

type Nodes []Node

Nodes is a list of mock nodes that can resolve to a list of non-validated `forest.Reply`.

func FromNodes

func FromNodes(src []forest.Node) (list Nodes)

func FromReplies

func FromReplies(src []forest.Reply) (list Nodes)

func (Nodes) Into

func (list Nodes) Into() []forest.Node

func (Nodes) IntoReplies

func (list Nodes) IntoReplies() []forest.Reply

Jump to

Keyboard shortcuts

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