diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-21 16:52:55 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-21 16:52:55 +0200 |
| commit | b4d744a80aa79d45f8a46119920abc1279ad4f20 (patch) | |
| tree | c308df90904cdaf1657bd1480f6104ecfbbc2063 /state.go | |
| parent | f6c074f4fb99fa29927d3b62dd10457bd659f3ed (diff) | |
State: Add functions for getting/setting a connection identifier
e.g. the uuid of the connection in case of NetworkManager on Linux
Diffstat (limited to 'state.go')
| -rw-r--r-- | state.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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() |
