server

package
v0.9.36 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckURLsRequest

type CheckURLsRequest struct {
	Urls []URLRequest `json:"urls"`
}

CheckURLsRequest is a JSON structure for a bulk URL check request

type CheckURLsResponse

type CheckURLsResponse struct {
	Urls   []URLStatusResponse `json:"urls"`
	Result string              `json:"result"`
}

CheckURLsResponse is a JSON structure for the bulk URL check response

type JWTValidationOptions added in v0.9.18

type JWTValidationOptions struct {
	PrivKeyFile      string
	PubKeyFile       string
	SigningAlgorithm string
	JwksUrl          string
}

JWTValidationOptions configures authentication via JWT validation

type Options

type Options struct {
	CORSOrigins           []string
	IPRateLimit           string
	MaxURLsInRequest      uint
	DisableRequestLogging bool
	DomainBlacklistGlobs  []string
	BindAddress           string
	JWTValidationOptions  *JWTValidationOptions
}

Options configures the web service instance

type Server

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

Server starts an instance of the link checker service

func NewServer

func NewServer() Server

NewServer creates a new server instance

func NewServerWithOptions

func NewServerWithOptions(options *Options) Server

NewServerWithOptions creates a new server instance with custom options

func (*Server) Detail

func (s *Server) Detail() *gin.Engine

Detail exposes a *gin.Engine router for testing purposes

func (*Server) Run

func (s *Server) Run()

Run starts the service instance (binds a port) set the PORT environment variable for a different port to bind at

type URLCheckTraceResponse added in v0.9.20

type URLCheckTraceResponse struct {
	Name      string `json:"name"`
	Code      int    `json:"code"`
	ElapsedMs int64  `json:"elapsed_ms"`
	Error     string `json:"error,omitempty"`
}

URLCheckTraceResponse reflects a trace of a single url checker plugin run

type URLRequest

type URLRequest struct {
	Context string `json:"context"` // will simply be echoed back for simpler reference of results
	URL     string `json:"url"`
}

URLRequest is a JSON structure for a single URL check request

type URLStatusResponse

type URLStatusResponse struct {
	// URLRequest is echoed back for correlation purposes
	URLRequest
	// Status is a stringified version of URLCheckStatus
	Status string `json:"status"`
	// HTTPStatus is the HTTP status received by the HTTP client (if available)
	HTTPStatus int `json:"http_status"`
	// Error contains the serialized error. Empty if no error was present
	Error string `json:"error"`
	// FetchedAtEpochSeconds indicates the UNIX timestamp in seconds at which the check has been performed
	FetchedAtEpochSeconds int64 `json:"timestamp"`
	// BodyPatternsFound will be filled with the configured regex patterns found in the response body
	BodyPatternsFound []string `json:"body_patterns_found"`
	// RemoteAddr is filled with the resolved address when `enableRequestTracing` is configured
	RemoteAddr string `json:"remote_addr,omitempty"`
	// CheckTrace is a trace of the url checker plugin responses
	CheckTrace []URLCheckTraceResponse `json:"check_trace"`
	// ElapsedMs is the total duration in milliseconds of the uncached URL check
	ElapsedMs int64 `json:"elapsed_ms"`
}

URLStatusResponse is the JSON response structure for one URL

Jump to

Keyboard shortcuts

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