{"modulePath":"github.com/CS-SI/SafeScale/v21","version":"v21.11.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package observer\n\n## Types\n\n```go\ntype Observable interface {\n\tdata.Identifiable\n\n\tAddObserver(o Observer) error     // register an Observer to be kept in touch\n\tNotifyObservers() error           // notify observers a change occurred on content (using Observer.SignalChange)\n\tRemoveObserver(name string) error // deregister an Observer that will not be notified further\n}\n```\nObservable is the interface a struct must satisfy to signal internal change to observers\n\n```go\ntype Observer interface {\n\tdata.Identifiable\n\n\tSignalChange(id string)  // is called by Observable to signal an Observer a change occurred\n\tMarkAsFreed(id string)   // is called by Observable to signal an Observer the content will not be used any more (decreasing the counter of uses)\n\tMarkAsDeleted(id string) // used to mark the Observable as deleted (allowing to remove the entry from the Observer internals)\n}\n```\nObserver is the interface a struct must satisfy to be observed by outside\n\n","path":"github.com/CS-SI/SafeScale/v21/lib/utils/data/observer","name":"observer","synopsis":"","isRedistributable":true}
