summaryrefslogtreecommitdiff
path: root/src/state.go
blob: 272bbc648cfd29d1f2d13e0c786bb663542dc50f (plain)
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
package eduvpn

type VPNState struct {
	// Info passed by the client
	Name   string

	// The chosen server
	Server *Server
}

func Register(state *VPNState, name string, stateCallback func(string, string)) error {
	state.Name = name

	stateCallback("START", "REGISTER")
	return nil
}

var VPNStateInstance *VPNState

func GetVPNState() *VPNState {
	if VPNStateInstance == nil {
		VPNStateInstance = &VPNState{}
	}
	return VPNStateInstance
}