-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.go
40 lines (34 loc) · 835 Bytes
/
info.go
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
40
package uaa
// Info represents a GET response from a login server
type Info struct {
App struct {
Version string `json:"version"`
} `json:"app"`
Links struct {
UAA string `json:"uaa"`
Login string `json:"login"`
} `json:"links"`
Prompts map[string][]string `json:"prompts"`
}
// APIVersion is the version of the server.
func (info Info) APIVersion() string {
return info.App.Version
}
// LoginLink is the URL to the login server.
func (info Info) LoginLink() string {
return info.Links.Login
}
func (info Info) LoginPrompts() map[string][]string {
return info.Prompts
}
// UAALink is the URL to the UAA server.
func (info Info) UAALink() string {
return info.Links.UAA
}
// NewInfo returns back a new
func NewInfo(link string) Info {
var info Info
info.Links.Login = link
info.Links.UAA = link
return info
}