Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { *sync.Mutex // ChildrenByParent holds a map of child channels ChildrenByParent map[string]map[string]chan struct{} // ParentByChild helps us delete efficiently, by telling us which parent map the child is in ParentByChild map[string]string }
Store maps parents and children channels e.g. for associating with bookingIDs
func (*Store) Add ¶
Add a parent-child relationship. A parent is typically a bookingID, child for clientname
func (*Store) DeleteAndCloseChild ¶
DeleteAndCloseChild closes the child's channel and deletes it this approach ensures the channel cannot be closed twice
func (*Store) DeleteAndCloseParent ¶
DeleteAndCloseParent deletes the parent, and all its children, closing the children's channels
func (*Store) DeleteChild ¶
DeleteChild deletes the child, without closing the channel
func (*Store) DeleteParent ¶
DeleteParent deletes the parent, and all its children, without closing the children's channels
Click to show internal directories.
Click to hide internal directories.