cmp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path struct {
	Path   string
	Level  int
	Line   int
	Stream bool
}

func (Path) ID

func (p Path) ID() string

ID returns a path identifier. It is saved to not repeat the same requests over again.

type Response

type Response struct {
	Domain string
	Path   string
	Stream bool

	StatusCode   int
	LatestLedger string
	Body         string
	// NormalizedBody is body without parts that identify a single
	// server (ex. domain) and fields known to be different between
	// instances (ex. `result_meta_xdr`).
	NormalizedBody string
}

func NewResponse

func NewResponse(domain, path string, stream bool) *Response

func (*Response) Equal

func (r *Response) Equal(other *Response) bool

func (*Response) GetPaths

func (r *Response) GetPaths() []string

GetPaths finds all URLs in the response body and returns paths (without domain).

func (*Response) SaveDiff

func (r *Response) SaveDiff(outputDir string, other *Response)

func (*Response) Size

func (r *Response) Size() int

type Route

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

func MakeRoute

func MakeRoute(route string) *Route

MakeRoute translates route with * wildcards into a regexp. It adds start/end of line asserts, changes * into any characters except when in used for lists (like /accounts/*) - in such case it ensures there is no more `/` characters. This is not ideal and requires checking routes in correct order but is enough for horizon-cmp. More here: https://regex101.com/r/EhBRtS/1

type Routes

type Routes struct {
	List []*Route
	// contains filtered or unexported fields
}

func (*Routes) Count

func (r *Routes) Count(path string)

func (*Routes) Print

func (r *Routes) Print()

type Scanner

type Scanner struct {
	*bufio.Scanner
	// contains filtered or unexported fields
}

func (*Scanner) LinesRead

func (s *Scanner) LinesRead() int

func (*Scanner) Scan

func (s *Scanner) Scan() bool

Jump to

Keyboard shortcuts

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