blob: be85a45bd39ebc6289fbc59c2e7a33f37c350c61 (
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
|
package eduvpn
type EduVPNState struct {
// The endpoints
Endpoints *EduVPNEndpoints
// Info passed by the client
Name string
Server string
// OAuth
OAuthToken *EduVPNOAuthToken
OAuthSession *EduVPNOAuthSession
}
func Register(state *EduVPNState, name string, server string, stateCallback func(string, string)) error {
state.Name = name
state.Server = server
endpoints, err := APIGetEndpoints(state)
if err != nil {
return err
}
state.Endpoints = endpoints
stateCallback("START", "REGISTER")
return nil
}
var VPNStateInstance *EduVPNState
func GetVPNState() *EduVPNState {
if VPNStateInstance == nil {
VPNStateInstance = &EduVPNState{}
}
return VPNStateInstance
}
|