refs

package
v0.0.0-...-7578c0e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateIdentifiable

func GenerateIdentifiable(iType IdentifiableType) identifiable

func MustGenerator

func MustGenerator(iType IdentifiableType) func() identifiable

func MustIdentifiableFactory

func MustIdentifiableFactory(iType IdentifiableType) func(id string) identifiable

func NewIdentifiable

func NewIdentifiable(iType IdentifiableType, id string) identifiable

func ParseIdentifiable

func ParseIdentifiable(raw string) (identifiable, error)

Types

type Identifiable

type Identifiable interface {
	// Type know what it is
	Type() IdentifiableType
	// ID something by which you can find it in it's origin storage, can't contain )
	ID() string
	// String make it serializable nicely for others to store in DB and for you to reconstruct later
	String() string
}

type IdentifiableType

type IdentifiableType string

IdentifiableType make it easier for ide to find defined instances in the codebase, type can't contain (

Jump to

Keyboard shortcuts

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