@@ -12,14 +12,17 @@ import (
1212 "github.com/lightningnetwork/lnd/lntest/wait"
1313)
1414
15- type hashmailHarness struct {
16- aperture * aperture.Aperture
17- apertureCfg * aperture.Config
15+ type HashmailHarness struct {
16+ aperture * aperture.Aperture
17+
18+ // ApertureCfg is the configuration aperture uses when being initialized.
19+ ApertureCfg * aperture.Config
1820}
1921
20- func newHashmailHarness () * hashmailHarness {
21- return & hashmailHarness {
22- apertureCfg : & aperture.Config {
22+ // NewHashmailHarness creates a new instance of the HashmailHarness.
23+ func NewHashmailHarness () * HashmailHarness {
24+ return & HashmailHarness {
25+ ApertureCfg : & aperture.Config {
2326 ListenAddr : fmt .Sprintf ("127.0.0.1:%d" ,
2427 node .NextAvailablePort ()),
2528 Authenticator : & aperture.AuthConfig {
@@ -39,8 +42,8 @@ func newHashmailHarness() *hashmailHarness {
3942}
4043
4144// initAperture starts the aperture proxy.
42- func (hm * hashmailHarness ) initAperture () error {
43- hm .aperture = aperture .NewAperture (hm .apertureCfg )
45+ func (hm * HashmailHarness ) initAperture () error {
46+ hm .aperture = aperture .NewAperture (hm .ApertureCfg )
4447 errChan := make (chan error )
4548
4649 if err := hm .aperture .Start (errChan ); err != nil {
@@ -60,7 +63,7 @@ func (hm *hashmailHarness) initAperture() error {
6063 }
6164 return wait .NoError (func () error {
6265 apertureAddr := fmt .Sprintf ("https://%s/dummy" ,
63- hm .apertureCfg .ListenAddr )
66+ hm .ApertureCfg .ListenAddr )
6467
6568 resp , err := http .Get (apertureAddr )
6669 if err != nil {
@@ -75,14 +78,16 @@ func (hm *hashmailHarness) initAperture() error {
7578 }, 3 * time .Second )
7679}
7780
78- func (hm * hashmailHarness ) start () error {
81+ // Start attempts to start the aperture proxy.
82+ func (hm * HashmailHarness ) Start () error {
7983 if err := hm .initAperture (); err != nil {
8084 return fmt .Errorf ("could not start aperture: %v" , err )
8185 }
8286
8387 return nil
8488}
8589
86- func (hm * hashmailHarness ) stop () error {
90+ // Stop attempts to stop the aperture proxy.
91+ func (hm * HashmailHarness ) Stop () error {
8792 return hm .aperture .Stop ()
8893}
0 commit comments