grpcdiff

package module
v0.0.0-...-c588602 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 17 Imported by: 0

README

grpcdiff

Tools to see different betweenr two different GRPC implementation with same interface

How to install?

If you have go in your environment you can use

go install github.com/egon12/grpcdiff/cmd/grpcdiff

How to use it?

First you need a request in JSON format that will be converted into GRPC Request (protobuf to be exactly). And seperate it by line

For examples:

{}
{"content":"hello"}
{"content":"hello_there"}

and you can save it as requests.jsonrequest or whatever name you like. For now please make your request in one line only. (This app doesn't support pretty print JSON format)

then run it like this.

cat requests.jsonrequest | grpcdiff localhost:50051 yourservice.com:50051 proto.ServiceApp Func

If it detect some differences it will print the differences And if it not detect some differences it will print the time comparison

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

func PrintDiff

func PrintDiff(a, b []byte)

func SimpleCall

func SimpleCall(host, service, method, data string) ([]byte, error)

Types

type Caller

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

func NewCaller

func NewCaller(hostA, hostB string, service, method string) (*Caller, error)

func (*Caller) Call

func (c *Caller) Call(data string) (*Report, error)

type Executor

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

func NewExecutor

func NewExecutor(hostA, hostB, service, method string, input io.Reader) (*Executor, error)

func (*Executor) Execute

func (e *Executor) Execute() error

func (*Executor) ExecuteAll

func (e *Executor) ExecuteAll()

type Report

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

func NewReport

func NewReport(input string, resA, resB []byte, durA, durB time.Duration) *Report

func (*Report) GetDurationAnalysis

func (r *Report) GetDurationAnalysis() string

func (*Report) GetFormattedDiff

func (r *Report) GetFormattedDiff() string

func (*Report) HasDiff

func (r *Report) HasDiff() bool

func (*Report) Report

func (r *Report) Report() string

func (*Report) WriteResToFile

func (r *Report) WriteResToFile() (filenameA, filenameB string)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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