summaryrefslogtreecommitdiff
path: root/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'state.go')
-rw-r--r--state.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/state.go b/state.go
index 9187b54..f71d583 100644
--- a/state.go
+++ b/state.go
@@ -27,6 +27,9 @@ type VPNState struct {
// Whether to enable debugging
Debug bool `json:"-"`
+
+ // Serialized connection identifier
+ Identifier string `json:"identifier"`
}
func (state *VPNState) Register(name string, directory string, stateCallback func(string, string, string), debug bool) error {
@@ -194,6 +197,14 @@ func (state *VPNState) SetProfileID(profileID string) error {
return nil
}
+func (state *VPNState) GetIdentifier() string {
+ return state.Identifier
+}
+
+func (state *VPNState) SetIdentifier(identifier string) {
+ state.Identifier = identifier
+}
+
func (state *VPNState) SetConnected() error {
if !state.FSM.HasTransition(fsm.CONNECTED) {
return fsm.WrongStateTransitionError{Got: state.FSM.Current, Want: fsm.CONNECTED}.CustomError()