taxonomy

package
v0.0.0-...-7b190fc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Taxon

type Taxon string

Taxon represents a single taxonomic unit. It is a string type that can represent multiple levels of a taxonomy, separated by a `/`. For example, a Taxon could be "storage/database/rdbms/postgres", representing a hierarchical structure of categories.

func NewTaxonomy

func NewTaxonomy(levels ...string) Taxon

NewTaxonomy function takes a variadic parameter of strings representing levels and joins them into a single Taxon using the separator. This function is used to create a new Taxon. For example, NewTaxonomy("storage", "database", "rdbms", "postgres") would return a Taxon "storage/database/rdbms/postgres".

func (Taxon) Split

func (t Taxon) Split() (levels []string)

Split method of a Taxon splits the Taxon into its constituent levels based on the separator and returns them as a slice of strings. For example, if the Taxon is "storage/database/rdbms/postgres", Split would return ["storage", "database", "rdbms", "postgres"].

func (Taxon) String

func (t Taxon) String() string

String returns string representation of the taxon

Jump to

Keyboard shortcuts

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