Documentation ¶
Index ¶
- Variables
- func XEncode(content string, key string) []byte
- type PortalServer
- func (s PortalServer) AcID() string
- func (s PortalServer) ClientIP() string
- func (s *PortalServer) GetAcIDFromSrun()
- func (s *PortalServer) GetChallenge() (*challenge, error)
- func (s *PortalServer) GetUserInfo() (*userInfo, error)
- func (s PortalServer) Internet() bool
- func (s *PortalServer) PortalLogin() (*loginResponse, error)
- func (s *PortalServer) PortalLogout() (*logoutResponse, error)
- func (s *PortalServer) SetAcID(acID string)
- func (s *PortalServer) SetInternetCheckEndpoint(uri string) error
- func (s *PortalServer) SetPassword(password string) error
- func (s *PortalServer) SetUsername(username string) error
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
View Source
var IHDUEncoding = base64.NewEncoding("LVoJPiCN2R8G90yg+hmFHuacZ1OWMnrsSTXkYpUq/3dlbfKwv6xztjI7DeBE45QA")
Functions ¶
Types ¶
type PortalServer ¶
type PortalServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(endpoint, acID string) *PortalServer
func (PortalServer) AcID ¶
func (s PortalServer) AcID() string
func (PortalServer) ClientIP ¶
func (s PortalServer) ClientIP() string
func (*PortalServer) GetAcIDFromSrun ¶
func (s *PortalServer) GetAcIDFromSrun()
func (*PortalServer) GetChallenge ¶
func (s *PortalServer) GetChallenge() (*challenge, error)
func (*PortalServer) GetUserInfo ¶
func (s *PortalServer) GetUserInfo() (*userInfo, error)
func (PortalServer) Internet ¶
func (s PortalServer) Internet() bool
Internet 通过Http请求是否被302到 srun登陆地址 来判断是否能访问互联网
func (*PortalServer) PortalLogin ¶
func (s *PortalServer) PortalLogin() (*loginResponse, error)
func (*PortalServer) PortalLogout ¶
func (s *PortalServer) PortalLogout() (*logoutResponse, error)
func (*PortalServer) SetAcID ¶
func (s *PortalServer) SetAcID(acID string)
func (*PortalServer) SetInternetCheckEndpoint ¶
func (s *PortalServer) SetInternetCheckEndpoint(uri string) error
func (*PortalServer) SetPassword ¶
func (s *PortalServer) SetPassword(password string) error
func (*PortalServer) SetUsername ¶
func (s *PortalServer) SetUsername(username string) error
type ResponseError ¶
type ResponseError struct { ErrorCode interface{} `json:"ecode" chinese:"错误码"` //错误码 Error string `json:"error" chinese:"错误信息"` //错误信息 ErrorMsg string `json:"error_msg" chinese:"错误信息"` //错误信息 }
func (ResponseError) IsOK ¶
func (e ResponseError) IsOK() (bool, error)
Click to show internal directories.
Click to hide internal directories.