Documentation ¶
Index ¶
- Constants
- Variables
- func Compare(a, b types.Actionable) int
- func DotGodoDirCreater(parent string) func() error
- func FileCreater(path string) func() error
- func JSONDecode(r io.Reader) (map[types.ID]types.Actionable, error)
- func JSONEncode(abstractMap map[types.ID]types.Actionable, w io.Writer) error
- type Comparer
- type Decoder
- type Encoder
- type Getter
- type JSON
- type Lister
- type Logger
- type Mock
- type Putter
- type ReadGetter
- type Remover
- type Repository
- type WriterGetter
Constants ¶
View Source
const Dir = ".godo"
View Source
const JSONFile = "godo.json"
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func Compare ¶
func Compare(a, b types.Actionable) int
func DotGodoDirCreater ¶
func FileCreater ¶
func JSONDecode ¶
func JSONEncode ¶
Types ¶
type Comparer ¶
type Comparer func(a, b types.Actionable) int
type Lister ¶
type Lister interface {
List() ([]types.Actionable, error)
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is a data persistency strategy that has predefined values
type Putter ¶
type Putter interface {
Put(types.Actionable) error
}
type ReadGetter ¶
type ReadGetter func() (io.ReadCloser, error)
func FileReader ¶
func FileReader(path string) ReadGetter
type Repository ¶
func LoggerOverRepository ¶
func LoggerOverRepository(repo Repository) Repository
func MockWithData ¶
func MockWithData(data map[types.ID]types.Actionable) Repository
func NewJSONRepository ¶
func NewJSONRepository( rdr ReadGetter, wrt WriterGetter, dec Decoder, enc Encoder, cmp Comparer, ) Repository
type WriterGetter ¶
type WriterGetter func() (io.WriteCloser, error)
func FileWriter ¶
func FileWriter(path string) WriterGetter
Click to show internal directories.
Click to hide internal directories.