-
Notifications
You must be signed in to change notification settings - Fork 5
/
interfaces.go
81 lines (72 loc) · 1.53 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package usecases
// Coffer
// Interfaces
// Copyright © 2019 Eduard Sesigin. All rights reserved. Contacts: <claygod@yandex.ru>
import (
"github.com/claygod/coffer/domain"
//"github.com/claygod/coffer/services/logger"
)
/*
Resourcer - interface for indicator of the status of the physical memory (and disk) of the device.
*/
type Resourcer interface {
GetPermission(int64) bool
}
/*
Porter - interface for regulates access to resources by keys.
*/
type Porter interface {
Catch([]string)
Throw([]string)
}
/*
Logger - interface for logs.
*/
type Logger interface {
//Fatal(...interface{})
Error(...interface{}) //*logger.Logger
Warning(...interface{}) // *logger.Logger
Info(...interface{}) //*logger.Logger
//Context(string, interface{})// *logger.Logger
//Send() (int, error)
//Debug(...interface{})
}
/*
Journaler - interface for journal.
*/
type Journaler interface {
Write([]byte) error
Start() error
Stop()
//Close()
Restart()
}
/*
Starter - interface for StartStop.
*/
type Starter interface {
Start() bool
Stop() bool
Add() bool
Done() bool
Total() int64
IsReady() bool
Block() bool
Unblock() bool
}
/*
HandleStore - interface for handlers store.
*/
type HandleStore interface {
Get(string) (*domain.Handler, error)
Set(string, *domain.Handler)
}
/*
FileNamer - interface for logs names creator.
*/
type FileNamer interface {
GetNewFileName(ext string) (string, error)
GetAfterLatest(last string) ([]string, error)
GetHalf(last string, more bool) ([]string, error)
GetLatestFileName(ext string) (string, error)
}