-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmethods.go
84 lines (65 loc) · 2.31 KB
/
methods.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
82
83
84
package stegano
type EmbedHandler struct {
concurrency int
}
type ExtractHandler struct {
concurrency int
}
type SecureEmbedHandler struct {
concurrency int
}
type SecureExtractHandler struct {
concurrency int
}
type AudioEmbedHandler struct{}
type AudioExtractHandler struct{}
func NewAudioEmbedHandler() *AudioEmbedHandler {
return &AudioEmbedHandler{}
}
func NewAudioExtractHandler() *AudioExtractHandler {
return &AudioExtractHandler{}
}
// NewEmbedHandlerWithConcurrency initializes an EmbedHandler with a specified concurrency
func NewEmbedHandlerWithConcurrency(concurrency int) (*EmbedHandler, error) {
if concurrency <= 0 {
return nil, ErrInvalidGoroutines
}
return &EmbedHandler{concurrency: concurrency}, nil
}
// NewEmbedHandler initializes an EmbedHandler with default concurrency
func NewEmbedHandler() *EmbedHandler {
return &EmbedHandler{concurrency: 1}
}
// NewExtractHandlerWithConcurrency initializes an ExtractHandler with a specified concurrency
func NewExtractHandlerWithConcurrency(concurrency int) (*ExtractHandler, error) {
if concurrency <= 0 {
return nil, ErrInvalidGoroutines
}
return &ExtractHandler{concurrency: concurrency}, nil
}
// NewExtractHandler initializes an ExtractHandler with default concurrency
func NewExtractHandler() *ExtractHandler {
return &ExtractHandler{concurrency: 1}
}
// NewSecureEmbedHandlerWithConcurrency initializes a SecureEmbedHandler with a specified concurrency
func NewSecureEmbedHandlerWithConcurrency(concurrency int) (*SecureEmbedHandler, error) {
if concurrency <= 0 {
return nil, ErrInvalidGoroutines
}
return &SecureEmbedHandler{concurrency: concurrency}, nil
}
// NewSecureEmbedHandler initializes a SecureEmbedHandler with default concurrency
func NewSecureEmbedHandler() *SecureEmbedHandler {
return &SecureEmbedHandler{concurrency: 1}
}
// NewSecureExtractHandlerWithConcurrency initializes a SecureExtractHandler with a specified concurrency
func NewSecureExtractHandlerWithConcurrency(concurrency int) (*SecureExtractHandler, error) {
if concurrency <= 0 {
return nil, ErrInvalidGoroutines
}
return &SecureExtractHandler{concurrency: concurrency}, nil
}
// NewSecureExtractHandler initializes a SecureExtractHandler with default concurrency
func NewSecureExtractHandler() *SecureExtractHandler {
return &SecureExtractHandler{concurrency: 1}
}