srun

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IHDUEncoding = base64.NewEncoding("LVoJPiCN2R8G90yg+hmFHuacZ1OWMnrsSTXkYpUq/3dlbfKwv6xztjI7DeBE45QA")

Functions

func XEncode

func XEncode(content string, key string) []byte

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL