Categorygithub.com/anothermemory/unit
modulepackage
0.1.0
Repository: https://github.com/anothermemory/unit.git
Documentation: pkg.go.dev

# README

unit

# Functions

Equal compares two units and returns true if they are equal and false otherwise.
NewList creates new List unit with given title.
NewTextCode creates new TextCode unit with given title, data and language.
NewTextMarkdown creates new TextMarkdown unit with given title and data.
NewTextPlain creates new TextPlain unit with given title and data.
NewTodo creates new Todo unit with given title.
NewUnit creates new Unit with given title.
NotEqual two units and returns true if they are not equal and false otherwise.
OptionClockMock is an option that sets internal clock for a unit to return mocked values.
OptionClockMockPartial is an option that sets internal clock for a unit to return mocked value once.
OptionClockReal is an option that sets internal clock for a unit to return real time.
OptionIDGeneratorMock is an option that sets internal UUID generator for a unit to return same value each time.
OptionIDGeneratorUUID is an option that sets internal UUID generator for a unit to UUID implementation.
OptionListItem is an option that adds new item to the list unit.
OptionListMarshalItems is an option that sets marshalItems flag for a list unit to the provided value.
OptionTextCodeData is an option that sets data for a text code unit to the provided value.
OptionTextCodeLanguage is an option that sets language for a text code unit to the provided value.
OptionTextMarkdownData is an option that sets data for a text markdown unit to the provided value.
OptionTextPlainData is an option that sets data for a text plain unit to the provided value.
OptionTitle is an option that sets title for a unit to the provided value.
OptionTodoItem is an option that adds new todo item to the unit.
TypeFromString returns type by it's string representation.

# Constants

TypeList represents type "List" for unit.
TypeTextCode represents type "TextCode" for unit.
TypeTextMarkdown represents type "TextMarkdown" for unit.
TypeTextPlain represents type "TextPlain" for unit.
TypeTodo represents type "Todo" for unit.
TypeUnit represents type "Unit" for unit.

# Interfaces

List represents unit which contains other units.
TextCode represents unit which contains some source code as plain text and it's language.
TextMarkdown represents unit which has some plain markdown content.
TextPlain represents unit which has some plain text content.
Todo represents unit which contains todo items.
TodoItem represents single item which can have some string data and done status.
Unit represents simplest unit which actually does nothing but used as a base for all other units.

# Type aliases

Type represents type enumeration for unit types.