httpserver

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package httpserver — NTLM challenge/response helpers.

Package httpserver implements the HTTP mock server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NTLMTokenType added in v0.11.0

func NTLMTokenType(authHeader string) int

NTLMTokenType classifies an NTLM Authorization header value. Returns 1 (Negotiate), 3 (Authenticate), or 0 (not NTLM / unrecognised).

Types

type Server

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

Server is the HTTP mock server.

func New

func New(cfg *config.HTTPConfig, store *state.Store, sc *scenarios.Store, log *logger.Logger) *Server

New creates a Server. The mocks slice is taken from cfg initially but can be replaced at runtime via SetMocks.

func (*Server) CallCount added in v0.3.0

func (s *Server) CallCount(mockID string) int64

CallCount returns how many times the mock with the given ID has been called.

func (*Server) GetMocks

func (s *Server) GetMocks() []config.HTTPMock

GetMocks returns the current mock list.

func (*Server) MarshalMocks

func (s *Server) MarshalMocks() ([]byte, error)

MarshalMocks returns the mock list as JSON bytes.

func (*Server) ResetCallCounts added in v0.3.0

func (s *Server) ResetCallCounts()

ResetCallCounts zeroes all call counters.

func (*Server) SetMocks

func (s *Server) SetMocks(mocks []config.HTTPMock)

SetMocks replaces the current mock list and resets all call counts.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start begins listening. It blocks until ctx is cancelled.

func (*Server) StatusInfo

func (s *Server) StatusInfo() map[string]interface{}

StatusInfo returns JSON-serialisable info about this server.

Jump to

Keyboard shortcuts

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