blob: 22dcaafe001c9ddf4572d4306d671d049ee92622 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package eduvpn
type EduVPNState struct {
// The struct used for oauth
OAuth *EduVPNOauth
// The endpoints
Endpoints *EduVPNEndpoints
// Info passed by the client
Name string
Server string
}
func Register(state *EduVPNState, name string, server string) error {
state.Name = name
state.Server = server
endpoints, err := APIGetEndpoints(state)
if err != nil {
return err
}
state.Endpoints = endpoints
return nil
}
var VPNStateInstance *EduVPNState
func GetVPNState() *EduVPNState {
if VPNStateInstance == nil {
VPNStateInstance = &EduVPNState{}
}
return VPNStateInstance
}
|