-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patharchitecture.puml
87 lines (65 loc) · 3.55 KB
/
architecture.puml
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
82
83
84
85
86
87
@startuml
namespace law {
interface Callback {
+ OnWriteFailed(content []byte, reason error)
}
class Config << (S,Aquamarine) >> {
+ WithBufferSize(size int) *Config
+ WithCallback(cb Callback) *Config
+ WithQueue(q Queue) *Config
}
interface Queue {
+ Push(value <font color=blue>interface</font>{})
+ Pop() <font color=blue>interface</font>{}
}
class WriteAsyncer << (S,Aquamarine) >> {
+ Stop()
+ Write(p []byte) (int, error)
}
interface Writer {
+ Write( []byte) (int, error)
+ Stop()
}
class emptyCallback << (S,Aquamarine) >> {
+ OnWriteFailed( []byte, error)
}
}
"law.Writer" <|-- "law.WriteAsyncer"
"law.Callback" <|-- "law.emptyCallback"
namespace lockfree {
class LockFreeQueue << (S,Aquamarine) >> {
+ Push(value <font color=blue>interface</font>{})
+ Pop() <font color=blue>interface</font>{}
+ Length() int64
+ Reset()
}
class Node << (S,Aquamarine) >> {
+ Reset()
}
class NodePool << (S,Aquamarine) >> {
+ Get() *Node
+ Put(n *Node)
}
}
"law.Queue" <|-- "lockfree.LockFreeQueue"
namespace utils {
class BlackHoleWriter << (S,Aquamarine) >> {
+ Write(p []byte) (int, error)
}
}
namespace writer {
class BufferPool << (S,Aquamarine) >> {
+ Get() *bytes.Buffer
+ Put(e *bytes.Buffer)
}
class Status << (S,Aquamarine) >> {
+ IsRunning() bool
+ SetRunning(running bool)
+ GetExecuteAt() int64
+ SetExecuteAt(executeAt int64)
}
}
left to right direction
writer-[hidden]right- utils
hide fields
@enduml