Documentation ¶
Overview ¶
A program used to implement Ruijie web authentication
Index ¶
- Constants
- func Execute()
- func GetCookie(url string) (*http.Cookie, error)
- func GetLoginUrl() (string, string, bool, error)
- func IsOpenWrt() (ok bool)
- func Login() (res string, err error)
- func RegisterMAC(url string, userIndex string, cookie *http.Cookie) (string, error)
- func RootDirFS() (fsys fs.FS)
- func RunCommand(command string, arguments ...string) (code int, output []byte, err error)
- type FileWalker
Constants ¶
const MaxCmdOutputSize = 64 * 1024
MaxCmdOutputSize is the maximum length of performed shell command output in bytes.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetLoginUrl ¶
Get the login url from the redirect url
func IsOpenWrt ¶ added in v1.1.0
func IsOpenWrt() (ok bool)
IsOpenWrt returns true if host OS is OpenWrt.
func RegisterMAC ¶
RegisterMAC register the mac address, only for the first time
Types ¶
type FileWalker ¶ added in v1.1.0
FileWalker is the signature of a function called for files in the file tree. As opposed to filepath.Walk it only walk the files (not directories) matching the provided pattern and those returned by function itself. All patterns should be valid for fs.Glob. If FileWalker returns false for cont then walking terminates. Prefer using bufio.Scanner to read the r since the input is not limited.
TODO(e.burkov, a.garipov): Move into another package like aghfs.
TODO(e.burkov): Think about passing filename or any additional data.