Documentation
¶
Overview ¶
Package general contains interfaces and code that could be used in abstract ways in a range of situations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DelayCloser ¶
type DelayCloser interface {
Close(doneChan chan<- error)
}
DelayCloser is an interface that should be implemented by values that need to be closed but may require some time to do so. Usually because they manage one or more worker threads.
The implementation of DelayCloser.Close must return *immediately* and at some later time on *another* thread must write a single item (either nil or an error) to the provided chan.
type DumperFactory ¶
type DumperFactory interface { // New creates a new Dumper with the given name // it may need to be closed, use "closer, ok := dumper.(io.Closer)" to find out New(name string) (Dumper, error) // Dump is a helper method that creates a new Dumper, dumps the one given buffer and closes // the dumper Dump(name string, data []byte) error // DumpObj is a helper method that creates a new Dumper, dumps the one given object and closes // the dumper DumpObj(name string, obj interface{}) error }
DumperFactory is a minimal interface to supports creating dumpers
type LoggerFactory ¶
LoggerFactory is a minimal interface to supports creating loggers
type PersistentState ¶
type PersistentState interface { // Save persists an object under the given name // the state object should be json serializable Save(name string, state interface{}) error // Retrieve fills the provided state object with data that was previously saved under the // given name. Retrieve(name string, state interface{}) error }
PersistentState interface allows reading and writing named state objects
type Shutdowner ¶
type Shutdowner interface { // Shutdown indicates to the implementer that shutdown is needed with a possible error Shutdown(err error) }
Shutdowner provides a way to request shutdown