response

package
v0.0.0-...-851e5e8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package response provides utilities for processing and validation of NordVPN backend api responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopValidator

type NoopValidator struct{}

func (NoopValidator) Validate

func (NoopValidator) Validate(int, http.Header, []byte) error

type NordValidator

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

func NewNordValidator

func NewNordValidator() (*NordValidator, error)

func (*NordValidator) Validate

func (v *NordValidator) Validate(code int, headers http.Header, body []byte) error

Validate validates that the response came from actual NordVPN API

type Validator

type Validator interface {
	// Validate validates headers.
	Validate(code int, headers http.Header, body []byte) error
}

Jump to

Keyboard shortcuts

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