-
Notifications
You must be signed in to change notification settings - Fork 3
/
options.go
59 lines (52 loc) · 1.21 KB
/
options.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
package gobaresip
// SetOption takes one or more option function and applies them in order to Baresip.
func (b *Baresip) SetOption(options ...func(*Baresip) error) error {
for _, opt := range options {
if err := opt(b); err != nil {
return err
}
}
return nil
}
// SetCtrlTCPAddr sets the ctrl_tcp modules address.
func SetCtrlTCPAddr(opt string) func(*Baresip) error {
return func(b *Baresip) error {
b.ctrlAddr = opt
return nil
}
}
// SetWsAddr sets the ws address.
func SetWsAddr(opt string) func(*Baresip) error {
return func(b *Baresip) error {
b.wsAddr = opt
return nil
}
}
// SetConfigPath sets the config path.
func SetConfigPath(opt string) func(*Baresip) error {
return func(b *Baresip) error {
b.configPath = opt
return nil
}
}
// SetAudioPath sets the audio path.
func SetAudioPath(opt string) func(*Baresip) error {
return func(b *Baresip) error {
b.audioPath = opt
return nil
}
}
// SetDebug sets the debug mode.
func SetDebug(opt bool) func(*Baresip) error {
return func(b *Baresip) error {
b.debug = opt
return nil
}
}
// SetUserAgent sets the UserAgent.
func SetUserAgent(opt string) func(*Baresip) error {
return func(b *Baresip) error {
b.userAgent = opt
return nil
}
}