client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const FailedAttempt = "no SID cookie found in response header"

Variables

This section is empty.

Functions

func CheckIsLoginRequired

func CheckIsLoginRequired(httpResponseBody string) bool

func DoHttpRequestAndReadResponse

func DoHttpRequestAndReadResponse(args *types.GlobalOptions, httpMethod string, host string, requestUrl string, requestBody string) (string, error)

func DoUnauthenticatedHttpRequestAndReadResponse

func DoUnauthenticatedHttpRequestAndReadResponse(args *types.GlobalOptions, httpMethod string, requestUrl string, requestBody string) (string, error)

func ReadTokenAndModel2GlobalOptions

func ReadTokenAndModel2GlobalOptions(args *types.GlobalOptions, host string) (types.NetgearModel, string, error)

func RequestPage

func RequestPage(args *types.GlobalOptions, host string, url string) (string, error)

Types

type LoginCommand

type LoginCommand struct {
	Address  string `required:"" help:"the Netgear switch's IP address or host name to connect to" short:"a"`
	Password string `optional:"" help:"the admin console's password; if omitted, it will be prompted for" short:"p"`
}

func (*LoginCommand) Run

func (login *LoginCommand) Run(args *types.GlobalOptions) error

type MockHTTPServer

type MockHTTPServer struct {
	// contains filtered or unexported fields
}

MockHTTPServer creates a test HTTP server that mimics switch behavior

func NewMockHTTPServer

func NewMockHTTPServer(model types.NetgearModel) *MockHTTPServer

NewMockHTTPServer creates a new mock server for testing

func (*MockHTTPServer) Close

func (m *MockHTTPServer) Close()

func (*MockHTTPServer) GetRequests

func (m *MockHTTPServer) GetRequests() []RequestLog

func (*MockHTTPServer) URL

func (m *MockHTTPServer) URL() string

type RequestLog

type RequestLog struct {
	Method string
	URL    string
	Body   string
	Header http.Header
}