client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SayHello(ctx context.Context, name string) error
	GenerateGreeting(ctx context.Context, name string) (string, error)
}

Client is an example service interface that we will generate code for

type FakeClient

type FakeClient struct {
}

FakeClient is a Client implementation that will randomly fail

func NewClient

func NewClient() *FakeClient

NewClient is a ctor for fakeClient

func (*FakeClient) GenerateGreeting

func (f *FakeClient) GenerateGreeting(_ context.Context, name string) (string, error)

GenerateGreeting generates a string for a greeting, this will randomly return errors

func (*FakeClient) SayHello

func (f *FakeClient) SayHello(ctx context.Context, name string) error

SayHello is a method that will randomly return an error otherwise it will print a nice greeting

type File

type File struct {
	Name string
}

File is a type defined in the same package that we are using for targetting

type Service

type Service struct{}

Service is an example of a struct defined contract that will be reversed engineered by reinforcer

func (*Service) GetData

func (s *Service) GetData() ([]byte, error)

GetData retrieves data it might randomly error out

type SomeOtherClient

type SomeOtherClient interface {
	DoStuff() error
	SaveFile(myFile *File, osFile *os.File) error
	GetUser(ctx context.Context) (*sub.User, error)
	MethodWithChannel(myChan <-chan bool) error
	MethodWithWildcard(arg interface{})
}

SomeOtherClient is another example service interface that can be targeted

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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