1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 03:36:16 +00:00
mycorrhiza/hyphae/empty_hypha.go

36 lines
626 B
Go
Raw Normal View History

2022-02-04 11:14:53 +00:00
package hyphae
import "sync"
type EmptyHypha struct {
sync.RWMutex
canonicalName string
}
func (e *EmptyHypha) CanonicalName() string {
return e.canonicalName
}
func (e *EmptyHypha) HasTextPart() bool {
return false
}
func (e *EmptyHypha) TextPartPath() string {
return ""
}
// NewEmptyHypha returns an empty hypha struct with given name.
func NewEmptyHypha(hyphaName string) *EmptyHypha {
return &EmptyHypha{
canonicalName: hyphaName,
}
}
2022-02-04 17:04:39 +00:00
func FillEmptyHyphaUpToTextualHypha(e *EmptyHypha, textPath string) *MediaHypha { // sic!
return &MediaHypha{
2022-02-04 17:04:39 +00:00
name: e.CanonicalName(),
TextPath: textPath,
}
}